Go to the documentation of this file.
37 namespace coordinateRotations
71 const scalar magAxis1(
mag(axis1));
72 scalar magAxis2(
mag(axis2));
74 if (magAxis1 < ROOTVSMALL)
77 <<
"Dominant coordinate axis cannot have zero length"
82 const vector ax1(axis1 / magAxis1);
85 if (magAxis2 < ROOTVSMALL)
88 ax2 = findOrthogonal(axis1);
92 ax2 -= ((ax1 & ax2) * ax1);
99 <<
"axis1, axis2 appear to be co-linear: "
100 << axis1 <<
", " << axis2 <<
" Revert to guessing axis2"
103 ax2 = findOrthogonal(axis1);
106 ax2 -= ((ax1 & ax2) * ax1);
110 if (magAxis2 < SMALL)
113 <<
"Could not find an appropriate second axis"
130 rotTensor.
col<0>(ax1);
131 rotTensor.
col<1>(ax2);
132 rotTensor.
col<2>(ax1^ax2);
137 rotTensor.
col<0>(ax1^ax2);
138 rotTensor.
col<1>(ax1);
139 rotTensor.
col<2>(ax2);
145 rotTensor.
col<0>(ax2);
146 rotTensor.
col<1>(ax1^ax2);
147 rotTensor.
col<2>(ax1);
195 <<
"No entries of the type (e1, e2) or (e2, e3) or (e3, e1) found"
224 axis1_(std::move(crot.axis1_)),
225 axis2_(std::move(crot.axis2_)),
246 coordinateRotations::
axes(axis,
Zero, E3_E1_COMPAT)
252 coordinateRotations::
axes()
281 os <<
"e1: " << axis1_ <<
" e2: " << axis2_;
284 os <<
"e2: " << axis1_ <<
" e3: " << axis2_;
287 os <<
"e1: " << axis2_ <<
" e3: " << axis1_;
290 os <<
"axis: " << axis1_ <<
" direction: " << axis2_;
305 const bool subDict = !keyword.empty();
A templated (3 x 3) tensor of objects of <T> derived from MatrixSpace.
A class for handling words, derived from Foam::string.
vector axis1_
The primary axis.
void read(const dictionary &dict)
Read from dictionary.
static constexpr const zero Zero
Global zero (0)
vector axis2_
The secondary axis.
axisOrder order_
The axis order.
virtual tensor R() const
The rotation tensor calculated from the specified axes and order.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual Ostream & beginBlock(const keyType &kw)
Write begin block group with the given name.
A coordinateRotation specified using global axes.
virtual void write(Ostream &os) const
Write information.
virtual void clear()
Reset specification.
axes()
Construct null - an identity transform.
axisOrder
The order/combination of local axes for the axes-rotation definition.
User specification of a coordinate rotation.
virtual void writeEntry(const word &keyword, Ostream &os) const
Write dictionary entry.
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.
The axis1 (dominant) is local X, axis2 is local Y.
addNamedToRunTimeSelectionTable(coordinateRotation, axes, dictionary, axes)
errorManip< error > abort(error &err)
The axis1 (dominant) is local Y, axis2 is local Z.
Vector< scalar > vector
A scalar version of the templated Vector.
errorManipArg< error, int > exit(error &err, const int errNo=1)
E3_E1 specified as axis/direction.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
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.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
The axis1 (dominant) is local Z, axis2 is local X.
static tensor rotation(const vector &axis1, const vector &axis2, axisOrder order=E3_E1)
The rotation tensor calculated from two axes and their order.
Vector< Cmpt > col() const
Extract vector for given column.
#define WarningInFunction
Report a warning using Foam::Warning.