The Spheral controller
Nearly done! The next stage is to build a SpheralController object. This is the object the user will use to advance a problem in time, specify when and how to output files such as restart checkpoint or visualization files, do any other optional periodic work, etc.
189#-------------------------------------------------------------------------------
190# Build the controller.
191#-------------------------------------------------------------------------------
192control = SpheralController(integrator = integrator,
193 kernel = WT,
194 restartStep = restartStep,
195 restartBaseName = restartBaseName,
196 restoreCycle = restoreCycle,
197 vizBaseName = "Sedov-cylindrical-{}".format(nRadial),
198 vizDir = vizDir,
199 vizStep = vizCycle,
200 vizTime = vizTime,
201 SPH = True)
202output("control")
The SpheralController has a few required arguments, such as the time integrator (integrator) and interpolation kernel (WT). Note we have also specified when, how, and where to output restart files (restartStep and restartBaseName); similarly we specify where and when to drop visualization files (vizDir, vizStep, and vizTime). There are many other options we can give the SpheralController, include the ability to have it run arbitrary user specified Python methods at regular intervals as the problem progresses. This is the fundamental job of the SpheralController: take steps using the provided integrator, and between steps do other necessary jobs including restarts, visualizations, analysis, or anything else we would like to have happen on some frequency. See SpheralController for more information.