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.
|
Construct a new CollectiveExpression instance. More...
#include <collective_expression.h>
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) | |
CollectiveExpression & | operator= (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< CollectiveExpressionType > | GetContainerExpressions () |
std::vector< CollectiveExpressionType > | GetContainerExpressions () const |
bool | IsCompatibleWith (const CollectiveExpression &rOther) const |
Public operators | |
CollectiveExpression & | operator+= (const CollectiveExpression &rOther) |
CollectiveExpression & | operator+= (const double Value) |
CollectiveExpression & | operator-= (const CollectiveExpression &rOther) |
CollectiveExpression & | operator-= (const double Value) |
CollectiveExpression & | operator*= (const CollectiveExpression &rOther) |
CollectiveExpression & | operator*= (const double Value) |
CollectiveExpression & | operator/= (const CollectiveExpression &rOther) |
CollectiveExpression & | operator/= (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) | |
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.
using Kratos::CollectiveExpression::CollectiveExpressionType = std::variant< ContainerExpression<ModelPart::NodesContainerType>::Pointer, ContainerExpression<ModelPart::ConditionsContainerType>::Pointer, ContainerExpression<ModelPart::ElementsContainerType>::Pointer> |
using Kratos::CollectiveExpression::IndexType = std::size_t |
|
defaultnoexcept |
Kratos::CollectiveExpression::CollectiveExpression | ( | const std::vector< CollectiveExpressionType > & | rExpressionPointersList | ) |
Construct a list of container expressions.
rExpressionPointersList | List of container expressions |
Kratos::CollectiveExpression::CollectiveExpression | ( | const CollectiveExpression & | rOther | ) |
|
default |
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.
rCollectiveExpression | The CollectiveExpression to be appended to the current CollectiveExpression. |
void Kratos::CollectiveExpression::Add | ( | const CollectiveExpressionType & | pExpression | ) |
Add a ContainerExpression to the current instance.
pExpression | The ContainerExpression to be added. |
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.
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.
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.
std::vector< CollectiveExpression::CollectiveExpressionType > Kratos::CollectiveExpression::GetContainerExpressions | ( | ) |
std::vector< CollectiveExpression::CollectiveExpressionType > Kratos::CollectiveExpression::GetContainerExpressions | ( | ) | const |
std::string Kratos::CollectiveExpression::Info | ( | ) | const |
bool Kratos::CollectiveExpression::IsCompatibleWith | ( | const CollectiveExpression & | rOther | ) | const |
Kratos::CollectiveExpression::KRATOS_CLASS_POINTER_DEFINITION | ( | CollectiveExpression | ) |
CollectiveExpression& Kratos::CollectiveExpression::operator*= | ( | const CollectiveExpression & | rOther | ) |
CollectiveExpression& Kratos::CollectiveExpression::operator*= | ( | const double | Value | ) |
CollectiveExpression& Kratos::CollectiveExpression::operator+= | ( | const CollectiveExpression & | rOther | ) |
CollectiveExpression& Kratos::CollectiveExpression::operator+= | ( | const double | Value | ) |
CollectiveExpression& Kratos::CollectiveExpression::operator-= | ( | const CollectiveExpression & | rOther | ) |
CollectiveExpression& Kratos::CollectiveExpression::operator-= | ( | const double | Value | ) |
CollectiveExpression& Kratos::CollectiveExpression::operator/= | ( | const CollectiveExpression & | rOther | ) |
CollectiveExpression& Kratos::CollectiveExpression::operator/= | ( | const double | Value | ) |
CollectiveExpression & Kratos::CollectiveExpression::operator= | ( | const CollectiveExpression & | rOther | ) |
Assignment operator.