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.
Public Member Functions | Friends | List of all members
Kratos::EntityProxy< TLocation, TMutable > Class Template Reference

Wrapper class providing a uniform interface for historical/non-historical Node, Element, and Condition. More...

#include <proxies.h>

Collaboration diagram for Kratos::EntityProxy< TLocation, TMutable >:

Public Member Functions

 EntityProxy ()=delete
 Delete the default constructor to prevent storing nullptr. More...
 
 EntityProxy (QualifiedEntity &rEntity) noexcept
 Constructor creating a valid proxy, wrapping the input entity. More...
 
template<class TValue >
bool HasValue (const Variable< TValue > &rVariable) const noexcept
 Check whether the entity has a value for the provided variable. More...
 
template<class TValue >
std::conditional_t< std::is_integral_v< TValue >||std::is_floating_point_v< TValue >, TValue, const TValue & > GetValue (const Variable< TValue > &rVariable) const
 Fetch the value corresponding to the input variable in the wrapped entity. More...
 
template<class TValue , std::enable_if_t<!std::is_same_v< TValue, void > &&TMutable, bool > = true>
TValue & GetValue (const Variable< TValue > &rVariable)
 Fetch the value corresponding to the input variable in the wrapped entity. More...
 
template<class TValue , std::enable_if_t<!std::is_same_v< TValue, void > &&TMutable, bool > = true>
void SetValue (const Variable< TValue > &rVariable, std::conditional_t< std::is_integral_v< TValue >||std::is_floating_point_v< TValue >, TValue, const TValue & > Value)
 Overwrite the value corresponding to the input variable in the wrapped entity. More...
 
const UnqualifiedEntity & GetEntity () const
 Immutable access to the wrapped entity. More...
 
QualifiedEntity & GetEntity ()
 Mutable or immutable access to the wrapped entity, depending on TMutable. More...
 

Friends

class ContainerProxy< EntityProxy >
 ContainerProxy needs to access private typedefs. More...
 

Detailed Description

template<Globals::DataLocation TLocation, bool TMutable>
class Kratos::EntityProxy< TLocation, TMutable >

Wrapper class providing a uniform interface for historical/non-historical Node, Element, and Condition.

EntityProxy exposes common functionality related accessing stored Variable s within an entity, without additional runtime overhead. In this context, an entity can refer to:

Constructor & Destructor Documentation

◆ EntityProxy() [1/2]

template<Globals::DataLocation TLocation, bool TMutable>
Kratos::EntityProxy< TLocation, TMutable >::EntityProxy ( )
delete

Delete the default constructor to prevent storing nullptr.

◆ EntityProxy() [2/2]

template<Globals::DataLocation TLocation, bool TMutable>
Kratos::EntityProxy< TLocation, TMutable >::EntityProxy ( QualifiedEntity &  rEntity)
inlinenoexcept

Constructor creating a valid proxy, wrapping the input entity.

Parameters
rEntityEntity that will be accessed when member functions are called.
Warning
This proxy is invalidated when the container holding rEntity invalidates its iterators or when rEntity is destroyed.

Member Function Documentation

◆ GetEntity() [1/2]

template<Globals::DataLocation TLocation, bool TMutable>
QualifiedEntity& Kratos::EntityProxy< TLocation, TMutable >::GetEntity ( )
inline

Mutable or immutable access to the wrapped entity, depending on TMutable.

◆ GetEntity() [2/2]

template<Globals::DataLocation TLocation, bool TMutable>
const UnqualifiedEntity& Kratos::EntityProxy< TLocation, TMutable >::GetEntity ( ) const
inline

Immutable access to the wrapped entity.

◆ GetValue() [1/2]

template<Globals::DataLocation TLocation, bool TMutable>
template<class TValue , std::enable_if_t<!std::is_same_v< TValue, void > &&TMutable, bool > = true>
TValue& Kratos::EntityProxy< TLocation, TMutable >::GetValue ( const Variable< TValue > &  rVariable)
inline

Fetch the value corresponding to the input variable in the wrapped entity.

◆ GetValue() [2/2]

template<Globals::DataLocation TLocation, bool TMutable>
template<class TValue >
std::conditional_t<std::is_integral_v<TValue> || std::is_floating_point_v<TValue>, TValue, const TValue&> Kratos::EntityProxy< TLocation, TMutable >::GetValue ( const Variable< TValue > &  rVariable) const
inline

Fetch the value corresponding to the input variable in the wrapped entity.

◆ HasValue()

template<Globals::DataLocation TLocation, bool TMutable>
template<class TValue >
bool Kratos::EntityProxy< TLocation, TMutable >::HasValue ( const Variable< TValue > &  rVariable) const
inlinenoexcept

Check whether the entity has a value for the provided variable.

◆ SetValue()

template<Globals::DataLocation TLocation, bool TMutable>
template<class TValue , std::enable_if_t<!std::is_same_v< TValue, void > &&TMutable, bool > = true>
void Kratos::EntityProxy< TLocation, TMutable >::SetValue ( const Variable< TValue > &  rVariable,
std::conditional_t< std::is_integral_v< TValue >||std::is_floating_point_v< TValue >, TValue, const TValue & >  Value 
)
inline

Overwrite the value corresponding to the input variable in the wrapped entity.

Friends And Related Function Documentation

◆ ContainerProxy< EntityProxy >

template<Globals::DataLocation TLocation, bool TMutable>
friend class ContainerProxy< EntityProxy >
friend

ContainerProxy needs to access private typedefs.


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