#include <state_vector_multi.h>
Public Member Functions | |
StateVectorMulti (std::string name, std::unordered_map< int, std::vector< T >> data=std::unordered_map< int, std::vector< T >>()) | |
Constructor for StateVectorMulti. More... | |
~StateVectorMulti () | |
Destructor. More... | |
std::ostream & | print (std::ostream &os) const |
Virtual methods. More... | |
const std::type_info & | data_type () const |
std::unordered_map< int, std::vector< T > > & | get_data () |
Return a reference to the data in the state vector. More... | |
std::unordered_map< int, std::vector< T > > const & | get_data () const |
Return a const reference to the data in the state vector. More... | |
std::vector< T > & | get_data (int m) |
Return a reference to the data in the state vector. More... | |
std::vector< T > const & | get_data (int m) const |
Return a const reference to the data in the state vector. More... | |
Public Member Functions inherited from Wonton::StateVectorBase | |
StateVectorBase (std::string name, Field_type type, Entity_kind kind=Entity_kind::CELL) | |
Constructor with a name. More... | |
virtual | ~StateVectorBase ()=default |
Destructor. More... | |
std::string | get_name () const |
Query Metadata. More... | |
Field_type | get_type () const |
Return the field type [MESH_FIELD, MULTIMATERIAL_FIELD] of the state vector. More... | |
Entity_kind | get_kind () const |
Return the entity kind [CELL, NODE] of the state vector. More... | |
Additional Inherited Members | |
Protected Attributes inherited from Wonton::StateVectorBase | |
std::string | name_ |
Field_type | type_ |
Entity_kind | kind_ |
Detailed Description
template<class T = double>
class Wonton::StateVectorMulti< T >
This class implements a state vector for a multi material field, meaning there are as many numbers per cell as materials in the cell. The current implementation is material dominant, meaning there is a list of cells for each material. The shape of the data needs to be the same shape as the cell indices of materials. Multi material fields can only be defined on cells.
Constructor & Destructor Documentation
◆ StateVectorMulti()
|
inline |
Constructor for StateVectorMulti.
- Parameters
-
[in] data The map of data. The key of the map is the material id. The value is the data defined on the material cells
◆ ~StateVectorMulti()
|
inline |
Destructor.
Member Function Documentation
◆ data_type()
|
inlinevirtual |
Implements Wonton::StateVectorBase.
◆ get_data() [1/4]
|
inline |
Return a reference to the data in the state vector.
- Returns
- a reference to the vector of data in the state vector
Return a reference to the data in the state vector.
◆ get_data() [2/4]
|
inline |
Return a const reference to the data in the state vector.
- Returns
- a const reference to the vector of data in the state vector
Return a const reference to the data in the state vector.
◆ get_data() [3/4]
|
inline |
Return a reference to the data in the state vector.
- Parameters
-
[in] m material id
- Returns
- a reference to the vector of data in the state vector
Return a reference to the data in the state vector. Note: this function has a potential side effect (which is a good thing, but users need to be aware). If the vector for key m does not exist, it will be created automatically. If you want to throw an error, use get_data().at(m) instead.
◆ get_data() [4/4]
|
inline |
Return a const reference to the data in the state vector.
- Parameters
-
[in] m material id
- Returns
- a const reference to the vector of data in the state vector
Return a const reference to the data in the state vector. If you want to throw an error, use get_data().at(m) instead.
◆ print()
|
inlinevirtual |
Virtual methods.
Reimplemented from Wonton::StateVectorBase.
The documentation for this class was generated from the following file:
- /home/wonton/wonton/wonton/state/state_vector_multi.h