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.
affine_transform.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main Authors: Máté Kelemen
11 //
12 
13 #pragma once
14 
15 // Project includes
16 #include "utilities/quaternion.h"
17 
18 namespace Kratos
19 {
20 
21 
22 namespace Detail {
23 
24 
25 } // namespace Detail
26 
29 
30 
40 class KRATOS_API(MESH_MOVING_APPLICATION) AffineTransform
41 {
42 public:
45 
47 
51 
54 
62  const double angle,
63  const array_1d<double,3>& rReferencePoint,
64  const array_1d<double,3>& rTranslationVector);
65 
72  AffineTransform(const array_1d<double,3>& rEulerAngles,
73  const array_1d<double,3>& rReferencePoint,
74  const array_1d<double,3>& rTranslationVector);
75 
81  AffineTransform(const Quaternion<double>& rQuaternion,
82  const array_1d<double,3>& rReferencePoint,
83  const array_1d<double,3>& rTranslationVector);
84 
88 
94  void SetRotation(const array_1d<double,3>& rAxis,
95  const double angle,
96  const array_1d<double,3>& rReferencePoint);
97 
103  void SetRotation(const array_1d<double,3>& rEulerAngles,
104  const array_1d<double,3>& rReferencePoint);
105 
110  void SetRotation(const Quaternion<double>& rQuaternion,
111  const array_1d<double,3>& rReferencePoint);
112 
116  void SetTranslation(const array_1d<double,3>& rTranslationVector);
117 
120  {
121  return prod(mRotationMatrix, rPoint - mReferencePoint) + mReferencePoint + mTranslationVector;
122  }
123 
125 
126 protected:
129 
131 
133 
135 
137 }; // class AffineTransform
138 
139 
141 
142 } // namespace Kratos
143 
Class for applying affine transformations.
Definition: affine_transform.h:41
KRATOS_CLASS_POINTER_DEFINITION(AffineTransform)
array_1d< double, 3 > mTranslationVector
Definition: affine_transform.h:132
array_1d< double, 3 > mReferencePoint
Definition: affine_transform.h:130
array_1d< double, 3 > Apply(const array_1d< double, 3 > &rPoint) const
Return the transformed version of the input vector.
Definition: affine_transform.h:119
Matrix mRotationMatrix
Definition: affine_transform.h:134
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
AMatrix::MatrixProductExpression< TExpression1Type, TExpression2Type > prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:568