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::CollectiveExpression Class Reference

Construct a new CollectiveExpression instance. More...

#include <collective_expression.h>

Collaboration diagram for Kratos::CollectiveExpression:

Public Member Functions

Life cycle

{

 CollectiveExpression () noexcept=default
 
 CollectiveExpression (const std::vector< CollectiveExpressionType > &rExpressionPointersList)
 Construct a list of container expressions. More...
 
 CollectiveExpression (const CollectiveExpression &rOther)
 
CollectiveExpressionoperator= (const CollectiveExpression &rOther)
 Assignment operator. More...
 
 ~CollectiveExpression ()=default
 
Public operations
CollectiveExpression Clone () const
 Clones this collective expressions by cloning all the ContainerExpressions in the instance. More...
 
void Add (const CollectiveExpressionType &pExpression)
 Add a ContainerExpression to the current instance. More...
 
void Add (const CollectiveExpression &rCollectiveExpression)
 Add a CollectiveExpression to the current instance. More...
 
void Clear ()
 Clear list of all the ContainerExpressions. More...
 
IndexType GetCollectiveFlattenedDataSize () const
 Get the Collective Flattened Data Size. More...
 
std::vector< CollectiveExpressionTypeGetContainerExpressions ()
 
std::vector< CollectiveExpressionTypeGetContainerExpressions () const
 
bool IsCompatibleWith (const CollectiveExpression &rOther) const
 
Public operators
CollectiveExpressionoperator+= (const CollectiveExpression &rOther)
 
CollectiveExpressionoperator+= (const double Value)
 
CollectiveExpressionoperator-= (const CollectiveExpression &rOther)
 
CollectiveExpressionoperator-= (const double Value)
 
CollectiveExpressionoperator*= (const CollectiveExpression &rOther)
 
CollectiveExpressionoperator*= (const double Value)
 
CollectiveExpressionoperator/= (const CollectiveExpression &rOther)
 
CollectiveExpressionoperator/= (const double Value)
 
Input and output
std::string Info () const
 

Type definitions

using IndexType = std::size_t
 
using CollectiveExpressionType = std::variant< ContainerExpression< ModelPart::NodesContainerType >::Pointer, ContainerExpression< ModelPart::ConditionsContainerType >::Pointer, ContainerExpression< ModelPart::ElementsContainerType >::Pointer >
 
 KRATOS_CLASS_POINTER_DEFINITION (CollectiveExpression)
 

Detailed Description

Construct a new CollectiveExpression instance.

This constructs a CollectiveExpression instance which can hold list of ContainerExpresions of different types. The list within the instance can be treated as a single value, therefore all the binary operations present in the ContainerExpressions are also available with this container. This uses std::variant to store different types of containers. Since these containers memeory footprint is the same, the memory footprint of the std::variant will be almost equal to the memory footprint of a single container for all the container types.

Member Typedef Documentation

◆ CollectiveExpressionType

◆ IndexType

Constructor & Destructor Documentation

◆ CollectiveExpression() [1/3]

Kratos::CollectiveExpression::CollectiveExpression ( )
defaultnoexcept

◆ CollectiveExpression() [2/3]

Kratos::CollectiveExpression::CollectiveExpression ( const std::vector< CollectiveExpressionType > &  rExpressionPointersList)

Construct a list of container expressions.

Parameters
rExpressionPointersListList of container expressions

◆ CollectiveExpression() [3/3]

Kratos::CollectiveExpression::CollectiveExpression ( const CollectiveExpression rOther)

◆ ~CollectiveExpression()

Kratos::CollectiveExpression::~CollectiveExpression ( )
default

Member Function Documentation

◆ Add() [1/2]

void Kratos::CollectiveExpression::Add ( const CollectiveExpression rCollectiveExpression)

Add a CollectiveExpression to the current instance.

This method appends the current instance's list of ContainerExpressions with the new ContainerExpressions in rCollectiveExpression.

Parameters
rCollectiveExpressionThe CollectiveExpression to be appended to the current CollectiveExpression.

◆ Add() [2/2]

void Kratos::CollectiveExpression::Add ( const CollectiveExpressionType pExpression)

Add a ContainerExpression to the current instance.

Parameters
pExpressionThe ContainerExpression to be added.

◆ Clear()

void Kratos::CollectiveExpression::Clear ( )

Clear list of all the ContainerExpressions.

This does not destroy the corresponding ContainerExpression (uses SmartPointers). This removes all the ContainerExpression objects from the current list.

◆ Clone()

CollectiveExpression Kratos::CollectiveExpression::Clone ( ) const

Clones this collective expressions by cloning all the ContainerExpressions in the instance.

This clones current instance of CollectiveExpression by cloning all the ContainerExpressions. Cloning a single ContainerExpression is a light weight operation, hence this operation also a light weight operation.

Returns
CollectiveExpression Cloned collective expressions which has all the clones of ContainerExpressions.

◆ GetCollectiveFlattenedDataSize()

IndexType Kratos::CollectiveExpression::GetCollectiveFlattenedDataSize ( ) const

Get the Collective Flattened Data Size.

This method returns the total number of double values present in all the ContainerExpressions.

Returns
IndexType Total number of double values present in all the ContainerExpressions.

◆ GetContainerExpressions() [1/2]

std::vector< CollectiveExpression::CollectiveExpressionType > Kratos::CollectiveExpression::GetContainerExpressions ( )

◆ GetContainerExpressions() [2/2]

std::vector< CollectiveExpression::CollectiveExpressionType > Kratos::CollectiveExpression::GetContainerExpressions ( ) const

◆ Info()

std::string Kratos::CollectiveExpression::Info ( ) const

◆ IsCompatibleWith()

bool Kratos::CollectiveExpression::IsCompatibleWith ( const CollectiveExpression rOther) const

◆ KRATOS_CLASS_POINTER_DEFINITION()

Kratos::CollectiveExpression::KRATOS_CLASS_POINTER_DEFINITION ( CollectiveExpression  )

◆ operator*=() [1/2]

CollectiveExpression& Kratos::CollectiveExpression::operator*= ( const CollectiveExpression rOther)

◆ operator*=() [2/2]

CollectiveExpression& Kratos::CollectiveExpression::operator*= ( const double  Value)

◆ operator+=() [1/2]

CollectiveExpression& Kratos::CollectiveExpression::operator+= ( const CollectiveExpression rOther)

◆ operator+=() [2/2]

CollectiveExpression& Kratos::CollectiveExpression::operator+= ( const double  Value)

◆ operator-=() [1/2]

CollectiveExpression& Kratos::CollectiveExpression::operator-= ( const CollectiveExpression rOther)

◆ operator-=() [2/2]

CollectiveExpression& Kratos::CollectiveExpression::operator-= ( const double  Value)

◆ operator/=() [1/2]

CollectiveExpression& Kratos::CollectiveExpression::operator/= ( const CollectiveExpression rOther)

◆ operator/=() [2/2]

CollectiveExpression& Kratos::CollectiveExpression::operator/= ( const double  Value)

◆ operator=()

CollectiveExpression & Kratos::CollectiveExpression::operator= ( const CollectiveExpression rOther)

Assignment operator.


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