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::AffineTransform Class Reference

Class for applying affine transformations. More...

#include <affine_transform.h>

Inheritance diagram for Kratos::AffineTransform:
Collaboration diagram for Kratos::AffineTransform:

Public Member Functions

Type Definitions
 KRATOS_CLASS_POINTER_DEFINITION (AffineTransform)
 
Life Cycle
 AffineTransform ()
 Default constructor sets up an identity transform. More...
 
 AffineTransform (const array_1d< double, 3 > &rAxis, const double angle, const array_1d< double, 3 > &rReferencePoint, const array_1d< double, 3 > &rTranslationVector)
 Construct from axis and angle. More...
 
 AffineTransform (const array_1d< double, 3 > &rEulerAngles, const array_1d< double, 3 > &rReferencePoint, const array_1d< double, 3 > &rTranslationVector)
 Construct from euler angles. More...
 
 AffineTransform (const Quaternion< double > &rQuaternion, const array_1d< double, 3 > &rReferencePoint, const array_1d< double, 3 > &rTranslationVector)
 Construct from a quaternion. More...
 
Operations
void SetRotation (const array_1d< double, 3 > &rAxis, const double angle, const array_1d< double, 3 > &rReferencePoint)
 Set rotation from an axis and an angle. More...
 
void SetRotation (const array_1d< double, 3 > &rEulerAngles, const array_1d< double, 3 > &rReferencePoint)
 Set rotation from euler angles. More...
 
void SetRotation (const Quaternion< double > &rQuaternion, const array_1d< double, 3 > &rReferencePoint)
 Set rotation from a quaternion. More...
 
void SetTranslation (const array_1d< double, 3 > &rTranslationVector)
 Set translation part of the transformation. More...
 
array_1d< double, 3 > Apply (const array_1d< double, 3 > &rPoint) const
 Return the transformed version of the input vector. More...
 

Protected Attributes

Member Variables
array_1d< double, 3 > mReferencePoint
 
array_1d< double, 3 > mTranslationVector
 
Matrix mRotationMatrix
 

Detailed Description

Class for applying affine transformations.

for now, only a rotation followed by a translation on an array of size 3 is implemented. The net transformation is equivalent to: 1) Translation to the reference frame (offset the origin) 2) Specified rotation 3) Reverse translation from the reference frame (undo origin offset) 4) Specified translation

Note
angles in radians.

Constructor & Destructor Documentation

◆ AffineTransform() [1/4]

Kratos::AffineTransform::AffineTransform ( )

Default constructor sets up an identity transform.

◆ AffineTransform() [2/4]

Kratos::AffineTransform::AffineTransform ( const array_1d< double, 3 > &  rAxis,
const double  angle,
const array_1d< double, 3 > &  rReferencePoint,
const array_1d< double, 3 > &  rTranslationVector 
)

Construct from axis and angle.

Parameters
rAxisaxis of rotation (direction vector).
angleangle of rotation (in radians).
rReferencePointa point on the axis of rotation.
rTranslationVectortranslation vector.

◆ AffineTransform() [3/4]

Kratos::AffineTransform::AffineTransform ( const array_1d< double, 3 > &  rEulerAngles,
const array_1d< double, 3 > &  rReferencePoint,
const array_1d< double, 3 > &  rTranslationVector 
)

Construct from euler angles.

Parameters
rEulerAngleseuler angles (radians).
rReferencePointorigin of rotation.
rTranslationVectortranslation vector.
Note
The euler angles follow the convention specified by Quaternion (Z, -X', Z").

◆ AffineTransform() [4/4]

Kratos::AffineTransform::AffineTransform ( const Quaternion< double > &  rQuaternion,
const array_1d< double, 3 > &  rReferencePoint,
const array_1d< double, 3 > &  rTranslationVector 
)

Construct from a quaternion.

Parameters
rQuaternionquaternion defining the rotation angle and axis.
rReferencePointa point on the axis of rotation.
rTranslationVectortranslation vector.

Member Function Documentation

◆ Apply()

array_1d<double,3> Kratos::AffineTransform::Apply ( const array_1d< double, 3 > &  rPoint) const
inline

Return the transformed version of the input vector.

◆ KRATOS_CLASS_POINTER_DEFINITION()

Kratos::AffineTransform::KRATOS_CLASS_POINTER_DEFINITION ( AffineTransform  )

◆ SetRotation() [1/3]

void Kratos::AffineTransform::SetRotation ( const array_1d< double, 3 > &  rAxis,
const double  angle,
const array_1d< double, 3 > &  rReferencePoint 
)

Set rotation from an axis and an angle.

Parameters
rAxisaxis of rotation.
angleangle of rotation (radians).
rReferencePointa point on the axis of rotation.

◆ SetRotation() [2/3]

void Kratos::AffineTransform::SetRotation ( const array_1d< double, 3 > &  rEulerAngles,
const array_1d< double, 3 > &  rReferencePoint 
)

Set rotation from euler angles.

Parameters
rEulerAngleseuler angles (radians).
rReferencePointa point on the axis of rotation.
Note
The euler angles follow the convention specified by Quaternion (Z, -X', Z").

◆ SetRotation() [3/3]

void Kratos::AffineTransform::SetRotation ( const Quaternion< double > &  rQuaternion,
const array_1d< double, 3 > &  rReferencePoint 
)

Set rotation from a quaternion.

Parameters
rQuaternionquaternion defining the axis and angle of rotation.
rReferencePointa point on the axis of rotation.

◆ SetTranslation()

void Kratos::AffineTransform::SetTranslation ( const array_1d< double, 3 > &  rTranslationVector)

Set translation part of the transformation.

Parameters
rTranslationVectortranslation vector.

Member Data Documentation

◆ mReferencePoint

array_1d<double,3> Kratos::AffineTransform::mReferencePoint
protected

◆ mRotationMatrix

Matrix Kratos::AffineTransform::mRotationMatrix
protected

◆ mTranslationVector

array_1d<double,3> Kratos::AffineTransform::mTranslationVector
protected

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