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.
Classes
Kratos::LineOutputProcessUtilities Namespace Reference

Classes

class  VariableDataCollector
 Class to get variable information. More...
 

Typedefs

Type Definitions
using NodeType = ModelPart::NodeType
 
using GeometryType = ModelPart::ElementType::GeometryType
 
using SizeType = std::size_t
 
using IndicesVector = std::vector< int >
 

Functions

Operations
template<class TDataType , class TValueGetterFunction >
void AddVariablesListNamesToVector (std::vector< std::string > &rNamesList, const NodeType &rNode, const std::vector< const Variable< TDataType > * > &rVariablesList, const IndicesVector &rVariableValuesStartIndex, TValueGetterFunction *pValueGetterFunction)
 Modifies names from list of variables. More...
 
template<class TDataType >
TDataType GetHistoricalValue (const NodeType &rNode, const Variable< TDataType > &rVariable)
 Get the Historical Value. More...
 
template<class TDataType >
TDataType GetNonHistoricalValue (const NodeType &rNode, const Variable< TDataType > &rVariable)
 Get the Historical Value. More...
 
template<class TDataType , class TValueGetterFunction >
IndicesVector GetVariableDataStartIndices (const NodeType &rNode, const std::vector< const Variable< TDataType > * > &rVariablesList, TValueGetterFunction *pValueGetterFunction, SizeType &Offset)
 Calculates variable start indices. More...
 
template<class TDataType , class TValueGetterFunction >
void AddInterpolationContributions (std::vector< double > &rValuesList, const ModelPart::NodeType &rNode, const double ShapeFunctionValue, TValueGetterFunction *pValueGetterFunction, const IndicesVector &rVariableValuesStartIndex, const std::vector< const Variable< TDataType > * > &rVariablesList, const SizeType StartIndexOffset)
 Adds interpolation contributions for given variables list. More...
 
template<class... TVariableInfoTuplesList>
void InterpolateVariables (std::vector< double > &rValuesList, const GeometryType &rGeometry, const Vector &rSamplingPointShapeFunctions, const SizeType LocalSamplePointValuesOffset, const TVariableInfoTuplesList &... rVariableInfoTuplesList)
 Interpolates variables for given variable list tuples. More...
 

Typedef Documentation

◆ GeometryType

◆ IndicesVector

◆ NodeType

◆ SizeType

using Kratos::LineOutputProcessUtilities::SizeType = typedef std::size_t

Function Documentation

◆ AddInterpolationContributions()

template<class TDataType , class TValueGetterFunction >
void Kratos::LineOutputProcessUtilities::AddInterpolationContributions ( std::vector< double > &  rValuesList,
const ModelPart::NodeType rNode,
const double  ShapeFunctionValue,
TValueGetterFunction *  pValueGetterFunction,
const IndicesVector rVariableValuesStartIndex,
const std::vector< const Variable< TDataType > * > &  rVariablesList,
const SizeType  StartIndexOffset 
)
inline

Adds interpolation contributions for given variables list.

This method adds interpolation contributions from the given node for list of variables to a flat double vector which is already sized correctly.

The signature of TValueGetterFunction should accept const ModelPart::NodeType&, and const Variable<TDataType>&.

The size of rValuesList should be able to carry all the values coming from rVariablesList for all TDataType for all nodes. Example: In the case of 3 node model part with DENSITY and VELOCITY variables, this size should be 12.

The size of rVariableValuesStartIndex should be one greater than the size of rVariablesList, last position holding the total size of rSamplePointVariableValuesList.

Template Parameters
TDataTypeData type of variables
TValueGetterFunctionFunction prototype to retrive nodal values from.
Parameters
rValuesListCorrectly sized double values vector
rNodeNode from where nodal values are retrieved from
ShapeFunctionValueShape function value for sampling point
pValueGetterFunctionFunction pointer to retrieve nodal values from
rVariableValuesStartIndexList of indices to indicate where corresponding variable should start to write.
rVariablesListList of variables
StartIndexOffsetStart array offset index

◆ AddVariablesListNamesToVector()

template<class TDataType , class TValueGetterFunction >
void Kratos::LineOutputProcessUtilities::AddVariablesListNamesToVector ( std::vector< std::string > &  rNamesList,
const NodeType rNode,
const std::vector< const Variable< TDataType > * > &  rVariablesList,
const IndicesVector rVariableValuesStartIndex,
TValueGetterFunction *  pValueGetterFunction 
)
inline

Modifies names from list of variables.

The signature of TValueGetterFunction should accept const ModelPart::NodeType&, and const Variable<TDataType>&.

Template Parameters
TDataTypeData type of the variable
TValueGetterFunctionGetter function prototype
Parameters
rNamesListOutput variable names list
rNodeExample node to identify dynamic variable properties
rVariablesListList of variables
rVariableValuesStartIndexStarting positions of each variable
pValueGetterFunctionFunction pointer to get variable value from nodes

◆ GetHistoricalValue()

template<class TDataType >
TDataType Kratos::LineOutputProcessUtilities::GetHistoricalValue ( const NodeType rNode,
const Variable< TDataType > &  rVariable 
)
inline

Get the Historical Value.

Returns rVariable from historical data value container of nodes.

Template Parameters
TDataTypeData type
Parameters
rNodeNode
rVariableVariable to read
Returns
TDataType Value

◆ GetNonHistoricalValue()

template<class TDataType >
TDataType Kratos::LineOutputProcessUtilities::GetNonHistoricalValue ( const NodeType rNode,
const Variable< TDataType > &  rVariable 
)
inline

Get the Historical Value.

Returns rVariable from non historical data value container of nodes.

Template Parameters
TDataTypeData type
Parameters
rNodeNode
rVariableVariable to read
Returns
TDataType Value

◆ GetVariableDataStartIndices()

template<class TDataType , class TValueGetterFunction >
IndicesVector Kratos::LineOutputProcessUtilities::GetVariableDataStartIndices ( const NodeType rNode,
const std::vector< const Variable< TDataType > * > &  rVariablesList,
TValueGetterFunction *  pValueGetterFunction,
SizeType Offset 
)

Calculates variable start indices.

Template Parameters
TDataTypeData type
TValueGetterFunctionFunction prototype to retrieve nodal values
Parameters
rNodeExample node to identify dynamic properties of variable values
rVariablesListList of variables to calculate start positions
pValueGetterFunctionFunction pointer to read values from nodes
OffsetInitial offset for flattned data. (This value will be overwritten by new offset)
Returns
IndicesVector Vector containing all start positions for each variable

◆ InterpolateVariables()

template<class... TVariableInfoTuplesList>
void Kratos::LineOutputProcessUtilities::InterpolateVariables ( std::vector< double > &  rValuesList,
const GeometryType rGeometry,
const Vector rSamplingPointShapeFunctions,
const SizeType  LocalSamplePointValuesOffset,
const TVariableInfoTuplesList &...  rVariableInfoTuplesList 
)

Interpolates variables for given variable list tuples.

This method interpolates different types of variables given in the rVariableInfoTuplesList, using getter function and shape function.

TVariableInfoTuplesList is a tuple, which should contain 3 tuple_elements.

  1. IndicesVector to hold start indices of each variable.
  2. std::vector<const Variable<TDataType>*> to hold list of variable pointers.
  3. Value getter function pointer returning TDataType and accepts const ModelPart::NodeType&, and const Variable<TDataType>& input args
Template Parameters
TValueGetterFunctionFunction prototype to retrive nodal values from.
TVariableInfoTuplesListList of tuple argument prototype
Parameters
rGeometryGeometry where sample point is inside of
rSamplingPointShapeFunctionsShape function values of the sampling point
LocalSamplePointValuesOffsetSample point value offset based on local_index of sample point
rVariableInfoTuplesListList of tuple_elements