https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
RotationTensor Class Reference

This is a RealTensor version of a rotation matrix It is instantiated with the Euler angles, which are measured in degrees. More...

#include <RotationTensor.h>

Inheritance diagram for RotationTensor:
[legend]

Public Types

enum  Axis { XAXIS = 0 , YAXIS , ZAXIS }
 axis for single axis rotation constructor More...
 

Public Member Functions

 RotationTensor (Axis axis, Real angle)
 single axis rotation (in degrees)
 
 RotationTensor (const RealVectorValue &euler_angles)
 fills according to Euler angles (measured in degrees)
 
void update (Axis axis, Real angle)
 reforms the rotation matrix according to axis and angle.
 
void update (const RealVectorValue &euler_angles)
 reforms the rotation matrix according to the Euler angles.
 

Detailed Description

This is a RealTensor version of a rotation matrix It is instantiated with the Euler angles, which are measured in degrees.

R = Z0 *X1 * Z2 where Z0 = anticlockwise rotation about Z axis through euler_angles(0) degrees where X1 = anticlockwise rotation about X axis through euler_angles(1) degress where Z2 = anticlockwise rotation about Z axis through euler_angles(2) degrees or an axis, angle pair where the angle is taken anticlockwise in degrees

Definition at line 30 of file RotationTensor.h.

Member Enumeration Documentation

◆ Axis

axis for single axis rotation constructor

Enumerator
XAXIS 
YAXIS 
ZAXIS 

Definition at line 34 of file RotationTensor.h.

Constructor & Destructor Documentation

◆ RotationTensor() [1/2]

RotationTensor::RotationTensor ( Axis  axis,
Real  angle 
)

single axis rotation (in degrees)

Definition at line 13 of file RotationTensor.C.

13{ update(axis, angle); }
void update(Axis axis, Real angle)
reforms the rotation matrix according to axis and angle.

◆ RotationTensor() [2/2]

RotationTensor::RotationTensor ( const RealVectorValue &  euler_angles)

fills according to Euler angles (measured in degrees)

Definition at line 15 of file RotationTensor.C.

15{ update(euler_angles); }

Member Function Documentation

◆ update() [1/2]

void RotationTensor::update ( Axis  axis,
Real  angle 
)

reforms the rotation matrix according to axis and angle.

Definition at line 18 of file RotationTensor.C.

19{
20 zero();
21
23 a(axis) = 1.0;
24
25 const Real s = std::sin(angle * libMesh::pi / 180.0);
26 const Real c = std::cos(angle * libMesh::pi / 180.0);
27
28 // assemble row wise
29 _coords[0] = a * RealVectorValue(1.0, -c, -c);
30 _coords[1] = a * RealVectorValue(0.0, 0.0, s);
31 _coords[2] = a * RealVectorValue(0.0, -s, 0.0);
32
33 _coords[3] = a * RealVectorValue(0.0, 0.0, -s);
34 _coords[4] = a * RealVectorValue(-c, 1.0, -c);
35 _coords[5] = a * RealVectorValue(s, 0.0, 0.0);
36
37 _coords[6] = a * RealVectorValue(0.0, s, 0.0);
38 _coords[7] = a * RealVectorValue(-s, 0.0, 0.0);
39 _coords[8] = a * RealVectorValue(-c, -c, 1.0);
40}
const Real pi
const Number zero
VectorValue< Real > RealVectorValue
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

Referenced by ComputeElasticityTensorCP::assignEulerAngles(), RotationTensor(), and RotationTensor().

◆ update() [2/2]

void RotationTensor::update ( const RealVectorValue &  euler_angles)

reforms the rotation matrix according to the Euler angles.

Definition at line 43 of file RotationTensor.C.

44{
45 const Real phi_1 = euler_angles(0) * (libMesh::pi / 180.0);
46 const Real Phi = euler_angles(1) * (libMesh::pi / 180.0);
47 const Real phi_2 = euler_angles(2) * (libMesh::pi / 180.0);
48
49 const Real c1 = std::cos(phi_1);
50 const Real c2 = std::cos(Phi);
51 const Real c3 = std::cos(phi_2);
52
53 const Real s1 = std::sin(phi_1);
54 const Real s2 = std::sin(Phi);
55 const Real s3 = std::sin(phi_2);
56
57 // doing a Z1, X2, Z3 rotation
58 // RealTensorValue is formed row-wise
59
60 _coords[0] = c1 * c3 - c2 * s1 * s3; // R11
61 _coords[3] = -c1 * s3 - c2 * c3 * s1; // R21
62 _coords[6] = s1 * s2; // R31
63
64 _coords[1] = c3 * s1 + c1 * c2 * s3; // R12
65 _coords[4] = c1 * c2 * c3 - s1 * s3; // R22
66 _coords[7] = -c1 * s2; // R32
67
68 _coords[2] = s2 * s3; // R13
69 _coords[5] = c3 * s2; // R23
70 _coords[8] = c2; // R33
71}

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