14 #include <unordered_map> 17 #include "libmesh/enum_order.h" 18 #include "libmesh/fe_type.h" 19 #include "libmesh/equation_systems.h" 20 #include "nlohmann/json.h" 25 class EquationSystems;
97 std::map<std::string, RestartableEquationSystems::VariableHeader>
variables;
99 std::map<std::string, RestartableEquationSystems::VectorHeader>
vectors;
112 std::map<std::string, RestartableEquationSystems::SystemHeader>
systems;
120 void store(std::ostream & stream)
const;
124 void load(std::istream & stream);
148 const std::string & vector_name,
149 const std::string & variable_name)
const;
159 EquationSystemsHeader
160 buildHeader(
const std::vector<const libMesh::DofObject *> & ordered_objects)
const;
165 void restore(
const SystemHeader & from_sys_header,
166 const VectorHeader & from_vec_header,
167 const VariableHeader & from_var_header,
171 std::istream & stream);
void store(std::ostream &stream) const
Stores the EquationSystems to the given stream.
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)
std::size_t _loaded_stream_data_begin
The starting position for the vector data in the input stream.
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 conta...
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
libMesh::EquationSystems _es
The underlying EquationSystems.
void to_json(nlohmann::json &json, const RestartableEquationSystems &res)
RestartableEquationSystems(libMesh::MeshBase &mesh)
void dataStore(std::ostream &stream, RestartableEquationSystems &res, void *)
const libMesh::EquationSystems & es() const
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.
void load(std::istream &stream)
Loads the EquationSystems from the given stream.
EquationSystemsHeader _loaded_header
The loaded header.
bool _load_all_vectors
Whether or not to load all of the vectors, including ones that haven't been added yet...
void setLoadAllVectors(const bool load_all_vectors)
Sets whether or not all vectors are to be loaded.
Wrapper class that owns a libMesh EquationSystem and adds advanced restart capability to it...
std::vector< const libMesh::DofObject * > _loaded_ordered_objects
The object ordering for this data.
std::vector< const libMesh::DofObject * > orderDofObjects() const
Internal method for ordering the DofObjects by ID (elems and the nodes)
libMesh::EquationSystems & es()
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].
void dataLoad(std::istream &stream, RestartableEquationSystems &res, void *)
EquationSystemsHeader buildHeader(const std::vector< const libMesh::DofObject *> &ordered_objects) const
Internal method for building the header struct.