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.
List of all members
Kratos::Properties Class Reference

Properties encapsulates data shared by different Elements or Conditions. It can store any type of data and provides a variable base access to them. More...

#include <properties.h>

Inheritance diagram for Kratos::Properties:
Collaboration diagram for Kratos::Properties:

Public Member Functions

Life Cycle
 Properties (IndexType NewId=0)
 Default constructor. More...
 
 Properties (IndexType NewId, const SubPropertiesContainerType &SubPropertiesList)
 Default of properties with subproperties. More...
 
 Properties (const Properties &rOther)
 Copy constructor. More...
 
 ~Properties () override
 Destructor. More...
 
Operators
Propertiesoperator= (const Properties &rOther)
 Assignment operator. More...
 
template<class TVariableType >
TVariableType::Type & operator() (const TVariableType &rV)
 
template<class TVariableType >
TVariableType::Type const & operator() (const TVariableType &rV) const
 
template<class TVariableType >
TVariableType::Type & operator[] (const TVariableType &rV)
 
template<class TVariableType >
TVariableType::Type const & operator[] (const TVariableType &rV) const
 
template<class TVariableType >
TVariableType::Type & operator() (const TVariableType &rV, Node &rThisNode)
 
template<class TVariableType >
TVariableType::Type const & operator() (const TVariableType &rV, Node const &rThisNode) const
 
template<class TVariableType >
TVariableType::Type & operator() (const TVariableType &rV, Node &rThisNode, IndexType SolutionStepIndex)
 
template<class TVariableType >
TVariableType::Type const & operator() (const TVariableType &rV, Node const &rThisNode, IndexType SolutionStepIndex) const
 
template<class TVariableType >
TVariableType::Type & operator() (const TVariableType &rV, Node &rThisNode, ProcessInfo const &rCurrentProcessInfo)
 
template<class TVariableType >
TVariableType::Type const & operator() (const TVariableType &rV, Node const &rThisNode, ProcessInfo const &rCurrentProcessInfo) const
 
Operations
template<class TVariableType >
void Erase (const TVariableType &rV)
 
template<class TVariableType >
TVariableType::Type & GetValue (const TVariableType &rVariable)
 
template<class TVariableType >
TVariableType::Type const & GetValue (const TVariableType &rVariable) const
 
template<class TVariableType >
TVariableType::Type & GetValue (const TVariableType &rVariable, Node &rThisNode)
 
template<class TVariableType >
TVariableType::Type const & GetValue (const TVariableType &rVariable, Node const &rThisNode) const
 
template<class TVariableType >
TVariableType::Type & GetValue (const TVariableType &rVariable, Node &rThisNode, IndexType SolutionStepIndex)
 
template<class TVariableType >
TVariableType::Type const & GetValue (const TVariableType &rVariable, Node const &rThisNode, IndexType SolutionStepIndex) const
 
template<class TVariableType >
TVariableType::Type GetValue (const TVariableType &rVariable, const GeometryType &rGeometry, const Vector &rShapeFunctionVector, const ProcessInfo &rProcessInfo) const
 
template<class TVariableType >
void SetValue (TVariableType const &rV, typename TVariableType::Type const &rValue)
 
bool HasVariables () const
 
template<class TVariableType >
void SetAccessor (const TVariableType &rVariable, AccessorPointerType pAccessor)
 Set the Accessor object This method sets a variable-accessor pair in current properties accessor container. More...
 
template<class TVariableType >
AccessorGetAccessor (const TVariableType &rVariable)
 Get the Accessor object If exists, this method returns a pointer to the requested variable accessor If doesn't exist, the method throws an error. More...
 
template<class TVariableType >
AccessorGetAccessor (const TVariableType &rVariable) const
 Get the Accessor object If exists, this method returns a pointer to the requested variable accessor If doesn't exist, the method throws an error. More...
 
template<class TVariableType >
AccessorPointerTypepGetAccessor (const TVariableType &rVariable)
 Get the Accessor object If exists, this method returns a pointer to the requested variable accessor If doesn't exist, the method throws an error. More...
 
template<class TVariableType >
bool HasAccessor (const TVariableType &rVariable) const
 Check if current properties have an accessor This method checks if current properties have an accessor for the requested variable. More...
 
template<class TXVariableType , class TYVariableType >
TableTypeGetTable (const TXVariableType &XVariable, const TYVariableType &YVariable)
 
template<class TXVariableType , class TYVariableType >
TableType const & GetTable (const TXVariableType &XVariable, const TYVariableType &YVariable) const
 
template<class TXVariableType , class TYVariableType >
void SetTable (const TXVariableType &XVariable, const TYVariableType &YVariable, TableType const &rThisTable)
 
bool HasTables () const
 
bool IsEmpty () const
 
int64_t Key (std::size_t XKey, std::size_t YKey) const
 
std::size_t NumberOfSubproperties () const
 This method returns the number of subproperties. More...
 
void AddSubProperties (Properties::Pointer pNewSubProperty)
 This method insert a new property into the list of subproperties. More...
 
bool HasSubProperties (const IndexType SubPropertyIndex) const
 This method checks if the subproperty exists from the index corresponding to the property id. More...
 
Properties::Pointer pGetSubProperties (const IndexType SubPropertyIndex)
 This method gets the subproperty from the index corresponding to the property id. More...
 
const Properties::Pointer pGetSubProperties (const IndexType SubPropertyIndex) const
 This method gets the subproperty from the index corresponding to the property id (constant version) More...
 
PropertiesGetSubProperties (const IndexType SubPropertyIndex)
 This method gets the subproperty from the index corresponding to the property id. More...
 
const PropertiesGetSubProperties (const IndexType SubPropertyIndex) const
 This method gets the subproperty from the index corresponding to the property id (constant version) More...
 
SubPropertiesContainerTypeGetSubProperties ()
 This method returns the whole list of subproperties. More...
 
SubPropertiesContainerType const & GetSubProperties () const
 This method returns the whole list of subproperties. More...
 
void SetSubProperties (SubPropertiesContainerType &rSubPropertiesList)
 This method set the whole list of subproperties. More...
 
Access
ContainerTypeData ()
 This method returns the whole data container. More...
 
ContainerType const & Data () const
 This method returns the whole data container (constant) More...
 
TablesContainerTypeTables ()
 This method returns the tables. More...
 
TablesContainerType const & Tables () const
 This method returns the tables (constant) More...
 
Inquiry
template<class TVariableType >
bool Has (TVariableType const &rThisVariable) const
 
template<class TXVariableType , class TYVariableType >
bool HasTable (const TXVariableType &XVariable, const TYVariableType &YVariable) const
 
Input and output
std::string Info () const override
 Turn back information as a string. More...
 
void PrintInfo (std::ostream &rOStream) const override
 Print information about this object. More...
 
void PrintData (std::ostream &rOStream) const override
 Print object's data. More...
 
- Public Member Functions inherited from Kratos::IndexedObject
 IndexedObject (IndexType NewId=0)
 Default constructor. More...
 
virtual ~IndexedObject ()
 Destructor. More...
 
 IndexedObject (IndexedObject const &rOther)
 Copy constructor. More...
 
IndexedObjectoperator= (IndexedObject const &rOther)
 Assignment operator. More...
 
template<class TObjectType >
IndexType operator() (TObjectType const &rThisObject) const
 
IndexType Id () const
 
IndexType GetId () const
 
virtual void SetId (IndexType NewId)
 
IndexTypeDepricatedIdAccess ()
 TODO: remove this function when removing data_file_io object. More...
 
 KRATOS_CLASS_POINTER_DEFINITION (IndexedObject)
 Pointer definition of IndexedObject. More...
 

Type Definitions

using BaseType = IndexedObject
 
using ContainerType = DataValueContainer
 
using GeometryType = Geometry< Node >
 
using IndexType = std::size_t
 
using TableType = Table< double >
 
using KeyType = IndexType
 
using AccessorPointerType = Accessor::UniquePointer
 
using AccessorsContainerType = std::unordered_map< KeyType, AccessorPointerType >
 
using TablesContainerType = std::unordered_map< std::size_t, TableType >
 
using SubPropertiesContainerType = PointerVectorSet< Properties, IndexedObject >
 Properties container. A vector set of properties with their Id's as key. More...
 
 KRATOS_CLASS_POINTER_DEFINITION (Properties)
 Pointer definition of Properties. More...
 

Serialization

class Serializer
 

Additional Inherited Members

- Public Types inherited from Kratos::IndexedObject
typedef std::size_t IndexType
 The definition of the index type. More...
 
typedef std::size_t result_type
 The definition of the result_type. More...
 

Detailed Description

Properties encapsulates data shared by different Elements or Conditions. It can store any type of data and provides a variable base access to them.

These are all parameters that can be shared between Element. Usually material parameters are common for a set of element, so this category of data is referred as properties. But in general it can be any common parameter for a group of Elements. Sharing these data as properties reduces the memory used by the application and also helps updating them if necessary. As mentioned before Properties is a shared data container between Elements or Conditions. In finite element problems there are several parameters which are the same for a set of elements and conditions. Thermal conductivity, elasticity of the material and viscosity of the fluid are examples of these parameters. Properties holds these data and is shared by elements or Conditions. This eliminates memory overhead due to redundant copies of these data for each element and Condition. Properties also can be used to access nodal data if it is necessary. It is important to mention that accessing the nodal data via Properties is not the same as accessing it via Node. When user asks Properties for a variable data in a Node, the process starts with finding the variable in the Properties data container and if it does not exist then get it from Node. This means that the priority of data is with the one stored in Properties and then in Node.

Author
Pooyan Dadvand

Member Typedef Documentation

◆ AccessorPointerType

using Kratos::Properties::AccessorPointerType = Accessor::UniquePointer

◆ AccessorsContainerType

◆ BaseType

◆ ContainerType

◆ GeometryType

◆ IndexType

using Kratos::Properties::IndexType = std::size_t

◆ KeyType

◆ SubPropertiesContainerType

Properties container. A vector set of properties with their Id's as key.

◆ TablesContainerType

using Kratos::Properties::TablesContainerType = std::unordered_map<std::size_t, TableType>

◆ TableType

Constructor & Destructor Documentation

◆ Properties() [1/3]

Kratos::Properties::Properties ( IndexType  NewId = 0)
inlineexplicit

Default constructor.

◆ Properties() [2/3]

Kratos::Properties::Properties ( IndexType  NewId,
const SubPropertiesContainerType SubPropertiesList 
)
inlineexplicit

Default of properties with subproperties.

◆ Properties() [3/3]

Kratos::Properties::Properties ( const Properties rOther)
inline

Copy constructor.

◆ ~Properties()

Kratos::Properties::~Properties ( )
inlineoverride

Destructor.

Member Function Documentation

◆ AddSubProperties()

void Kratos::Properties::AddSubProperties ( Properties::Pointer  pNewSubProperty)
inline

This method insert a new property into the list of subproperties.

Parameters
pNewSubPropertyThe new property to be added

◆ Data() [1/2]

ContainerType& Kratos::Properties::Data ( )
inline

This method returns the whole data container.

Returns
Data container

◆ Data() [2/2]

ContainerType const& Kratos::Properties::Data ( ) const
inline

This method returns the whole data container (constant)

Returns
Data container

◆ Erase()

template<class TVariableType >
void Kratos::Properties::Erase ( const TVariableType &  rV)
inline

◆ GetAccessor() [1/2]

template<class TVariableType >
Accessor& Kratos::Properties::GetAccessor ( const TVariableType &  rVariable)
inline

Get the Accessor object If exists, this method returns a pointer to the requested variable accessor If doesn't exist, the method throws an error.

Template Parameters
TVariableTypeThe variable type
Parameters
rVariableVariable to which the accessor refers to
Returns
AccessorPointerType& Pointer to the requested variable accessor

◆ GetAccessor() [2/2]

template<class TVariableType >
Accessor& Kratos::Properties::GetAccessor ( const TVariableType &  rVariable) const
inline

Get the Accessor object If exists, this method returns a pointer to the requested variable accessor If doesn't exist, the method throws an error.

Template Parameters
TVariableTypeThe variable type
Parameters
rVariableVariable to which the accessor refers to
Returns
AccessorPointerType& Pointer to the requested variable accessor

◆ GetSubProperties() [1/4]

SubPropertiesContainerType& Kratos::Properties::GetSubProperties ( )
inline

This method returns the whole list of subproperties.

Returns
The whole lis of subproperties

◆ GetSubProperties() [2/4]

SubPropertiesContainerType const& Kratos::Properties::GetSubProperties ( ) const
inline

This method returns the whole list of subproperties.

Returns
The whole lis of subproperties

◆ GetSubProperties() [3/4]

Properties& Kratos::Properties::GetSubProperties ( const IndexType  SubPropertyIndex)
inline

This method gets the subproperty from the index corresponding to the property id.

Parameters
SubPropertyIndexThe index of the subproperty to be get
Returns
The reference to the subproperty of interest

◆ GetSubProperties() [4/4]

const Properties& Kratos::Properties::GetSubProperties ( const IndexType  SubPropertyIndex) const
inline

This method gets the subproperty from the index corresponding to the property id (constant version)

Parameters
SubPropertyIndexThe index of the subproperty to be get
Returns
The reference to the subproperty of interest

◆ GetTable() [1/2]

template<class TXVariableType , class TYVariableType >
TableType& Kratos::Properties::GetTable ( const TXVariableType &  XVariable,
const TYVariableType &  YVariable 
)
inline

◆ GetTable() [2/2]

template<class TXVariableType , class TYVariableType >
TableType const& Kratos::Properties::GetTable ( const TXVariableType &  XVariable,
const TYVariableType &  YVariable 
) const
inline

◆ GetValue() [1/7]

template<class TVariableType >
TVariableType::Type& Kratos::Properties::GetValue ( const TVariableType &  rVariable)
inline

◆ GetValue() [2/7]

template<class TVariableType >
TVariableType::Type const& Kratos::Properties::GetValue ( const TVariableType &  rVariable) const
inline

◆ GetValue() [3/7]

template<class TVariableType >
TVariableType::Type Kratos::Properties::GetValue ( const TVariableType &  rVariable,
const GeometryType rGeometry,
const Vector rShapeFunctionVector,
const ProcessInfo rProcessInfo 
) const
inline

◆ GetValue() [4/7]

template<class TVariableType >
TVariableType::Type& Kratos::Properties::GetValue ( const TVariableType &  rVariable,
Node rThisNode 
)
inline

◆ GetValue() [5/7]

template<class TVariableType >
TVariableType::Type& Kratos::Properties::GetValue ( const TVariableType &  rVariable,
Node rThisNode,
IndexType  SolutionStepIndex 
)
inline

◆ GetValue() [6/7]

template<class TVariableType >
TVariableType::Type const& Kratos::Properties::GetValue ( const TVariableType &  rVariable,
Node const &  rThisNode 
) const
inline

◆ GetValue() [7/7]

template<class TVariableType >
TVariableType::Type const& Kratos::Properties::GetValue ( const TVariableType &  rVariable,
Node const &  rThisNode,
IndexType  SolutionStepIndex 
) const
inline

◆ Has()

template<class TVariableType >
bool Kratos::Properties::Has ( TVariableType const &  rThisVariable) const
inline

◆ HasAccessor()

template<class TVariableType >
bool Kratos::Properties::HasAccessor ( const TVariableType &  rVariable) const
inline

Check if current properties have an accessor This method checks if current properties have an accessor for the requested variable.

Template Parameters
TVariableTypeThe variable type
Parameters
rVariableVariable to which we are checking if an accessor exists
Returns
true If there is accessor for the requested variable
false If there is no accessor for the requested variable

◆ HasSubProperties()

bool Kratos::Properties::HasSubProperties ( const IndexType  SubPropertyIndex) const
inline

This method checks if the subproperty exists from the index corresponding to the property id.

Parameters
SubPropertyIndexThe index of the subproperty to be get
Returns
True if there is such subproperty, false otherwise

◆ HasTable()

template<class TXVariableType , class TYVariableType >
bool Kratos::Properties::HasTable ( const TXVariableType &  XVariable,
const TYVariableType &  YVariable 
) const
inline

◆ HasTables()

bool Kratos::Properties::HasTables ( ) const
inline

◆ HasVariables()

bool Kratos::Properties::HasVariables ( ) const
inline

◆ Info()

std::string Kratos::Properties::Info ( ) const
inlineoverridevirtual

Turn back information as a string.

Reimplemented from Kratos::IndexedObject.

◆ IsEmpty()

bool Kratos::Properties::IsEmpty ( ) const
inline

◆ Key()

int64_t Kratos::Properties::Key ( std::size_t  XKey,
std::size_t  YKey 
) const
inline

◆ KRATOS_CLASS_POINTER_DEFINITION()

Kratos::Properties::KRATOS_CLASS_POINTER_DEFINITION ( Properties  )

Pointer definition of Properties.

◆ NumberOfSubproperties()

std::size_t Kratos::Properties::NumberOfSubproperties ( ) const
inline

This method returns the number of subproperties.

Returns
The current number of subproperties

◆ operator()() [1/8]

template<class TVariableType >
TVariableType::Type& Kratos::Properties::operator() ( const TVariableType &  rV)
inline

◆ operator()() [2/8]

template<class TVariableType >
TVariableType::Type const& Kratos::Properties::operator() ( const TVariableType &  rV) const
inline

◆ operator()() [3/8]

template<class TVariableType >
TVariableType::Type& Kratos::Properties::operator() ( const TVariableType &  rV,
Node rThisNode 
)
inline

◆ operator()() [4/8]

template<class TVariableType >
TVariableType::Type& Kratos::Properties::operator() ( const TVariableType &  rV,
Node rThisNode,
IndexType  SolutionStepIndex 
)
inline

◆ operator()() [5/8]

template<class TVariableType >
TVariableType::Type& Kratos::Properties::operator() ( const TVariableType &  rV,
Node rThisNode,
ProcessInfo const &  rCurrentProcessInfo 
)
inline

◆ operator()() [6/8]

template<class TVariableType >
TVariableType::Type const& Kratos::Properties::operator() ( const TVariableType &  rV,
Node const &  rThisNode 
) const
inline

◆ operator()() [7/8]

template<class TVariableType >
TVariableType::Type const& Kratos::Properties::operator() ( const TVariableType &  rV,
Node const &  rThisNode,
IndexType  SolutionStepIndex 
) const
inline

◆ operator()() [8/8]

template<class TVariableType >
TVariableType::Type const& Kratos::Properties::operator() ( const TVariableType &  rV,
Node const &  rThisNode,
ProcessInfo const &  rCurrentProcessInfo 
) const
inline

◆ operator=()

Properties& Kratos::Properties::operator= ( const Properties rOther)
inline

Assignment operator.

◆ operator[]() [1/2]

template<class TVariableType >
TVariableType::Type& Kratos::Properties::operator[] ( const TVariableType &  rV)
inline

◆ operator[]() [2/2]

template<class TVariableType >
TVariableType::Type const& Kratos::Properties::operator[] ( const TVariableType &  rV) const
inline

◆ pGetAccessor()

template<class TVariableType >
AccessorPointerType& Kratos::Properties::pGetAccessor ( const TVariableType &  rVariable)
inline

Get the Accessor object If exists, this method returns a pointer to the requested variable accessor If doesn't exist, the method throws an error.

Template Parameters
TVariableTypeThe variable type
Parameters
rVariableVariable to which the accessor refers to
Returns
AccessorPointerType& Pointer to the requested variable accessor

◆ pGetSubProperties() [1/2]

Properties::Pointer Kratos::Properties::pGetSubProperties ( const IndexType  SubPropertyIndex)
inline

This method gets the subproperty from the index corresponding to the property id.

Parameters
SubPropertyIndexThe index of the subproperty to be get
Returns
The pointer to the subproperty of interest

◆ pGetSubProperties() [2/2]

const Properties::Pointer Kratos::Properties::pGetSubProperties ( const IndexType  SubPropertyIndex) const
inline

This method gets the subproperty from the index corresponding to the property id (constant version)

Parameters
SubPropertyIndexThe index of the subproperty to be get
Returns
The pointer to the subproperty of interest

◆ PrintData()

void Kratos::Properties::PrintData ( std::ostream &  rOStream) const
inlineoverridevirtual

Print object's data.

Reimplemented from Kratos::IndexedObject.

◆ PrintInfo()

void Kratos::Properties::PrintInfo ( std::ostream &  rOStream) const
inlineoverridevirtual

Print information about this object.

Reimplemented from Kratos::IndexedObject.

◆ SetAccessor()

template<class TVariableType >
void Kratos::Properties::SetAccessor ( const TVariableType &  rVariable,
AccessorPointerType  pAccessor 
)
inline

Set the Accessor object This method sets a variable-accessor pair in current properties accessor container.

Template Parameters
TVariableTypeThe variable type
Parameters
rVariableVariable to which the accessor will refer to
pAccessorPointer to the accessor instance

◆ SetSubProperties()

void Kratos::Properties::SetSubProperties ( SubPropertiesContainerType rSubPropertiesList)
inline

This method set the whole list of subproperties.

Parameters
rSubPropertiesListThe list of subproperties

◆ SetTable()

template<class TXVariableType , class TYVariableType >
void Kratos::Properties::SetTable ( const TXVariableType &  XVariable,
const TYVariableType &  YVariable,
TableType const &  rThisTable 
)
inline

◆ SetValue()

template<class TVariableType >
void Kratos::Properties::SetValue ( TVariableType const &  rV,
typename TVariableType::Type const &  rValue 
)
inline

◆ Tables() [1/2]

TablesContainerType& Kratos::Properties::Tables ( )
inline

This method returns the tables.

Returns
The whole lis of tables

◆ Tables() [2/2]

TablesContainerType const& Kratos::Properties::Tables ( ) const
inline

This method returns the tables (constant)

Returns
The whole lis of tables

Friends And Related Function Documentation

◆ Serializer

friend class Serializer
friend

The documentation for this class was generated from the following file: