Serac
0.1
Serac is an implicit thermal strucural mechanics simulation code.
|
Manages the lifetimes of FEState objects such that restarts are abstracted from physics modules. More...
#include <state_manager.hpp>
Static Public Member Functions | |
static void | initialize (axom::sidre::DataStore &ds, const std::string &output_directory) |
Initializes the StateManager with a sidre DataStore (into which state will be written/read) More... | |
template<typename FunctionSpace > | |
static FiniteElementState | newState (FunctionSpace space, const std::string &state_name, const std::string &mesh_tag) |
Factory method for creating a new FEState object. More... | |
static FiniteElementState | newState (const mfem::ParFiniteElementSpace &space, const std::string &state_name) |
Factory method for creating a new FEState object. More... | |
static void | storeState (FiniteElementState &state) |
Store a pre-constructed finite element state in the state manager. More... | |
template<typename FunctionSpace > | |
static FiniteElementDual | newDual (FunctionSpace space, const std::string &dual_name, const std::string &mesh_tag) |
Factory method for creating a new FEDual object. More... | |
static FiniteElementDual | newDual (const mfem::ParFiniteElementSpace &space, const std::string &dual_name) |
Factory method for creating a new FEDual object. More... | |
static void | storeDual (FiniteElementDual &dual) |
Store a pre-constructed finite element dual in the state manager. More... | |
static void | updateState (const FiniteElementState &state) |
Updates the StateManager-owned grid function using the values from a given FiniteElementState. More... | |
static void | updateDual (const FiniteElementDual &dual) |
Updates the StateManager-owned grid function using the values from a given FiniteElementDual. More... | |
static void | save (const double t, const int cycle, const std::string &mesh_tag) |
Updates the Conduit Blueprint state in the datastore and saves to a file. More... | |
static double | load (const int cycle_to_load, const std::string &mesh_tag) |
Loads an existing DataCollection. More... | |
static void | reset () |
Resets the underlying global datacollection object. More... | |
static mfem::ParMesh & | setMesh (std::unique_ptr< mfem::ParMesh > pmesh, const std::string &mesh_tag) |
Gives ownership of mesh to StateManager. More... | |
static mfem::ParMesh & | mesh (const std::string &mesh_tag) |
Returns a non-owning reference to mesh held by StateManager. More... | |
static FiniteElementState & | shapeDisplacement (const std::string &mesh_tag) |
Get the shape displacement finite element state. More... | |
static void | loadCheckpointedStates (int cycle_to_load, std::vector< std::reference_wrapper< FiniteElementState >> states_to_load) |
loads the finite element states from a previously checkpointed cycle More... | |
static FiniteElementDual & | shapeDisplacementSensitivity (const std::string &mesh_tag) |
Get the shape displacement sensitivity finite element dual. More... | |
static std::string | collectionID (const mfem::ParMesh *pmesh) |
Returns the datacollection ID for a given mesh. More... | |
static bool | isRestart () |
Returns true if data was loaded into a DataCollection. | |
static int | cycle (std::string mesh_tag) |
Get the current cycle (iteration number) from the underlying datacollection. More... | |
static double | time (std::string mesh_tag) |
Get the current simulation time from the underlying datacollection. More... | |
Manages the lifetimes of FEState objects such that restarts are abstracted from physics modules.
Definition at line 41 of file state_manager.hpp.
|
static |
Returns the datacollection ID for a given mesh.
[in] | pmesh | Pointer to a mesh (non-owning) |
nullptr
then the default collection ID is returned. Definition at line 303 of file state_manager.cpp.
|
static |
Get the current cycle (iteration number) from the underlying datacollection.
mesh_tag | The datacollection (mesh name) to query |
Definition at line 314 of file state_manager.cpp.
|
static |
Initializes the StateManager with a sidre DataStore (into which state will be written/read)
[in] | ds | The DataStore to use |
[in] | output_directory | The directory to output files to - cannot be empty |
Definition at line 115 of file state_manager.cpp.
|
inlinestatic |
Loads an existing DataCollection.
[in] | cycle_to_load | What cycle to load the DataCollection from |
[in] | mesh_tag | The mesh_tag associated with the DataCollection when it was saved |
Definition at line 179 of file state_manager.hpp.
|
static |
loads the finite element states from a previously checkpointed cycle
cycle_to_load | |
states_to_load |
Definition at line 93 of file state_manager.cpp.
|
static |
Returns a non-owning reference to mesh held by StateManager.
[in] | mesh_tag | A string that uniquely identifies the mesh |
Definition at line 294 of file state_manager.cpp.
|
static |
Factory method for creating a new FEDual object.
space | A finite element space to copy for use in the new dual |
dual_name | The name of the new dual |
Definition at line 199 of file state_manager.cpp.
|
inlinestatic |
Factory method for creating a new FEDual object.
FunctionSpace | The function space (e.g. H1<1>) to build the finite element dual on |
space | The function space (e.g. H1<1>) to build the finite element dual on |
dual_name | The name of the new finite element dual field |
mesh_tag | The tag for the stored mesh used to construct the finite element state |
Definition at line 104 of file state_manager.hpp.
|
static |
Factory method for creating a new FEState object.
space | A finite element space to copy for use in the new state |
state_name | The name of the new state |
Definition at line 159 of file state_manager.cpp.
|
inlinestatic |
Factory method for creating a new FEState object.
FunctionSpace | The function space (e.g. H1<1>) to build the finite element state on |
space | The function space (e.g. H1<1>) to build the finite element state on |
state_name | The name of the new finite element state field |
mesh_tag | The tag for the stored mesh used to construct the finite element state |
Definition at line 62 of file state_manager.hpp.
|
inlinestatic |
Resets the underlying global datacollection object.
After this method, the StateManager is in the same state that it would be after the program started and before any StateManager methods have been called. If the client wants to use StateManager after a call to reset(), the initialize() method must be called.
Definition at line 195 of file state_manager.hpp.
|
static |
Updates the Conduit Blueprint state in the datastore and saves to a file.
[in] | t | The current sim time |
[in] | cycle | The current iteration number of the simulation |
[in] | mesh_tag | A string that uniquely identifies the mesh (and accompanying fields) to save |
Definition at line 213 of file state_manager.cpp.
|
static |
Gives ownership of mesh to StateManager.
[in] | pmesh | The mesh to register |
[in] | mesh_tag | A string that uniquely identifies the mesh |
Definition at line 228 of file state_manager.cpp.
|
static |
Get the shape displacement finite element state.
This is the vector-valued H1 field of order 1 (linear nodal displacements) representing perturbations of the underlying mesh. This is used for shape optimization problems.
mesh_tag | A string that uniquely identifies the mesh |
Definition at line 130 of file state_manager.cpp.
|
static |
Get the shape displacement sensitivity finite element dual.
This is the vector-valued H1 dual of order 1 representing sensitivities of the shape displacement field of the underlying mesh. This is used for shape optimization problems.
mesh_tag | A string that uniquely identifies the mesh |
|
static |
Store a pre-constructed finite element dual in the state manager.
dual | The finite element dual to store |
Definition at line 173 of file state_manager.cpp.
|
static |
Store a pre-constructed finite element state in the state manager.
state | The finite element state to store |
Definition at line 135 of file state_manager.cpp.
|
static |
Get the current simulation time from the underlying datacollection.
mesh_tag | The datacollection (mesh name) to query |
Definition at line 321 of file state_manager.cpp.
|
inlinestatic |
Updates the StateManager-owned grid function using the values from a given FiniteElementDual.
This sync operation must occur prior to writing a restart file.
dual | The dual used to update the internal grid function |
Definition at line 157 of file state_manager.hpp.
|
inlinestatic |
Updates the StateManager-owned grid function using the values from a given FiniteElementState.
This sync operation must occur prior to writing a restart file.
state | The state used to update the internal grid function |
Definition at line 141 of file state_manager.hpp.