@@ -35,6 +35,19 @@ def __init__(self, idens=-1, ixmom=-1, iymom=-1, iener=-1):
3535class Simulation :
3636
3737 def __init__ (self , problem_name , rp , timers = None ):
38+ """
39+ Initialize the Simulation object for compressible hydrodynamics.
40+
41+ Parameters
42+ ----------
43+ problem_name : str
44+ The name of the problem we wish to run. This should
45+ correspond to one of the modules in compressible/problems/
46+ rp : RuntimeParameters object
47+ The runtime parameters for the simulation
48+ timers : TimerCollection object, optional
49+ The timers used for profiling this simulation
50+ """
3851
3952 self .rp = rp
4053 self .cc_data = None
@@ -52,7 +65,8 @@ def __init__(self, problem_name, rp, timers=None):
5265
5366 def initialize (self ):
5467 """
55- initialize the grid and variables for compressible flow
68+ Initialize the grid and variables for compressible flow and set
69+ the initial conditions for the chosen problem.
5670 """
5771
5872 # setup the grid
@@ -176,14 +190,17 @@ def timestep(self):
176190
177191
178192 def preevolve (self ):
179-
180- # do nothing
193+ """
194+ Do any necessary evolution before the main evolve loop. This
195+ is not needed for compressible flow.
196+ """
181197 pass
182198
183199
184200 def evolve (self , dt ):
185201 """
186- Evolve the equations of compressible hydrodynamics through a timestep dt
202+ Evolve the equations of compressible hydrodynamics through a
203+ timestep dt.
187204 """
188205
189206 tm_evolve = self .tc .timer ("evolve" )
@@ -224,6 +241,9 @@ def evolve(self, dt):
224241
225242
226243 def dovis (self ):
244+ """
245+ Do runtime visualization.
246+ """
227247
228248 pylab .clf ()
229249
@@ -338,4 +358,8 @@ def dovis(self):
338358
339359
340360 def finalize (self ):
361+ """
362+ Do any final clean-ups for the simulation and call the problem's
363+ finalize() method.
364+ """
341365 exec self .problem_name + '.finalize()'
0 commit comments