Provides access to data stored in Flecsi_State. More...
#include <flecsi_state_wrapper.h>
Public Member Functions | |
flecsi_state_t (mesh_t &mesh) | |
Default constructor. More... | |
flecsi_state_t ()=default | |
Default constructor deleted. More... | |
flecsi_state_t (const flecsi_state_t &)=default | |
Default copy constructor. More... | |
flecsi_state_t & | operator= (const flecsi_state_t &)=default |
Default assignment operator. More... | |
int | num_materials () const |
Number of materials in problem. More... | |
std::string | material_name (int matid) const |
Name of material. More... | |
int | mat_get_num_cells (int matid) const |
Get number of cells containing a particular material. More... | |
void | mat_get_cells (int matid, std::vector< int > *matcells) const |
Get cell indices containing a particular material. More... | |
int | cell_get_num_mats (int cellid) const |
Get number of materials contained in a cell. More... | |
void | cell_get_mats (int cellid, std::vector< int > *cellmats) const |
Get the IDs of materials in a cell. More... | |
int | cell_index_in_material (int meshcell, int matid) const |
Get the local index of mesh cell in material cell list. More... | |
Field_type | field_type (Entity_kind on_what, std::string const &var_name) const |
Type of field (MESH_FIELD or MULTIMATERIAL_FIELD) More... | |
entity_kind_t | get_entity (std::string const &var_name) const |
Get the entity type on which the given field is defined. More... | |
template<class T > | |
void | mesh_get_data (entity_kind_t on_what, std::string const &var_name, T **data) const |
Get pointer to scalar data. More... | |
template<typename T > | |
void | mat_get_celldata (std::string const &var_name, int matid, T const **data) const |
Get pointer to read-only scalar cell data for a particular material. More... | |
template<typename T > | |
void | mat_get_celldata (std::string const &var_name, int matid, T **data) |
Get pointer to read-write scalar data for a particular material. More... | |
void | mesh_add_data (Entity_kind on_what, std::string const &name, double const **data) const |
Get a pointer to data from the state manager with a given variable name and on on_what mesh entities. More... | |
void | mat_add_celldata (std::string const &var_name, double value) |
Add a scalar multi-valued data field on cells and initialize its material data to a single value. More... | |
void | mat_add_celldata (std::string const &var_name, double const *const *values=nullptr, Data_layout layout=Data_layout::MATERIAL_CENTRIC) |
Add a scalar multi-valued data field on cells and initialize its material data according to a 2D array. More... | |
void | mat_add_celldata (std::string const &var_name, int matid, double const *values) |
Add a scalar multi-valued data field on cells and add data to one of its materials. More... | |
void | mat_add_celldata (std::string const &var_name, int matid, Point< 2 > const *values) |
void | mat_add_celldata (std::string const &var_name, int matid, Point< 3 > const *values) |
void | mat_add_celldata (std::string const &var_name, int matid, double value) |
Add a scalar multi-valued data field on cells and initialize one of its material data to a uniform value. More... | |
void | mat_add_cells (int matid, std::vector< int > const &newcells) |
Add cells to material (or add material to cells) More... | |
void | mat_rem_cells (int matid, std::vector< int > const &delcells) |
Remove cells from material (or remove material from cells) More... | |
void | add_material (std::string const &matname, std::vector< int > const &matcells) |
Add a material to state. More... | |
int | get_data_size (entity_kind_t on_what, std::string const &var_name) const |
const std::type_info & | get_data_type (std::string const &var_name) const |
Get the data type of the given field. More... | |
std::vector< std::string > | names () const |
Vector of names. More... | |
Detailed Description
template<typename M>
class Wonton::flecsi_state_t< M >
Provides access to data stored in Flecsi_State.
Constructor & Destructor Documentation
◆ flecsi_state_t() [1/3]
|
inlineexplicit |
Default constructor.
- Parameters
-
[in] mesh The minimum coordinates of the domain.
◆ flecsi_state_t() [2/3]
|
default |
Default constructor deleted.
◆ flecsi_state_t() [3/3]
|
default |
Default copy constructor.
Member Function Documentation
◆ add_material()
|
inline |
Add a material to state.
- Parameters
-
[in] matname Name of material [in] matcells Cells containing the material
◆ cell_get_mats()
|
inline |
Get the IDs of materials in a cell.
- Parameters
-
cellid Index of cell in mesh cellmats Indices of materials in cell
◆ cell_get_num_mats()
|
inline |
Get number of materials contained in a cell.
- Parameters
-
cellid Index of cell in mesh
- Returns
- Number of materials in cell
◆ cell_index_in_material()
|
inline |
Get the local index of mesh cell in material cell list.
- Parameters
-
meshcell Mesh cell ID matid Material ID
- Returns
- Local cell index in material cell list
◆ field_type()
|
inline |
Type of field (MESH_FIELD or MULTIMATERIAL_FIELD)
- Parameters
-
[in] onwhat Entity_kind that field is defined on [in] varname Name of field
- Returns
- Field_type
◆ get_data_size()
|
inline |
◆ get_data_type()
|
inline |
Get the data type of the given field.
- Parameters
-
[in] var_name The string name of the data field
- Returns
- A reference to the type_info struct for the field's data type
◆ get_entity()
|
inline |
Get the entity type on which the given field is defined.
- Parameters
-
[in] var_name The string name of the data field
- Returns
- The Entity_kind enum for the entity type on which the field is defined
- Todo:
THIS ASSUMES ONLY DOUBLE VECTORS - WE HAVE TO ACCOUNT FOR OTHER TYPES OR WE HAVE TO GENERALIZE THE FIND FUNCTION!!!
THIS ALSO DOES NOT CHECK FOR OTHER ENTITY TYPES LIKE EDGE, FACE, SIDE, WEDGE AND CORNER
◆ mat_add_celldata() [1/6]
|
inline |
Add a scalar multi-valued data field on cells and initialize its material data to a single value.
- Parameters
-
[in] var_name The name of the data field [in] value Initialize with this value The 2D array will be read and values copied according to which materials are contained in which cells. If a material+cell combination is not active providing a value for the array will have no effect.
◆ mat_add_celldata() [2/6]
|
inline |
Add a scalar multi-valued data field on cells and initialize its material data according to a 2D array.
- Parameters
-
[in] var_name The name of the data field [in] layout Whether 2D array is laid out with first index being the cell (CELL_CENRIC) or material (MATERIAL CENTRIC) [in] value Initialize with this value
The 2D array will be read and values copied according to which materials are contained in which cells. If a material+cell combination is not active providing a value for the array will have no effect.
◆ mat_add_celldata() [3/6]
|
inline |
Add a scalar multi-valued data field on cells and add data to one of its materials.
- Parameters
-
[in] var_name The name of the data field [in] matid Index of material in the problem [in] layout Data layout - [in] values Initialize with this array of values
Subsequent calls to this function with the same name will find the added field and just add the data.
◆ mat_add_celldata() [4/6]
|
inline |
◆ mat_add_celldata() [5/6]
|
inline |
◆ mat_add_celldata() [6/6]
|
inline |
Add a scalar multi-valued data field on cells and initialize one of its material data to a uniform value.
- Parameters
-
[in] var_name The name of the data field [in] matid Index of material in the problem [in] value Initialize with this value Subsequent calls to this function with the same name will find the added field and just add the data.
◆ mat_add_cells()
|
inline |
Add cells to material (or add material to cells)
- Parameters
-
[in] matid Material ID [in] newcells Vector of new cells in material
◆ mat_get_celldata() [1/2]
|
inline |
Get pointer to read-only scalar cell data for a particular material.
- Parameters
-
[in] var_name The string name of the data field [in] matid Index (not unique identifier) of the material [out] data vector containing the values corresponding to cells in the material
◆ mat_get_celldata() [2/2]
|
inline |
Get pointer to read-write scalar data for a particular material.
- Parameters
-
[in] on_what The entity type on which to get the data [in] var_name The string name of the data field [in] matid Index (not unique identifier) of the material [out] data vector containing the values corresponding to cells in the material
◆ mat_get_cells()
|
inline |
Get cell indices containing a particular material.
- Parameters
-
matid Index of material (0, num_materials()-1) matcells Cells containing material 'matid'
◆ mat_get_num_cells()
|
inline |
Get number of cells containing a particular material.
- Parameters
-
matid Index of material (0, num_materials()-1)
- Returns
- Number of cells containing material 'matid'
◆ mat_rem_cells()
|
inline |
Remove cells from material (or remove material from cells)
- Parameters
-
[in] matid Material ID [in] matcells Vector of to be removed cells
◆ material_name()
|
inline |
Name of material.
◆ mesh_add_data()
|
inline |
Get a pointer to data from the state manager with a given variable name
and on on_what
mesh entities.
- Parameters
-
[in] on_what The Entity_kind (e.g. CELL) on which the data lives. [in] name The name of the variable. data A pointer
to the const data array. If the requested data is not found in the state manager, anullptr
is returned.
◆ mesh_get_data()
|
inline |
Get pointer to scalar data.
- Parameters
-
[in] on_what The entity type on which to get the data [in] var_name The string name of the data field [in,out] data A pointer to an array of data
◆ names()
|
inline |
Vector of names.
- Returns
- vector of strings
◆ num_materials()
|
inline |
Number of materials in problem.
◆ operator=()
|
default |
Default assignment operator.
The documentation for this class was generated from the following file:
- /home/wonton/wonton/wonton/state/flecsi/flecsi_state_wrapper.h