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::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType > Class Template Reference

#include <coordinate_transformation_utilities.h>

Inheritance diagram for Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >:
Collaboration diagram for Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >:

Public Member Functions

Life Cycle
 CoordinateTransformationUtils (const unsigned int DomainSize, const unsigned int NumRowsPerNode, const Kratos::Flags &rSelectionFlag=SLIP)
 Constructor. More...
 
virtual ~CoordinateTransformationUtils ()
 Destructor. More...
 
Operations
virtual void CalculateRotationOperatorPure (TLocalMatrixType &rRotationMatrix, const GeometryType::PointType &rThisPoint) const
 Calculates rotation operator for given point. More...
 
void LocalRotationOperatorPure (BoundedMatrix< double, 3, 3 > &rRot, const GeometryType::PointType &rThisPoint) const
 
void LocalRotationOperatorPure (BoundedMatrix< double, 2, 2 > &rRot, const GeometryType::PointType &rThisPoint) const
 
virtual void CalculateRotationOperatorPureShapeSensitivities (TLocalMatrixType &rRotationMatrixShapeDerivative, const std::size_t DerivativeNodeIndex, const std::size_t DerivativeDirectionIndex, const GeometryType::PointType &rThisPoint) const
 Calculates rotation nodal matrix shape sensitivities. More...
 
virtual void CalculateRotationOperatorPureShapeSensitivities (BoundedMatrix< double, 2, 2 > &rOutput, const std::size_t DerivativeNodeIndex, const std::size_t DerivativeDirectionIndex, const GeometryType::PointType &rThisPoint) const
 Calculate 2d rotation nodal matrix shape sensitivities. More...
 
virtual void CalculateRotationOperatorPureShapeSensitivities (BoundedMatrix< double, 3, 3 > &rOutput, const std::size_t DerivativeNodeIndex, const std::size_t DerivativeDirectionIndex, const GeometryType::PointType &rThisPoint) const
 Calculate 3d rotation nodal matrix shape sensitivities. More...
 
virtual void Rotate (TLocalMatrixType &rLocalMatrix, TLocalVectorType &rLocalVector, GeometryType &rGeometry) const
 Rotate the local system contributions so that they are oriented with each node's normal. More...
 
virtual void Rotate (TLocalVectorType &rLocalVector, GeometryType &rGeometry) const
 RHS only version of Rotate. More...
 
virtual void ApplySlipCondition (TLocalMatrixType &rLocalMatrix, TLocalVectorType &rLocalVector, GeometryType &rGeometry) const
 Apply slip boundary conditions to the rotated local contributions. More...
 
virtual void ApplySlipCondition (TLocalVectorType &rLocalVector, GeometryType &rGeometry) const
 RHS only version of ApplySlipCondition. More...
 
virtual void RotateVelocities (ModelPart &rModelPart) const
 Transform nodal velocities to the rotated coordinates (aligned with each node's normal) More...
 
virtual void RecoverVelocities (ModelPart &rModelPart) const
 Transform nodal velocities from the rotated system to the original one. More...
 
Input and output
virtual std::string Info () const
 Turn back information as a string. More...
 
virtual void PrintInfo (std::ostream &rOStream) const
 Print information about this object. More...
 
virtual void PrintData (std::ostream &rOStream) const
 Print object's data. More...
 

Protected Member Functions

Protected Operations
template<unsigned int TDim, unsigned int TBlockSize, unsigned int TSkip = 0>
void RotateAux (TLocalMatrixType &rLocalMatrix, TLocalVectorType &rLocalVector, GeometryType &rGeometry) const
 
template<unsigned int TDim>
void RotateAuxPure (TLocalMatrixType &rLocalMatrix, TLocalVectorType &rLocalVector, GeometryType &rGeometry) const
 
template<unsigned int TBlockSize, unsigned int TSkip = 0>
void LocalRotationOperator2D (BoundedMatrix< double, TBlockSize, TBlockSize > &rRot, GeometryType::PointType &rThisPoint) const
 
template<unsigned int TBlockSize, unsigned int TSkip = 0>
void LocalRotationOperator3D (BoundedMatrix< double, TBlockSize, TBlockSize > &rRot, GeometryType::PointType &rThisPoint) const
 
bool IsSlip (const Node &rNode) const
 
template<class TVectorType >
double Normalize (TVectorType &rThis) const
 Normalize a vector. More...
 
Protected Access
unsigned int GetDomainSize () const
 
unsigned int GetBlockSize () const
 

Type Definitions

typedef Node NodeType
 
typedef Geometry< NodeGeometryType
 
 KRATOS_CLASS_POINTER_DEFINITION (CoordinateTransformationUtils)
 Pointer definition of CoordinateTransformationUtils. More...
 

Detailed Description

template<class TLocalMatrixType, class TLocalVectorType, class TValueType>
class Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >

A utility to rotate the local contributions of certain nodes to the system matrix, which is required to apply slip conditions in arbitrary directions. TODO: Move code to source file. Use explicit template instantiation (this way the compilation is faster).

Member Typedef Documentation

◆ GeometryType

template<class TLocalMatrixType , class TLocalVectorType , class TValueType >
typedef Geometry< Node > Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >::GeometryType

◆ NodeType

template<class TLocalMatrixType , class TLocalVectorType , class TValueType >
typedef Node Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >::NodeType

Constructor & Destructor Documentation

◆ CoordinateTransformationUtils()

template<class TLocalMatrixType , class TLocalVectorType , class TValueType >
Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >::CoordinateTransformationUtils ( const unsigned int  DomainSize,
const unsigned int  NumRowsPerNode,
const Kratos::Flags rSelectionFlag = SLIP 
)
inline

Constructor.

Parameters
DomainSizeNumber of space dimensions (2 or 3)
NumRowsPerNodeNumber of matrix or vector rows associated to each node. Velocity DOFs are assumed to be the first mDomainSize rows in each block of rows.
rSelectionFlagAll nodes where the flag given by this argument is set to true will be transformed to a rotated coordinate system.

◆ ~CoordinateTransformationUtils()

template<class TLocalMatrixType , class TLocalVectorType , class TValueType >
virtual Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >::~CoordinateTransformationUtils ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ ApplySlipCondition() [1/2]

template<class TLocalMatrixType , class TLocalVectorType , class TValueType >
virtual void Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >::ApplySlipCondition ( TLocalMatrixType &  rLocalMatrix,
TLocalVectorType &  rLocalVector,
GeometryType rGeometry 
) const
inlinevirtual

Apply slip boundary conditions to the rotated local contributions.

This function takes the local system contributions rotated so each node's velocities are expressed using a base oriented with its normal and imposes that the normal velocity is equal to the mesh velocity in the normal direction.

Reimplemented in Kratos::FlowRateSlipUtility< TLocalMatrixType, TLocalVectorType, TValueType >, Kratos::MPMBoundaryRotationUtility< TLocalMatrixType, TLocalVectorType >, Kratos::CompressibleElementRotationUtility< TLocalMatrixType, TLocalVectorType >, Kratos::FlowRateSlipUtility< LocalSystemMatrixType, LocalSystemVectorType, double >, and Kratos::MPMBoundaryRotationUtility< LocalSystemMatrixType, LocalSystemVectorType >.

◆ ApplySlipCondition() [2/2]

template<class TLocalMatrixType , class TLocalVectorType , class TValueType >
virtual void Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >::ApplySlipCondition ( TLocalVectorType &  rLocalVector,
GeometryType rGeometry 
) const
inlinevirtual

◆ CalculateRotationOperatorPure()

template<class TLocalMatrixType , class TLocalVectorType , class TValueType >
virtual void Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >::CalculateRotationOperatorPure ( TLocalMatrixType &  rRotationMatrix,
const GeometryType::PointType rThisPoint 
) const
inlinevirtual

Calculates rotation operator for given point.

This metod calculates rotation matrix for a given point. Nodal NORMAL variable should be assigned properly since rotation is calculated based on it.

Parameters
rRotationMatrixOutput rotation matrix
rThisPointCurrent node

◆ CalculateRotationOperatorPureShapeSensitivities() [1/3]

template<class TLocalMatrixType , class TLocalVectorType , class TValueType >
virtual void Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >::CalculateRotationOperatorPureShapeSensitivities ( BoundedMatrix< double, 2, 2 > &  rOutput,
const std::size_t  DerivativeNodeIndex,
const std::size_t  DerivativeDirectionIndex,
const GeometryType::PointType rThisPoint 
) const
inlinevirtual

Calculate 2d rotation nodal matrix shape sensitivities.

This method calculates shape sensitivities of 2D rotation matrix for given node. Nodal NORMAL(historical data container) and NORMAL_SHAPE_SENSITIVITY(non-historical data contaienr) variables should be properly initialized.

NORMAL_SHAPE_SENSITIVITY matrix should be properly sized and initialized with proper shape sensitivity values rows: (number_of_neighbour_nodes + 1) * 2 cols: 2

Parameters
rOutputOutput shape sensitivities matrix w.r.t. NodeIndex and DerivativeIndex
DerivativeNodeIndexNodeIndex for which shape sensitivity matrix is computed
DerivativeDirectionIndexDirection index of the node for which shape sensitivity matrix is computed
rThisPointCurrent node where rotation matrix shape sensitivities are required

◆ CalculateRotationOperatorPureShapeSensitivities() [2/3]

template<class TLocalMatrixType , class TLocalVectorType , class TValueType >
virtual void Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >::CalculateRotationOperatorPureShapeSensitivities ( BoundedMatrix< double, 3, 3 > &  rOutput,
const std::size_t  DerivativeNodeIndex,
const std::size_t  DerivativeDirectionIndex,
const GeometryType::PointType rThisPoint 
) const
inlinevirtual

Calculate 3d rotation nodal matrix shape sensitivities.

This method calculates shape sensitivities of 3D rotation matrix for given node. Nodal NORMAL(historical data container) and NORMAL_SHAPE_SENSITIVITY(non-historical data contaienr) variables should be properly initialized.

NORMAL_SHAPE_SENSITIVITY matrix should be properly sized and initialized with proper shape sensitivity values rows: (number_of_neighbour_nodes + 1) * 3 cols: 3

Parameters
rOutputOutput shape sensitivities matrix w.r.t. NodeIndex and DerivativeIndex
DerivativeNodeIndexNodeIndex for which shape sensitivity matrix is computed
DerivativeDirectionIndexDirection index of the node for which shape sensitivity matrix is computed
rThisPointCurrent node where rotation matrix shape sensitivities are required

◆ CalculateRotationOperatorPureShapeSensitivities() [3/3]

template<class TLocalMatrixType , class TLocalVectorType , class TValueType >
virtual void Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >::CalculateRotationOperatorPureShapeSensitivities ( TLocalMatrixType &  rRotationMatrixShapeDerivative,
const std::size_t  DerivativeNodeIndex,
const std::size_t  DerivativeDirectionIndex,
const GeometryType::PointType rThisPoint 
) const
inlinevirtual

Calculates rotation nodal matrix shape sensitivities.

This method calculates shape sensitivities of rotation matrix for given node. Nodal NORMAL(historical data container) and NORMAL_SHAPE_SENSITIVITY(non-historical data contaienr) variables should be properly initialized.

NORMAL_SHAPE_SENSITIVITY matrix should be properly sized and initialized with proper shape sensitivity values rows: number_of_nodes contributing to NORMAL * DOMAIN_SIZE, columns: DOMAIN_SIZE

Parameters
rRotationMatrixShapeDerivativeOutput shape sensitivities matrix w.r.t. NodeIndex and DerivativeIndex
DerivativeNodeIndexNodeIndex for which shape sensitivity matrix is computed
DerivativeDirectionIndexDirection index of the node for which shape sensitivity matrix is computed
rThisPointCurrent node where rotation matrix shape sensitivities are required

◆ GetBlockSize()

template<class TLocalMatrixType , class TLocalVectorType , class TValueType >
unsigned int Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >::GetBlockSize ( ) const
inlineprotected

◆ GetDomainSize()

template<class TLocalMatrixType , class TLocalVectorType , class TValueType >
unsigned int Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >::GetDomainSize ( ) const
inlineprotected

◆ Info()

template<class TLocalMatrixType , class TLocalVectorType , class TValueType >
virtual std::string Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >::Info ( ) const
inlinevirtual

◆ IsSlip()

template<class TLocalMatrixType , class TLocalVectorType , class TValueType >
bool Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >::IsSlip ( const Node rNode) const
inlineprotected

◆ KRATOS_CLASS_POINTER_DEFINITION()

template<class TLocalMatrixType , class TLocalVectorType , class TValueType >
Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >::KRATOS_CLASS_POINTER_DEFINITION ( CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >  )

Pointer definition of CoordinateTransformationUtils.

◆ LocalRotationOperator2D()

template<class TLocalMatrixType , class TLocalVectorType , class TValueType >
template<unsigned int TBlockSize, unsigned int TSkip = 0>
void Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >::LocalRotationOperator2D ( BoundedMatrix< double, TBlockSize, TBlockSize > &  rRot,
GeometryType::PointType rThisPoint 
) const
inlineprotected

◆ LocalRotationOperator3D()

template<class TLocalMatrixType , class TLocalVectorType , class TValueType >
template<unsigned int TBlockSize, unsigned int TSkip = 0>
void Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >::LocalRotationOperator3D ( BoundedMatrix< double, TBlockSize, TBlockSize > &  rRot,
GeometryType::PointType rThisPoint 
) const
inlineprotected

◆ LocalRotationOperatorPure() [1/2]

template<class TLocalMatrixType , class TLocalVectorType , class TValueType >
void Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >::LocalRotationOperatorPure ( BoundedMatrix< double, 2, 2 > &  rRot,
const GeometryType::PointType rThisPoint 
) const
inline

◆ LocalRotationOperatorPure() [2/2]

template<class TLocalMatrixType , class TLocalVectorType , class TValueType >
void Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >::LocalRotationOperatorPure ( BoundedMatrix< double, 3, 3 > &  rRot,
const GeometryType::PointType rThisPoint 
) const
inline

◆ Normalize()

template<class TLocalMatrixType , class TLocalVectorType , class TValueType >
template<class TVectorType >
double Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >::Normalize ( TVectorType &  rThis) const
inlineprotected

Normalize a vector.

Parameters
rThisthe vector
Returns
Original norm of the input vector

◆ PrintData()

template<class TLocalMatrixType , class TLocalVectorType , class TValueType >
virtual void Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >::PrintData ( std::ostream &  rOStream) const
inlinevirtual

◆ PrintInfo()

template<class TLocalMatrixType , class TLocalVectorType , class TValueType >
virtual void Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >::PrintInfo ( std::ostream &  rOStream) const
inlinevirtual

◆ RecoverVelocities()

template<class TLocalMatrixType , class TLocalVectorType , class TValueType >
virtual void Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >::RecoverVelocities ( ModelPart rModelPart) const
inlinevirtual

◆ Rotate() [1/2]

template<class TLocalMatrixType , class TLocalVectorType , class TValueType >
virtual void Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >::Rotate ( TLocalMatrixType &  rLocalMatrix,
TLocalVectorType &  rLocalVector,
GeometryType rGeometry 
) const
inlinevirtual

Rotate the local system contributions so that they are oriented with each node's normal.

Parameters
rLocalMatrixLocal system matrix
rLocalVectorLocal RHS vector
rGeometryA reference to the element's (or condition's) geometry

Reimplemented in Kratos::MPMBoundaryRotationUtility< TLocalMatrixType, TLocalVectorType >, Kratos::CompressibleElementRotationUtility< TLocalMatrixType, TLocalVectorType >, and Kratos::MPMBoundaryRotationUtility< LocalSystemMatrixType, LocalSystemVectorType >.

◆ Rotate() [2/2]

template<class TLocalMatrixType , class TLocalVectorType , class TValueType >
virtual void Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >::Rotate ( TLocalVectorType &  rLocalVector,
GeometryType rGeometry 
) const
inlinevirtual

◆ RotateAux()

template<class TLocalMatrixType , class TLocalVectorType , class TValueType >
template<unsigned int TDim, unsigned int TBlockSize, unsigned int TSkip = 0>
void Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >::RotateAux ( TLocalMatrixType &  rLocalMatrix,
TLocalVectorType &  rLocalVector,
GeometryType rGeometry 
) const
inlineprotected

◆ RotateAuxPure()

template<class TLocalMatrixType , class TLocalVectorType , class TValueType >
template<unsigned int TDim>
void Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >::RotateAuxPure ( TLocalMatrixType &  rLocalMatrix,
TLocalVectorType &  rLocalVector,
GeometryType rGeometry 
) const
inlineprotected

◆ RotateVelocities()

template<class TLocalMatrixType , class TLocalVectorType , class TValueType >
virtual void Kratos::CoordinateTransformationUtils< TLocalMatrixType, TLocalVectorType, TValueType >::RotateVelocities ( ModelPart rModelPart) const
inlinevirtual

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