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::SubAssembly< TSubAssemblyType, TElementDataHolderIndex, TRowStartingIndex, TColumnStartingIndex > Class Template Reference

Assembles sub-vectors to element vectors and matrices. More...

#include <fluid_adjoint_derivatives.h>

Inheritance diagram for Kratos::SubAssembly< TSubAssemblyType, TElementDataHolderIndex, TRowStartingIndex, TColumnStartingIndex >:
Collaboration diagram for Kratos::SubAssembly< TSubAssemblyType, TElementDataHolderIndex, TRowStartingIndex, TColumnStartingIndex >:

Public Member Functions

Public operations
BoundedVector< double, ResidualSize > & GetSubVector ()
 Get the Sub Vector. More...
 
template<class TCombinedElementDataContainer >
std::tuple_element< ElementDataIndex, TCombinedElementDataContainer >::type & GetElementDataContainer (TCombinedElementDataContainer &rCombinedDataContainer) const
 Get the Element Data Container. More...
 
template<IndexType TAssemblyRowBlockSize, IndexType TAssemblyColumnBlockSize = TAssemblyRowBlockSize>
void AssembleSubVectorToMatrix (Matrix &rOutput, const IndexType NodeIndex) const
 Assembles sub-vector to the element matrix. More...
 
template<IndexType TAssemblyRowBlockSize>
void AssembleSubVectorToVector (Vector &rOutput) const
 Assembles sub-vector to a vector. More...
 

Type definitions

using IndexType = std::size_t
 
using SubAssemblyType = TSubAssemblyType
 
static constexpr unsigned int ElementDataIndex = TElementDataHolderIndex
 
static constexpr unsigned int RowStartingIndex = TRowStartingIndex
 
static constexpr unsigned int ColumnStartingIndex = TColumnStartingIndex
 
static constexpr unsigned int NumNodes = SubAssemblyType::NumNodes
 
static constexpr unsigned int BlockSize = SubAssemblyType::BlockSize
 
static constexpr unsigned int ResidualSize = NumNodes * BlockSize
 

Detailed Description

template<class TSubAssemblyType, unsigned int TElementDataHolderIndex, unsigned int TRowStartingIndex, unsigned int TColumnStartingIndex = 0>
class Kratos::SubAssembly< TSubAssemblyType, TElementDataHolderIndex, TRowStartingIndex, TColumnStartingIndex >

Assembles sub-vectors to element vectors and matrices.

This class is used to assemble discretized scalar residual vectors having TNumNodes size for a given equation to the local element residuals. The TSubAssemblyType is supposed to give the sub-vectors of the respective scalar residual equation.

Template Parameters
TSubAssemblyTypeThe contributions calculation class type to be used with the sub-assembly.
TElementDataHolderIndexThe index of the data container used in TSubAssemblyType to compute sub-vectors.
TRowStartingIndexThe row starting index within a block for the respective scalar residual.
TColumnStartingIndexThe column starting index within a block for the respective scalar residual.

Member Typedef Documentation

◆ IndexType

template<class TSubAssemblyType , unsigned int TElementDataHolderIndex, unsigned int TRowStartingIndex, unsigned int TColumnStartingIndex = 0>
using Kratos::SubAssembly< TSubAssemblyType, TElementDataHolderIndex, TRowStartingIndex, TColumnStartingIndex >::IndexType = std::size_t

◆ SubAssemblyType

template<class TSubAssemblyType , unsigned int TElementDataHolderIndex, unsigned int TRowStartingIndex, unsigned int TColumnStartingIndex = 0>
using Kratos::SubAssembly< TSubAssemblyType, TElementDataHolderIndex, TRowStartingIndex, TColumnStartingIndex >::SubAssemblyType = TSubAssemblyType

Member Function Documentation

◆ AssembleSubVectorToMatrix()

template<class TSubAssemblyType , unsigned int TElementDataHolderIndex, unsigned int TRowStartingIndex, unsigned int TColumnStartingIndex = 0>
template<IndexType TAssemblyRowBlockSize, IndexType TAssemblyColumnBlockSize = TAssemblyRowBlockSize>
void Kratos::SubAssembly< TSubAssemblyType, TElementDataHolderIndex, TRowStartingIndex, TColumnStartingIndex >::AssembleSubVectorToMatrix ( Matrix rOutput,
const IndexType  NodeIndex 
) const
inline

Assembles sub-vector to the element matrix.

This assembles the sub-vector to the given matrix rOutput. The row to which this is assembled is determined by the NodeIndex and RowStartingIndex and the TAssemblyRowBlockSize. The sub-vector is distributed in that specific row based on the TAssemblyColumnBlockSize, and ColumnStartingIndex.

This assembly is done node wise in an outer loop from this method, hence for rows, NodeIndex is passed The sub-vector holds all the contributions for each node, hence no need to pass the node index for the columns

Template Parameters
TAssemblyRowBlockSizeBlock size of the rows in the final assembled matrix rOutput
TAssemblyColumnBlockSizeBlock size of the columns in the final assembled matrix rOutput
Parameters
rOutputAssembled matrix
NodeIndexNode index corresponds to which row the sub-vector belongs to.

◆ AssembleSubVectorToVector()

template<class TSubAssemblyType , unsigned int TElementDataHolderIndex, unsigned int TRowStartingIndex, unsigned int TColumnStartingIndex = 0>
template<IndexType TAssemblyRowBlockSize>
void Kratos::SubAssembly< TSubAssemblyType, TElementDataHolderIndex, TRowStartingIndex, TColumnStartingIndex >::AssembleSubVectorToVector ( Vector rOutput) const
inline

Assembles sub-vector to a vector.

This method assembles mSubVector to rOutput vector (which is the element vector).

Template Parameters
TAssemblyRowBlockSizeBlock size of the rOutput vector
Parameters
rOutputAssembled vector

◆ GetElementDataContainer()

template<class TSubAssemblyType , unsigned int TElementDataHolderIndex, unsigned int TRowStartingIndex, unsigned int TColumnStartingIndex = 0>
template<class TCombinedElementDataContainer >
std::tuple_element<ElementDataIndex, TCombinedElementDataContainer>::type& Kratos::SubAssembly< TSubAssemblyType, TElementDataHolderIndex, TRowStartingIndex, TColumnStartingIndex >::GetElementDataContainer ( TCombinedElementDataContainer &  rCombinedDataContainer) const
inline

Get the Element Data Container.

This returns the element data container with ElementDataIndex from a combined data container (std::tuple)

Template Parameters
TCombinedElementDataContainer
Parameters
rCombinedDataContainer
Returns
std::tuple_element<ElementDataIndex, TCombinedElementDataContainer>::type&

◆ GetSubVector()

template<class TSubAssemblyType , unsigned int TElementDataHolderIndex, unsigned int TRowStartingIndex, unsigned int TColumnStartingIndex = 0>
BoundedVector<double, ResidualSize>& Kratos::SubAssembly< TSubAssemblyType, TElementDataHolderIndex, TRowStartingIndex, TColumnStartingIndex >::GetSubVector ( )
inline

Get the Sub Vector.

This returns the sub-vector which needs to be filled with the scalar equation information which is assembled to the elemental LHS or RHS.

Returns
BoundedVector<double, ResidualSize>& Returns a reference to the sub-vector

Member Data Documentation

◆ BlockSize

template<class TSubAssemblyType , unsigned int TElementDataHolderIndex, unsigned int TRowStartingIndex, unsigned int TColumnStartingIndex = 0>
constexpr unsigned int Kratos::SubAssembly< TSubAssemblyType, TElementDataHolderIndex, TRowStartingIndex, TColumnStartingIndex >::BlockSize = SubAssemblyType::BlockSize
staticconstexpr

◆ ColumnStartingIndex

template<class TSubAssemblyType , unsigned int TElementDataHolderIndex, unsigned int TRowStartingIndex, unsigned int TColumnStartingIndex = 0>
constexpr unsigned int Kratos::SubAssembly< TSubAssemblyType, TElementDataHolderIndex, TRowStartingIndex, TColumnStartingIndex >::ColumnStartingIndex = TColumnStartingIndex
staticconstexpr

◆ ElementDataIndex

template<class TSubAssemblyType , unsigned int TElementDataHolderIndex, unsigned int TRowStartingIndex, unsigned int TColumnStartingIndex = 0>
constexpr unsigned int Kratos::SubAssembly< TSubAssemblyType, TElementDataHolderIndex, TRowStartingIndex, TColumnStartingIndex >::ElementDataIndex = TElementDataHolderIndex
staticconstexpr

◆ NumNodes

template<class TSubAssemblyType , unsigned int TElementDataHolderIndex, unsigned int TRowStartingIndex, unsigned int TColumnStartingIndex = 0>
constexpr unsigned int Kratos::SubAssembly< TSubAssemblyType, TElementDataHolderIndex, TRowStartingIndex, TColumnStartingIndex >::NumNodes = SubAssemblyType::NumNodes
staticconstexpr

◆ ResidualSize

template<class TSubAssemblyType , unsigned int TElementDataHolderIndex, unsigned int TRowStartingIndex, unsigned int TColumnStartingIndex = 0>
constexpr unsigned int Kratos::SubAssembly< TSubAssemblyType, TElementDataHolderIndex, TRowStartingIndex, TColumnStartingIndex >::ResidualSize = NumNodes * BlockSize
staticconstexpr

◆ RowStartingIndex

template<class TSubAssemblyType , unsigned int TElementDataHolderIndex, unsigned int TRowStartingIndex, unsigned int TColumnStartingIndex = 0>
constexpr unsigned int Kratos::SubAssembly< TSubAssemblyType, TElementDataHolderIndex, TRowStartingIndex, TColumnStartingIndex >::RowStartingIndex = TRowStartingIndex
staticconstexpr

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