OGS
|
Class template PropertyVector is a std::vector with template parameter T, where T is a pointer type. The behaviour has changed for the constructor, destructor and the operator[]. The user has to provide the size and an item to group mapping for construction. The destructor takes care to delete the entries of the vector. The operator[] uses an item-to-group property map to access the correct property.
T | pointer type, the type the type points to is typical a scalar, a vector or a matrix type |
Definition at line 139 of file PropertyVector.h.
#include <PropertyVector.h>
Public Member Functions | |
~PropertyVector () override | |
Destructor ensures the deletion of the heap-constructed objects. More... | |
T *const & | operator[] (std::size_t id) const |
T *& | operator[] (std::size_t id) |
void | initPropertyValue (std::size_t group_id, T const &value) |
void | initPropertyValue (std::size_t group_id, std::vector< T > const &values) |
std::size_t | getNumberOfTuples () const |
std::size_t | size () const |
PropertyVectorBase * | clone (std::vector< std::size_t > const &exclude_positions) const override |
T const & | getComponent (std::size_t tuple_index, int component) const |
Returns the value for the given component stored in the given tuple. More... | |
std::ostream & | print (std::ostream &os) const |
Public Member Functions inherited from MeshLib::PropertyVectorBase | |
virtual | ~PropertyVectorBase ()=default |
MeshItemType | getMeshItemType () const |
std::string const & | getPropertyName () const |
int | getNumberOfGlobalComponents () const |
Protected Member Functions | |
PropertyVector (std::size_t n_prop_groups, std::vector< std::size_t > item2group_mapping, std::string const &property_name, MeshItemType mesh_item_type, std::size_t n_components) | |
The constructor taking meta information for the data. More... | |
Protected Member Functions inherited from MeshLib::PropertyVectorBase | |
PropertyVectorBase (std::string property_name, MeshItemType mesh_item_type, std::size_t n_components) | |
Private Member Functions | |
T * | at (std::size_t) |
Private Attributes | |
std::vector< T * > | _values |
Friends | |
class | Properties |
Additional Inherited Members | |
Protected Attributes inherited from MeshLib::PropertyVectorBase | |
int const | _n_components |
MeshItemType const | _mesh_item_type |
std::string const | _property_name |
|
inlineoverride |
Destructor ensures the deletion of the heap-constructed objects.
Definition at line 146 of file PropertyVector.h.
|
inlineprotected |
The constructor taking meta information for the data.
n_prop_groups | number of different property values |
item2group_mapping | Class Mesh has a mapping from the mesh items (Node or Element) to an index (position in the data structure). The vector item2group_mapping must have the same number of entries as the above mapping and the values have to be in the range \([0, \text{n\_prop\_groups})\). |
property_name | a string describing the property |
mesh_item_type | the values of the property are either assigned to nodes or cells (see enumeration MeshItemType) |
n_components | the number of elements of a tuple |
Definition at line 270 of file PropertyVector.h.
|
private |
|
inlineoverridevirtual |
Implements MeshLib::PropertyVectorBase.
Definition at line 208 of file PropertyVector.h.
References BaseLib::excludeObjectCopy(), and initPropertyValue().
|
inline |
Returns the value for the given component stored in the given tuple.
Definition at line 226 of file PropertyVector.h.
References OGS_FATAL, and MathLib::p.
|
inline |
Definition at line 196 of file PropertyVector.h.
|
inline |
|
inline |
Definition at line 166 of file PropertyVector.h.
References OGS_FATAL, and MathLib::p.
Referenced by clone().
|
inline |
Definition at line 161 of file PropertyVector.h.
|
inline |
The operator[] uses the item to group property map to access to the correct property value/object.
Definition at line 156 of file PropertyVector.h.
|
inline |
|
inline |
Method returns the number of tuples times the number of tuple components.
Definition at line 203 of file PropertyVector.h.
|
friend |
Definition at line 142 of file PropertyVector.h.
|
private |
Definition at line 283 of file PropertyVector.h.