![]() |
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.
|
#include <container_expression_utils.h>
Public Types | |
Type definitions | |
using | IndexType = std::size_t |
using | SparseSpaceType = UblasSpace< double, CompressedMatrix, Vector > |
using | SparseMatrixType = SparseSpaceType::MatrixType |
Static Public Member Functions | |
Static operations | |
template<class TContainerType > | |
static double | EntityMaxNormL2 (const ContainerExpression< TContainerType > &rContainer) |
Calculate max L2 norm of the evaluated expression for each entitiy. More... | |
static double | InnerProduct (const CollectiveExpression &rContainer1, const CollectiveExpression &rContainer2) |
Computes inner product between two container expressions by evaluating both expressions for each entity in their containers, hence this is an expensive operation. Both container expressions should have the same types of containe expressions, therefore they may have the same container expressions lists. More... | |
template<class TContainerType > | |
static void | ProductWithEntityMatrix (ContainerExpression< TContainerType > &rOutput, const SparseMatrixType &rMatrix, const ContainerExpression< TContainerType > &rInput) |
Calculates matrix vector product for container variable data. More... | |
template<class TContainerType > | |
static void | ProductWithEntityMatrix (ContainerExpression< TContainerType > &rOutput, const Matrix &rMatrix, const ContainerExpression< TContainerType > &rInput) |
Calculates matrix vector product for container variable data. More... | |
static void | Transpose (Matrix &rOutput, const Matrix &rInput) |
Transposes a dense matrix. More... | |
static void | Transpose (SparseMatrixType &rOutput, const SparseMatrixType &rInput) |
Transposes a sparse matrix. More... | |
template<class TContainerType > | |
static void | ComputeNumberOfNeighbourEntities (ContainerExpression< ModelPart::NodesContainerType > &rOutput) |
Computes number ofneighbour entities for the container. More... | |
template<class TContainerType > | |
static void | MapContainerVariableToNodalVariable (ContainerExpression< ModelPart::NodesContainerType > &rOutput, const ContainerExpression< TContainerType > &rInput, const ContainerExpression< ModelPart::NodesContainerType > &rNeighbourEntities) |
Maps container data to nodal data. More... | |
template<class TContainerType > | |
static void | MapNodalVariableToContainerVariable (ContainerExpression< TContainerType > &rOutput, const ContainerExpression< ModelPart::NodesContainerType > &rInput) |
Maps nodal values to container variable data. More... | |
template<class TContainerType > | |
static void | ComputeNodalVariableProductWithEntityMatrix (ContainerExpression< ModelPart::NodesContainerType > &rOutput, const ContainerExpression< ModelPart::NodesContainerType > &rNodalValues, const Variable< Matrix > &rMatrixVariable, TContainerType &rEntities) |
Computes nodal and entity wise matrix multiplication. More... | |
using Kratos::ContainerExpressionUtils::IndexType = std::size_t |
using Kratos::ContainerExpressionUtils::SparseSpaceType = UblasSpace<double, CompressedMatrix, Vector> |
|
static |
Computes nodal and entity wise matrix multiplication.
This method first distributes rNodalValues to nodes. Then it calculates the matrix from the rEntities using rMatrixVariable. Then nodal values of each entitiy in rEntities is computed. Finally the matrix (from rMatrixVariable in each entity) and vector (from nodal values for each entity taken from rNodalValues) multiplication is carried out. The solution of this multiplication is stored in rOutput.
This method is optimized and compatible with OpenMP and MPI.
TContainerType |
rOutput | Output containing the matrix vectormultiplication |
rNodalValues | Nodal values used as the vector. |
rMatrixVariable | The variable used to obtain matrix from each variable. |
rEntities | Entities to compute the matrix. |
|
static |
Computes number ofneighbour entities for the container.
This method computes number of entities present around nodes in the given TContainerType in the model parts provided in the rOutput.
This method is optimized and compatible with OpenMP and MPI.
TContainerType |
rOutput | Output containing number of entities around each node. |
|
static |
Calculate max L2 norm of the evaluated expression for each entitiy.
This calculates L2 norm of the each entity expression by evaluating, and then returns the maximum of those. This is also an expensive operation.
This method is optimized and compatible with OpenMP and MPI.
TContainerType |
rContainer | Container data |
|
static |
Computes inner product between two container expressions by evaluating both expressions for each entity in their containers, hence this is an expensive operation. Both container expressions should have the same types of containe expressions, therefore they may have the same container expressions lists.
This method is optimized and compatible with OpenMP and MPI.
rContainer1 | Container expressions 1 |
rContainer2 | Container expressions 2 |
|
static |
Maps container data to nodal data.
This method mapps containr data given in rInput to nodal data (rOutput). Mapping is done using rNeighbourEntities (which should consist of number of neighbour entities surrounding each node.).
All the model parts in rOutput, rInput and rNeighbourEntities should be the same.
This method is optimized and compatible with OpenMP and MPI.
TContainerType |
rOutput | Output containing mapped nodal values. |
rInput | Input containing values in the TContainerType which needs to be mapped to nodes. |
rNeighbourEntities | Number of neighbour entities present around each node. |
|
static |
Maps nodal values to container variable data.
This method maps nodal data to given container type.
rOutput and rInput should have the same model part.
This method is optimized and compatible with OpenMP and MPI.
TContainerType |
rOutput | Output containing mapped data. |
rInput | Nodal data to be mapped to the other type of container. |
|
static |
Calculates matrix vector product for container variable data.
This computes matrix and vector product between rMatrix and the contaienr variable data rInput. This is an expensive operation since this involve evaluating the expression for each entity and doing matrix vector multiplication.
This is only compatible with OpenMP.
TContainerType |
rOutput | Output container containing matrix vector multiplication. |
rMatrix | dense matrix |
rInput | Input container values to be used with matrix product. |
|
static |
Calculates matrix vector product for container variable data.
This computes matrix and vector product between rMatrix and the contaienr variable data rInput. This is an expensive operation since this involve evaluating the expression for each entity and doing matrix vector multiplication.
This is only compatible with OpenMP.
TContainerType |
rOutput | Output container containing matrix vector multiplication. |
rMatrix | Sparse matrix |
rInput | Input container values to be used with matrix product. |
Transposes a dense matrix.
This method is optimized for OpenMP.
rOutput | |
rInput |
|
static |
Transposes a sparse matrix.
This method is optimized for OpenMP.
rOutput | |
rInput |