Skip to content

Commit 13debc9

Browse files
author
Michael Zingale
committed
dovis does not need the n argument
1 parent 601be89 commit 13debc9

File tree

6 files changed

+31
-14
lines changed

6 files changed

+31
-14
lines changed

advection/advectiveFluxes.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ def unsplitFluxes(my_data, rp, dt, scalar_name):
3838
my_data : CellCenterData2d object
3939
The data object containing the grid and advective scalar that
4040
we are advecting.
41+
rp : RuntimeParameters object
42+
The runtime parameters for the simulation
4143
dt : float
4244
The timestep we are advancing through.
4345
scalar_name : str

advection/simulation.py

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,19 @@
99
class Simulation:
1010

1111
def __init__(self, problem_name, rp, timers=None):
12+
"""
13+
Initialize the Simulation object for linear advection.
14+
15+
Parameters
16+
----------
17+
problem_name : str
18+
The name of the problem we wish to run. This should
19+
correspond to one of the modules in advection/problems/
20+
rp : RuntimeParameters object
21+
The runtime parameters for the simulation
22+
timers : TimerCollection object, optional
23+
The timers used for profiling this simulation
24+
"""
1225

1326
self.rp = rp
1427
self.cc_data = None
@@ -73,7 +86,7 @@ def initialize(self):
7386

7487
def timestep(self):
7588
"""
76-
Computes the advective timestep (CFL) constraint. We use the
89+
Compute the advective timestep (CFL) constraint. We use the
7790
driver.cfl parameter to control what fraction of the CFL
7891
step we actually take.
7992
"""
@@ -93,21 +106,21 @@ def timestep(self):
93106

94107

95108
def preevolve(self):
96-
97-
# do nothing
109+
"""
110+
Do any necessary evolution before the main evolve loop. This
111+
is not needed for advection
112+
"""
98113
pass
99114

100115

101116
def evolve(self, dt):
102117
"""
103118
Evolve the linear advection equation through one timestep. We only
104-
consider the "density" variable in the CellCenterData2d object input
105-
here.
119+
consider the "density" variable in the CellCenterData2d object that
120+
is part of the Simulation.
106121
107122
Parameters
108123
----------
109-
self.cc_data : CellCenterData2d object
110-
The data object containing the scalar quantity we are advecting
111124
dt : float
112125
The timestep to evolve through
113126
@@ -137,8 +150,10 @@ def evolve(self, dt):
137150
dtdy*(flux_y[0:qx-1,0:qy-1] - flux_y[0:qx-1,1:qy])
138151

139152

140-
def dovis(self, n):
141-
153+
def dovis(self):
154+
"""
155+
Do runtime visualization.
156+
"""
142157
pylab.clf()
143158

144159
dens = self.cc_data.get_var("density")

diffusion/simulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def evolve(self, dt):
159159
phi[:,:] = mg.get_solution()
160160

161161

162-
def dovis(self, n):
162+
def dovis(self):
163163

164164
pylab.clf()
165165

incompressible/simulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ def evolve(self, dt):
471471
self.cc_data.fill_BC("y-velocity")
472472

473473

474-
def dovis(self, n):
474+
def dovis(self):
475475

476476
pylab.clf()
477477

plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def makeplot(myd, solverName, outfile):
1818

1919
pylab.figure(num=1, figsize=(8,4.5), dpi=100, facecolor='w')
2020

21-
sim.dovis(0)
21+
sim.dovis()
2222
pylab.savefig(outfile)
2323
pylab.show()
2424

pyro.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@
180180
dovis = rp.get_param("vis.dovis")
181181
if dovis:
182182
pylab.figure(num=1, figsize=(8,6), dpi=100, facecolor='w')
183-
sim.dovis(0)
183+
sim.dovis()
184184

185185
nout = 0
186186

@@ -239,7 +239,7 @@
239239
tm_vis = tc.timer("vis")
240240
tm_vis.begin()
241241

242-
sim.dovis(n)
242+
sim.dovis()
243243
store = rp.get_param("vis.store_images")
244244

245245
if store == 1:

0 commit comments

Comments
 (0)