Skip to content

Commit 64c838d

Browse files
committed
a little cleaning
1 parent ae2370a commit 64c838d

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

ADDITIONS

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
* convergence testing via Richardson extrapolation
2+
3+
-- always test the convergence of the initial conditions
4+
5+
* PPM vis
6+
7+
* well-balancing

figures/advection/domains.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def domains(method="FTCS"):
107107
f.set_size_inches(9.0,5.0)
108108

109109
plt.tight_layout()
110-
plt.savefig("domains_{}.pdf".format(method), bbox_inches="tight")
110+
plt.savefig(f"domains_{method}.pdf", bbox_inches="tight")
111111

112112

113113
if __name__== "__main__":

figures/advection/fd_ghost.py

+7-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import numpy as np
2-
import matplotlib.pyplot as plt
31
import grid_plot as gp
2+
import numpy as np
43

54
# plot a simple finite-difference grid
65

@@ -14,20 +13,18 @@
1413

1514
gr = gp.FDGrid(nzones, ng=1)
1615

17-
plt.clf()
18-
1916
gr.draw_grid(draw_ghost=1)
2017

2118
labels = ["-1", "0", "1", "", "i-1", "i", "i+1", "", "N-2", "N-1", "N"]
2219

2320
for i in range(gr.ilo-gr.ng, gr.ng+gr.nx+1):
2421
if not labels[i] == "":
2522
gr.label_node(i, r"$%s$" % (labels[i]), fontsize="medium")
26-
23+
2724
# draw the data
2825
for i in range(gr.ilo, gr.ihi+1):
29-
gr.draw_data(i, a[i-gr.ng], color="r")
30-
26+
gr.draw_data(i, a[i-gr.ng], color="r")
27+
3128

3229
gr.label_value(gr.ilo+4, a[gr.ilo+4-gr.ng], r"$a_i$", color="r")
3330

@@ -36,9 +33,8 @@
3633

3734
gr.clean_axes(pad_fac=0.1, show_ghost=True, ylim=(-0.5, 1.3))
3835

39-
f = plt.gcf()
40-
f.set_size_inches(10.0,3.0)
41-
36+
fig = gr.fig
37+
fig.set_size_inches(10.0,3.0)
4238

43-
plt.savefig("fd_ghost.pdf")
4439

40+
fig.savefig("fd_ghost.pdf")

figures/advection/rea-limitex.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# reconstruct - evolve - average: demonstrate what happens when we don't
22
# limit
33

4-
from __future__ import print_function
54

65
import numpy as np
76
import matplotlib.pyplot as plt

0 commit comments

Comments
 (0)