KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
|
Container for storing data values associated with variables. More...
#include <data_value_container.h>
Public Member Functions | |
Life Cycle | |
DataValueContainer () | |
Default constructor. More... | |
DataValueContainer (DataValueContainer const &rOther) | |
Copy constructor. More... | |
virtual | ~DataValueContainer () |
Destructor. More... | |
Operators | |
template<class TDataType > | |
const TDataType & | operator() (const VariableData &rThisVariable) const |
Accessor operator for retrieving a data value by a VariableData. More... | |
template<class TDataType > | |
TDataType & | operator() (const Variable< TDataType > &rThisVariable) |
Accessor operator for retrieving a data value by a Variable. More... | |
template<class TDataType > | |
const TDataType & | operator() (const Variable< TDataType > &rThisVariable) const |
Accessor operator for retrieving a data value by a Variable (const version). More... | |
template<class TDataType > | |
TDataType & | operator[] (const VariableData &rThisVariable) |
Index operator for retrieving a data value by a VariableData. More... | |
template<class TDataType > | |
const TDataType & | operator[] (const VariableData &rThisVariable) const |
Index operator for retrieving a data value by a VariableData (const version). More... | |
template<class TDataType > | |
TDataType & | operator[] (const Variable< TDataType > &rThisVariable) |
Index operator for retrieving a data value by a Variable. More... | |
template<class TDataType > | |
const TDataType & | operator[] (const Variable< TDataType > &rThisVariable) const |
Index operator for retrieving a data value by a Variable (const version). More... | |
iterator | begin () |
Iterator pointing to the beginning of the container. More... | |
const_iterator | begin () const |
Const iterator pointing to the beginning of the container. More... | |
iterator | end () |
Iterator pointing to the end of the container. More... | |
const_iterator | end () const |
Const iterator pointing to the end of the container. More... | |
DataValueContainer & | operator= (const DataValueContainer &rOther) |
Assignment operator for copying data from another DataValueContainer. More... | |
Operations | |
template<class TDataType > | |
TDataType & | GetValue (const Variable< TDataType > &rThisVariable) |
Gets the value associated with a given variable. More... | |
template<class TDataType > | |
const TDataType & | GetValue (const Variable< TDataType > &rThisVariable) const |
Gets the value associated with a given variable (const version). More... | |
SizeType | Size () |
Gets the size of the data container. More... | |
template<class TDataType > | |
void | SetValue (const Variable< TDataType > &rThisVariable, TDataType const &rValue) |
Sets the value for a given variable. More... | |
template<class TDataType > | |
void | Erase (const Variable< TDataType > &rThisVariable) |
Erases the value associated with a given variable. More... | |
void | Clear () |
Clears the entire data container. More... | |
void | Merge (const DataValueContainer &rOther, const Flags Options) |
Merges this data container with another data container. More... | |
Inquiry | |
template<class TDataType > | |
bool | Has (const Variable< TDataType > &rThisVariable) const |
Checks if the data container has a value associated with a given variable. More... | |
bool | IsEmpty () const |
Checks if the data container is empty. More... | |
Input and output | |
virtual std::string | Info () const |
Retrieves a string representation of the data value container. More... | |
virtual void | PrintInfo (std::ostream &rOStream) const |
Outputs a brief description of the data value container to a given stream. More... | |
virtual void | PrintData (std::ostream &rOStream) const |
Outputs the detailed data contents of the data value container to a given stream. More... | |
Type Definitions | |
using | ValueType = std::pair< const VariableData *, void * > |
Type of the container used for variables. More... | |
using | ContainerType = std::vector< ValueType > |
Type of the container used for variables. More... | |
using | iterator = ContainerType::iterator |
Type of the container used for variables. More... | |
using | const_iterator = ContainerType::const_iterator |
Type of the container used for variables. More... | |
using | SizeType = ContainerType::size_type |
Type of the container used for variables. More... | |
KRATOS_DEFINE_LOCAL_FLAG (OVERWRITE_OLD_VALUES) | |
Define local flag. More... | |
KRATOS_CLASS_POINTER_DEFINITION (DataValueContainer) | |
Pointer definition of DataValueContainer. More... | |
Serialization | |
class | Serializer |
Container for storing data values associated with variables.
This class provides a container for storing data values associated with variables.
using Kratos::DataValueContainer::const_iterator = ContainerType::const_iterator |
Type of the container used for variables.
using Kratos::DataValueContainer::ContainerType = std::vector<ValueType> |
Type of the container used for variables.
using Kratos::DataValueContainer::iterator = ContainerType::iterator |
Type of the container used for variables.
using Kratos::DataValueContainer::SizeType = ContainerType::size_type |
Type of the container used for variables.
using Kratos::DataValueContainer::ValueType = std::pair<const VariableData*, void*> |
Type of the container used for variables.
|
inline |
Default constructor.
|
inline |
Copy constructor.
|
inlinevirtual |
Destructor.
|
inline |
Iterator pointing to the beginning of the container.
|
inline |
Const iterator pointing to the beginning of the container.
|
inline |
Clears the entire data container.
|
inline |
Iterator pointing to the end of the container.
|
inline |
Const iterator pointing to the end of the container.
|
inline |
Erases the value associated with a given variable.
TDataType | The data type of the variable. |
rThisVariable | The variable whose associated value is to be erased. |
|
inline |
Gets the value associated with a given variable.
TDataType | The data type of the variable. |
rThisVariable | The variable for which the value is to be retrieved. |
|
inline |
Gets the value associated with a given variable (const version).
TDataType | The data type of the variable. |
rThisVariable | The variable for which the value is to be retrieved. |
|
inline |
Checks if the data container has a value associated with a given variable.
TDataType | The data type of the variable. |
rThisVariable | The variable for which the check is to be made. |
|
inlinevirtual |
Retrieves a string representation of the data value container.
Reimplemented in Kratos::ProcessInfo, Kratos::ModelPart, Kratos::Mesh< TNodeType, TPropertiesType, TElementType, TConditionType >, and Kratos::Mesh< NodeType, PropertiesType, ElementType, ConditionType >.
|
inline |
Checks if the data container is empty.
Kratos::DataValueContainer::KRATOS_CLASS_POINTER_DEFINITION | ( | DataValueContainer | ) |
Pointer definition of DataValueContainer.
Kratos::DataValueContainer::KRATOS_DEFINE_LOCAL_FLAG | ( | OVERWRITE_OLD_VALUES | ) |
Define local flag.
void Kratos::DataValueContainer::Merge | ( | const DataValueContainer & | rOther, |
const Flags | Options | ||
) |
Merges this data container with another data container.
rOther | The other data container to be merged. |
Options | Flags for the merging options. |
|
inline |
Accessor operator for retrieving a data value by a Variable.
This operator allows you to retrieve a data value by providing a Variable object.
TDataType | The data type of the value to retrieve. |
rThisVariable | The Variable object specifying the variable. |
|
inline |
Accessor operator for retrieving a data value by a Variable (const version).
This operator allows you to retrieve a data value by providing a Variable object.
TDataType | The data type of the value to retrieve. |
rThisVariable | The Variable object specifying the variable. |
|
inline |
Accessor operator for retrieving a data value by a VariableData.
This operator allows you to retrieve a data value by providing a VariableData object.
TDataType | The data type of the value to retrieve. |
rThisVariable | The VariableData object specifying the variable. |
|
inline |
Assignment operator for copying data from another DataValueContainer.
This operator allows you to assign the contents of another DataValueContainer to this container.
rOther | The DataValueContainer to copy data from. |
|
inline |
Index operator for retrieving a data value by a Variable.
This operator allows you to retrieve a data value by providing a Variable object.
TDataType | The data type of the value to retrieve. |
rThisVariable | The Variable object specifying the variable. |
|
inline |
Index operator for retrieving a data value by a Variable (const version).
This operator allows you to retrieve a data value by providing a Variable object.
TDataType | The data type of the value to retrieve. |
rThisVariable | The Variable object specifying the variable. |
|
inline |
Index operator for retrieving a data value by a VariableData.
This operator allows you to retrieve a data value by providing a VariableData object.
TDataType | The data type of the value to retrieve. |
rThisVariable | The VariableData object specifying the variable. |
|
inline |
Index operator for retrieving a data value by a VariableData (const version).
This operator allows you to retrieve a data value by providing a VariableData object.
TDataType | The data type of the value to retrieve. |
rThisVariable | The VariableData object specifying the variable. |
|
inlinevirtual |
Outputs the detailed data contents of the data value container to a given stream.
For each data entry, it prints the variable type and its associated value.
rOStream | The output stream to which the data should be printed. |
Reimplemented in Kratos::ProcessInfo, Kratos::ModelPart, Kratos::Mesh< TNodeType, TPropertiesType, TElementType, TConditionType >, and Kratos::Mesh< NodeType, PropertiesType, ElementType, ConditionType >.
|
inlinevirtual |
Outputs a brief description of the data value container to a given stream.
rOStream | The output stream to which the information should be printed. |
Reimplemented in Kratos::ProcessInfo, Kratos::ModelPart, Kratos::Mesh< TNodeType, TPropertiesType, TElementType, TConditionType >, and Kratos::Mesh< NodeType, PropertiesType, ElementType, ConditionType >.
|
inline |
Sets the value for a given variable.
TDataType | The data type of the variable. |
rThisVariable | The variable for which the value is to be set. |
rValue | The value to be set for the variable. |
|
inline |
Gets the size of the data container.
|
friend |