NRL-Plasma-Physics-Division / turbopy

A lightweight computational physics framework, based on the organization of turboWAVE. Implements a "Simulation, PhysicsModule, ComputeTool, Diagnostic" class hierarchy.
https://turbopy.readthedocs.io/
Creative Commons Zero v1.0 Universal
10 stars 18 forks source link

Reorder steps in `prepare_simulation` #140

Closed arichar6 closed 4 years ago

arichar6 commented 4 years ago

The function prepare_simulation in the Simulation class does the work of parsing the input and creating instances of the turboPy objects. Currently, the clock is initialized after the PhysicsModules are initialized. This means that dt is not yet set, so if the modules need it, they have to read it in the initialize function rather than in __init__.

The sequence of steps should be changed so that the clock is constructed first.