99class 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" )
0 commit comments