www.mooseframework.org
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) More...
 
 RotationTensor (const RealVectorValue &euler_angles)
 fills according to Euler angles (measured in degrees) More...
 
void update (Axis axis, Real angle)
 reforms the rotation matrix according to axis and angle. More...
 
void update (const RealVectorValue &euler_angles)
 reforms the rotation matrix according to the Euler angles. More...
 

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 27 of file RotationTensor.h.

Member Enumeration Documentation

axis for single axis rotation constructor

Enumerator
XAXIS 
YAXIS 
ZAXIS 

Definition at line 31 of file RotationTensor.h.

Constructor & Destructor Documentation

RotationTensor::RotationTensor ( Axis  axis,
Real  angle 
)

single axis rotation (in degrees)

Definition at line 10 of file RotationTensor.C.

10 { update(axis, angle); }
void update(Axis axis, Real angle)
reforms the rotation matrix according to axis and angle.
RotationTensor::RotationTensor ( const RealVectorValue &  euler_angles)

fills according to Euler angles (measured in degrees)

Definition at line 12 of file RotationTensor.C.

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

Member Function Documentation

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

reforms the rotation matrix according to axis and angle.

Definition at line 15 of file RotationTensor.C.

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

16 {
17  zero();
18 
19  RealVectorValue a;
20  a(axis) = 1.0;
21 
22  const Real s = std::sin(angle * libMesh::pi / 180.0);
23  const Real c = std::cos(angle * libMesh::pi / 180.0);
24 
25  // assemble row wise
26  _coords[0] = a * RealVectorValue(1.0, -c, -c);
27  _coords[1] = a * RealVectorValue(0.0, 0.0, s);
28  _coords[2] = a * RealVectorValue(0.0, -s, 0.0);
29 
30  _coords[3] = a * RealVectorValue(0.0, 0.0, -s);
31  _coords[4] = a * RealVectorValue(-c, 1.0, -c);
32  _coords[5] = a * RealVectorValue(s, 0.0, 0.0);
33 
34  _coords[6] = a * RealVectorValue(0.0, s, 0.0);
35  _coords[7] = a * RealVectorValue(-s, 0.0, 0.0);
36  _coords[8] = a * RealVectorValue(-c, -c, 1.0);
37 }
void RotationTensor::update ( const RealVectorValue &  euler_angles)

reforms the rotation matrix according to the Euler angles.

Definition at line 40 of file RotationTensor.C.

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

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