Go to the documentation of this file.
37 namespace coordinateRotations
71 scalar angle1(angles.
component(vector::X));
73 scalar angle3(angles.
component(vector::Z));
82 const scalar
c1(
cos(angle1));
const scalar s1(
sin(angle1));
83 const scalar
c2(
cos(angle2));
const scalar s2(
sin(angle2));
84 const scalar c3(
cos(angle3));
const scalar s3(
sin(angle3));
96 (
c2 ), ( -c3*s2 ), ( s2*s3 ),
97 (
c1*s2 ), (
c1*
c2*c3 - s1*s3 ), ( -c3*s1 -
c1*
c2*s3 ),
98 ( s1*s2 ), (
c1*s3 +
c2*c3*s1 ), (
c1*c3 -
c2*s1*s3 )
103 case eulerOrder::XYX:
107 (
c2 ), ( s2*s3 ), ( c3*s2 ),
108 ( s1*s2 ), (
c1*c3 -
c2*s1*s3 ), ( -
c1*s3 -
c2*c3*s1 ),
109 ( -
c1*s2 ), ( c3*s1 +
c1*
c2*s3 ), (
c1*
c2*c3 - s1*s3 )
114 case eulerOrder::YXY:
118 (
c1*c3 -
c2*s1*s3 ), ( s1*s2 ), (
c1*s3 +
c2*c3*s1 ),
119 ( s2*s3 ), (
c2 ), ( -c3*s2 ),
120 ( -c3*s1 -
c1*
c2*s3 ), (
c1*s2 ), (
c1*
c2*c3 - s1*s3 )
125 case eulerOrder::YZY:
129 (
c1*
c2*c3 - s1*s3 ), ( -
c1*s2 ), ( c3*s1 +
c1*
c2*s3 ),
130 ( c3*s2 ), (
c2 ), ( s2*s3 ),
131 (-
c1*s3 -
c2*c3*s1 ), ( s1*s2 ), (
c1*c3 -
c2*s1*s3 )
136 case eulerOrder::ZYZ:
140 (
c1*
c2*c3 - s1*s3 ), ( -c3*s1 -
c1*
c2*s3 ), (
c1*s2 ),
141 (
c1*s3 +
c2*c3*s1 ), (
c1*c3 -
c2*s1*s3 ), ( s1*s2 ),
142 ( -c3*s2 ), ( s2*s3 ), (
c2 )
147 case eulerOrder::ZXZ:
151 (
c1*c3 -
c2*s1*s3 ), ( -
c1*s3 -
c2*c3*s1 ), ( s1*s2 ),
152 ( c3*s1 +
c1*
c2*s3 ), (
c1*
c2*c3 - s1*s3 ), ( -
c1*s2 ),
153 ( s2*s3 ), ( c3*s2 ), (
c2 )
161 case eulerOrder::XZY:
165 (
c2*c3 ), ( -s2 ), (
c2*s3 ),
166 ( s1*s3 +
c1*c3*s2 ), (
c1*
c2 ), (
c1*s2*s3 - c3*s1 ),
167 ( c3*s1*s2 -
c1*s3 ), (
c2*s1 ), (
c1*c3 + s1*s2*s3 )
172 case eulerOrder::XYZ:
176 (
c2*c3 ), ( -
c2*s3 ), ( s2 ),
177 (
c1*s3 + c3*s1*s2 ), (
c1*c3 - s1*s2*s3 ), ( -
c2*s1 ),
178 ( s1*s3 -
c1*c3*s2 ), ( c3*s1 +
c1*s2*s3 ), (
c1*
c2 )
183 case eulerOrder::YXZ:
187 (
c1*c3 + s1*s2*s3 ), ( c3*s1*s2 -
c1*s3 ), (
c2*s1 ),
188 (
c2*s3 ), (
c2*c3 ), ( -s2 ),
189 (
c1*s2*s3 - c3*s1 ), (
c1*c3*s2 + s1*s3 ), (
c1*
c2 )
194 case eulerOrder::YZX:
198 (
c1*
c2 ), ( s1*s3 -
c1*c3*s2 ), ( c3*s1 +
c1*s2*s3 ),
199 ( s2 ), (
c2*c3 ), ( -
c2*s3 ),
200 ( -
c2*s1 ), (
c1*s3 + c3*s1*s2 ), (
c1*c3 - s1*s2*s3 )
205 case eulerOrder::ZYX:
209 (
c1*
c2 ), (
c1*s2*s3 - c3*s1 ), ( s1*s3 +
c1*c3*s2 ),
210 (
c2*s1 ), (
c1*c3 + s1*s2*s3 ), ( c3*s1*s2 -
c1*s3 ),
211 ( -s2 ), (
c2*s3 ), (
c2*c3 )
216 case eulerOrder::ZXY:
220 (
c1*c3 - s1*s2*s3 ), ( -
c2*s1 ), (
c1*s3 + c3*s1*s2 ),
221 ( c3*s1 +
c1*s2*s3 ), (
c1*
c2 ), ( s1*s3 -
c1*c3*s2 ),
222 ( -
c2*s3 ), ( s2 ), (
c2*c3 )
229 <<
"Unknown euler rotation order "
244 return rotation(eulerOrder::ZXZ, angles, degrees);
262 angles_(crot.angles_),
263 degrees_(crot.degrees_),
277 order_(eulerOrder::ZXZ)
290 angles_(angle1, angle2, angle3),
292 order_(eulerOrder::ZXZ)
299 angles_(
dict.getCompat<
vector>(
"angles", {{
"rotation", 1806}})),
300 degrees_(
dict.getOrDefault(
"degrees",
true)),
307 quaternion::eulerOrder::ZXZ
330 os <<
"euler-angles(" << (degrees_ ?
"deg" :
"rad") <<
"): " << angles_;
350 if (order_ != eulerOrder::ZXZ)
A coordinateRotation defined in the z-x-z (intrinsic) Euler convention.
const Cmpt & component(const direction) const
A class for handling words, derived from Foam::string.
static constexpr const zero Zero
Global zero (0)
dimensionedScalar sin(const dimensionedScalar &ds)
virtual void writeEntry(const word &keyword, Ostream &os) const
Write dictionary entry.
Unit conversion functions.
virtual Ostream & beginBlock(const keyType &kw)
Write begin block group with the given name.
virtual void write(Ostream &os) const
Write information.
virtual void clear()
Reset specification.
const dimensionedScalar c1
First radiation constant: default SI units: [W/m2].
User specification of a coordinate rotation.
eulerOrder
Euler-angle rotation order.
virtual Ostream & endBlock()
Write end block group.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Macros for easy insertion into run-time selection tables.
virtual tensor R() const
The rotation tensor calculated for the specified Euler angles.
addNamedToRunTimeSelectionTable(coordinateRotation, axes, dictionary, axes)
errorManip< error > abort(error &err)
const dimensionedScalar c2
Second radiation constant: default SI units: [m.K].
PtrList< volScalarField > & Y
constexpr scalar degToRad(const scalar deg) noexcept
Conversion from degrees to radians.
static const Enum< eulerOrder > eulerOrderNames
The names for Euler-angle rotation order.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
euler()
Construct null - an identity transform.
static tensor rotation(const vector &angles, bool degrees=false)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Tensor< scalar > tensor
Tensor of scalars, i.e. Tensor<scalar>.
static const Identity< scalar > I
dimensionedScalar cos(const dimensionedScalar &ds)