state_manager.h
Go to the documentation of this file.
std::string material_name(int m) const
Return the name of a material from its material id.
Definition: state_manager.h:95
Definition: wonton.h:84
std::unordered_map< int, std::unordered_set< int > > const & get_cell_materials() const
Return the cell materials.
Definition: state_manager.h:160
std::unordered_set< int > get_cell_materials(int c) const
Return the unordered set of materials in this cell.
Definition: state_manager.h:628
void add(std::shared_ptr< StateVectorUni< T >> sv)
Add a StateVectorUni<T> to the state manager.
Definition: state_manager.h:296
void cell_get_mats(int c, std::vector< int > *cellmats) const
Return the materials in this cell.
Definition: state_manager.h:651
std::unordered_map< int, std::vector< int > > const & get_material_cells() const
Return the material cells.
Definition: state_manager.h:149
Factorize a number N into D equal (or nearly equal) factors.
Definition: adaptive_refinement_mesh.h:31
Definition: state_vector_multi.h:28
int cell_index_in_material(int c, int m) const
Return the cell index in this material id.
Definition: state_manager.h:534
int cell_get_num_mats(int c) const
Return the number of materials in this cell.
Definition: state_manager.h:609
int get_data_size(Entity_kind on_what, std::string const &name) const
Return the data size .
Definition: state_manager.h:235
std::unordered_map< int, std::unordered_map< int, int > > cell_index_in_mat_
Definition: state_manager.h:858
void mat_add_celldata(std::string const &name, int m, T const *values)
Add cell data for a new material in a state vector to the state manager.
Definition: state_manager.h:751
void mat_add_cells(int m, std::vector< int > const &newcells)
Add cells for a new material to the material cells.
Definition: state_manager.h:723
void add_material_names(const std::unordered_map< std::string, int > &names)
Add the names of the materials.
Definition: state_manager.h:61
void add_material_cells(std::unordered_map< int, std::vector< int >> cells)
Add the material cells.
Definition: state_manager.h:116
void mesh_get_data(Entity_kind on_what, std::string const &name, T **data)
Return the cell data for this material id.
Definition: state_manager.h:701
const std::type_info & get_data_type(std::string var_name)
Get the data type of the given field.
Definition: state_manager.h:245
std::unordered_map< std::string, std::shared_ptr< StateVectorBase > > state_vectors_
Definition: state_manager.h:846
int num_material_cells(int m) const
Return the number of cells for this material id.
Definition: state_manager.h:470
Field_type
Field type - whether it is mesh field or multi-material field.
Definition: wonton.h:187
void add_material(std::string const &matname, std::vector< int > const &matcells)
Add cell data for a new material in a state vector to the state manager.
Definition: state_manager.h:780
std::vector< int > const & get_material_cells(int m) const
Return the cell ids for this material id.
Definition: state_manager.h:481
void mat_get_celldata(std::string const &name, int m, T **data)
Return the cell data for this material id.
Definition: state_manager.h:573
std::unordered_map< int, std::vector< int > > material_cells_
Definition: state_manager.h:855
Definition: state_manager.h:29
void add(std::shared_ptr< StateVectorMulti< T >> sv)
Add a StateVectorMulti<T> to the state manager.
Definition: state_manager.h:327
Entity_kind get_entity(std::string const &name) const
Return the entity kind for a state vector.
Definition: state_manager.h:205
std::unordered_map< int, int > const get_material_shape() const
Return the number of cells for each material.
Definition: state_manager.h:171
int get_material_id(std::string const &name) const
Return the material id from its name.
Definition: state_manager.h:105
StateManager(const MeshWrapper &mesh, std::unordered_map< std::string, int > names={}, std::unordered_map< int, std::vector< int >> material_cells={})
Constructor.
Definition: state_manager.h:41
std::unordered_map< std::string, int > material_ids_
Definition: state_manager.h:849
std::vector< std::string > const names() const
Return the names registered by the state manager.
Definition: state_manager.h:79
void add(std::shared_ptr< StateVectorBase > sv)
Add a StateVectorBase to the state manager.
Definition: state_manager.h:271
Definition: state_vector_uni.h:27
int num_materials() const
Return the number of materials in the problem.
Definition: state_manager.h:188
Field_type field_type(Entity_kind kind, std::string const &name) const
Return the field type of a state vector.
Definition: state_manager.h:227
bool shape_is_good(const std::shared_ptr< StateVectorMulti< T >> sv)
Check that a StateVectorMulti<T> has a shape consistent with the state manager.
Definition: state_manager.h:803
std::unordered_map< int, std::unordered_set< int > > cell_materials_
Definition: state_manager.h:861
void mat_get_cells(int m, std::vector< int > *matcells) const
Return the cell ids for this material id.
Definition: state_manager.h:495
std::unordered_map< int, std::string > material_names_
Definition: state_manager.h:852
void mat_get_celldata(std::string const &name, int m, T const **data) const
Return the cell data for this material id.
Definition: state_manager.h:515
void mesh_get_data(Entity_kind on_what, std::string const &name, T const **data) const
Return the const cell data for this material id.
Definition: state_manager.h:682
void clear_material_cells()
Clear material cells and the inverse map of cell materials.
Definition: state_manager.h:834