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)
92 ax2 -= ((ax1 & ax2) * ax1);
99 <<
"axis1, axis2 appear to be co-linear: "
100 << axis1 <<
", " << axis2 <<
" Revert to guessing axis2"
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);
162 dict.readIfPresent(
"e1", axis1_)
163 &&
dict.readIfPresent(
"e2", axis2_)
170 dict.readIfPresent(
"e2", axis1_)
171 &&
dict.readIfPresent(
"e3", axis2_)
178 dict.readIfPresent(
"e3", axis1_)
179 &&
dict.readIfPresent(
"e1", axis2_)
186 dict.readIfPresent(
"axis", axis1_)
187 &&
dict.readIfPresent(
"direction", axis2_)
190 order_ = E3_E1_COMPAT;
195 <<
"No entries of the type (e1, e2) or (e2, e3) or (e3, e1) found"
237 coordinateRotations::
axes(axis,
Zero, E3_E1_COMPAT)
243 coordinateRotations::
axes()
272 os <<
"e1: " << axis1_ <<
" e2: " << axis2_;
275 os <<
"e2: " << axis1_ <<
" e3: " << axis2_;
278 os <<
"e1: " << axis2_ <<
" e3: " << axis1_;
281 os <<
"axis: " << axis1_ <<
" direction: " << axis2_;
296 const bool subDict = !keyword.empty();
300 os.beginBlock(keyword);
301 os.writeEntry(
"type",
type());
308 os.writeEntry(
"e1", axis1_);
309 os.writeEntry(
"e2", axis2_);
314 os.writeEntry(
"e2", axis1_);
315 os.writeEntry(
"e3", axis2_);
320 os.writeEntry(
"e1", axis2_);
321 os.writeEntry(
"e3", axis1_);
326 os.writeEntry(
"axis", axis1_);
327 os.writeEntry(
"direction", axis2_);
A templated (3 x 3) tensor of objects of <T> derived from MatrixSpace.
A class for handling words, derived from Foam::string.
void read(const dictionary &dict)
static constexpr const zero Zero
bool read(const char *buf, int32_t &val)
Ostream & endl(Ostream &os)
A coordinateRotation specified using global axes.
virtual void write(Ostream &os) const
User specification of a coordinate rotation.
virtual void writeEntry(const word &keyword, Ostream &os) const
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
Macros for easy insertion into run-time selection tables.
@ E1_E2
The axis1 (dominant) is local X, axis2 is local Y.
addNamedToRunTimeSelectionTable(coordinateRotation, axes, dictionary, axes)
errorManip< error > abort(error &err)
@ E2_E3
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_COMPAT
E3_E1 specified as axis/direction.
#define FatalErrorInFunction
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
fileName::Type type(const fileName &name, const bool followLink=true)
#define FatalIOErrorInFunction(ios)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
@ E3_E1
The axis1 (dominant) is local Z, axis2 is local X.
static tensor rotation(const vector &axis1, const vector &axis2, axisOrder order=E3_E1)
Vector< Cmpt > col() const
#define WarningInFunction
Tensor< scalar > tensor
Tensor of scalars, i.e. Tensor<scalar>.
static vector findOrthogonal(const vector &axis)