GRINS-0.8.0
|
Initialize static objects needed for simulation. More...
#include <simulation_initializer.h>
Public Member Functions | |
SimulationInitializer () | |
~SimulationInitializer () | |
Static Private Attributes | |
static bool | _is_initialized = false |
Simulation objects may need to be created multiple times within a single GRINS-linked program (e.g. More... | |
Initialize static objects needed for simulation.
The factory pattern used in GRINS uses static factory objects to handle construction of various modules while providing an easy mechanism for user extensibility for new variants. However, static linking will strip the symbols unless the object is explicitly instantiated. So, we encapluate instantiation of all the factory initialization objects here to ensure they are instantiated before they are used by Simulation at construction time.
Definition at line 37 of file simulation_initializer.h.
GRINS::SimulationInitializer::SimulationInitializer | ( | ) |
Definition at line 39 of file simulation_initializer.C.
References _is_initialized.
|
inline |
Definition at line 41 of file simulation_initializer.h.
|
staticprivate |
Simulation objects may need to be created multiple times within a single GRINS-linked program (e.g.
for parameter variations), so we need to cache whether or not this initializer has been called during the current program run. If so, then we don't instantiate the factory initializer objects because they've already been created.
Definition at line 51 of file simulation_initializer.h.
Referenced by SimulationInitializer().