Wrapper class that owns a libMesh EquationSystem and adds advanced restart capability to it. More...
#include <RestartableEquationSystems.h>
Classes | |
struct | EquationSystemsHeader |
Represents a stored EquationSystems in restart. More... | |
struct | SystemHeader |
Represents a stored system in restart. More... | |
struct | VariableHeader |
Represents a stored variable in restart. More... | |
struct | VectorHeader |
Represents a stored variable in restart. More... | |
Public Member Functions | |
RestartableEquationSystems (libMesh::MeshBase &mesh) | |
void | store (std::ostream &stream) const |
Stores the EquationSystems to the given stream. More... | |
void | load (std::istream &stream) |
Loads the EquationSystems from the given stream. More... | |
void | setLoadAllVectors (const bool load_all_vectors) |
Sets whether or not all vectors are to be loaded. More... | |
bool | isVariableRestored (const std::string &system_name, const std::string &vector_name, const std::string &variable_name) const |
Checks whether variable was successfully restored from a restart file. More... | |
const std::set< std::tuple< std::string, std::string, std::string > > & | getLoadedVariables () const |
Returns the set of variables that were loaded during the load() function. Each set of variables contain; [system name, vector name, variable name]. More... | |
libMesh::EquationSystems & | es () |
const libMesh::EquationSystems & | es () const |
Private Member Functions | |
EquationSystemsHeader | buildHeader (const std::vector< const libMesh::DofObject *> &ordered_objects) const |
Internal method for building the header struct. More... | |
std::vector< const libMesh::DofObject * > | orderDofObjects () const |
Internal method for ordering the DofObjects by ID (elems and the nodes) More... | |
void | restore (const SystemHeader &from_sys_header, const VectorHeader &from_vec_header, const VariableHeader &from_var_header, const libMesh::System &to_sys, libMesh::NumericVector< libMesh::Number > &to_vec, const libMesh::Variable &to_var, std::istream &stream) |
Private Attributes | |
libMesh::EquationSystems | _es |
The underlying EquationSystems. More... | |
bool | _load_all_vectors |
Whether or not to load all of the vectors, including ones that haven't been added yet. More... | |
std::size_t | _loaded_stream_data_begin |
The starting position for the vector data in the input stream. More... | |
std::vector< const libMesh::DofObject * > | _loaded_ordered_objects |
The object ordering for this data. More... | |
EquationSystemsHeader | _loaded_header |
The loaded header. More... | |
std::set< std::tuple< std::string, std::string, std::string > > | _loaded_variables |
The variables that were loaded in load(); [system name, vector name, variable name]. More... | |
Wrapper class that owns a libMesh EquationSystem and adds advanced restart capability to it.
Definition at line 32 of file RestartableEquationSystems.h.
RestartableEquationSystems::RestartableEquationSystems | ( | libMesh::MeshBase & | mesh | ) |
Definition at line 22 of file RestartableEquationSystems.C.
|
private |
Internal method for building the header struct.
Definition at line 28 of file RestartableEquationSystems.C.
Referenced by store().
|
inline |
Definition at line 130 of file RestartableEquationSystems.h.
Referenced by FEProblemBase::es().
|
inline |
Definition at line 131 of file RestartableEquationSystems.h.
|
inline |
Returns the set of variables that were loaded during the load()
function. Each set of variables contain; [system name, vector name, variable name].
Definition at line 152 of file RestartableEquationSystems.h.
Referenced by to_json().
bool RestartableEquationSystems::isVariableRestored | ( | const std::string & | system_name, |
const std::string & | vector_name, | ||
const std::string & | variable_name | ||
) | const |
Checks whether variable was successfully restored from a restart file.
Definition at line 316 of file RestartableEquationSystems.C.
Referenced by restore().
void RestartableEquationSystems::load | ( | std::istream & | stream | ) |
Loads the EquationSystems from the given stream.
Definition at line 223 of file RestartableEquationSystems.C.
Referenced by dataLoad().
|
private |
Internal method for ordering the DofObjects by ID (elems and the nodes)
Definition at line 121 of file RestartableEquationSystems.C.
Referenced by load(), and store().
|
private |
Definition at line 325 of file RestartableEquationSystems.C.
Referenced by load().
|
inline |
Sets whether or not all vectors are to be loaded.
By default, this is true. This means that all vectors that do not currently exist in the system will be added and loaded.
Typically, we would want this to be false in the case of restart.
Definition at line 144 of file RestartableEquationSystems.h.
Referenced by FEProblemBase::initialSetup().
void RestartableEquationSystems::store | ( | std::ostream & | stream | ) | const |
Stores the EquationSystems to the given stream.
Definition at line 138 of file RestartableEquationSystems.C.
Referenced by dataStore().
|
private |
The underlying EquationSystems.
Definition at line 174 of file RestartableEquationSystems.h.
Referenced by buildHeader(), es(), load(), orderDofObjects(), restore(), and store().
|
private |
Whether or not to load all of the vectors, including ones that haven't been added yet.
Definition at line 177 of file RestartableEquationSystems.h.
Referenced by load(), and setLoadAllVectors().
|
private |
The loaded header.
Definition at line 183 of file RestartableEquationSystems.h.
|
private |
The object ordering for this data.
Definition at line 181 of file RestartableEquationSystems.h.
|
private |
The starting position for the vector data in the input stream.
Definition at line 179 of file RestartableEquationSystems.h.
|
private |
The variables that were loaded in load(); [system name, vector name, variable name].
Definition at line 186 of file RestartableEquationSystems.h.
Referenced by getLoadedVariables(), isVariableRestored(), load(), and restore().