37 namespace coordinateRotations
75 const scalar magAxis1(
mag(axis1));
76 scalar magAxis2(
mag(axis2));
78 if (magAxis1 < ROOTVSMALL)
81 <<
"Dominant coordinate axis cannot have zero length" 86 const vector ax1(axis1 / magAxis1);
89 if (magAxis2 < ROOTVSMALL)
95 ax2.removeCollinear(ax1);
102 <<
"axis1, axis2 appear to be co-linear: " 103 << axis1 <<
", " << axis2 <<
" Revert to guessing axis2" 108 ax2.removeCollinear(ax1);
112 if (magAxis2 < SMALL)
115 <<
"Could not find an appropriate second axis" 132 rotTensor.col<0>(ax1);
133 rotTensor.col<1>(ax2);
134 rotTensor.col<2>(ax1^ax2);
139 rotTensor.col<0>(ax1^ax2);
140 rotTensor.col<1>(ax1);
141 rotTensor.col<2>(ax2);
147 rotTensor.col<0>(ax2);
148 rotTensor.col<1>(ax1^ax2);
149 rotTensor.col<2>(ax1);
164 dict.readIfPresent(
"e1", axis1_)
165 &&
dict.readIfPresent(
"e2", axis2_)
172 dict.readIfPresent(
"e2", axis1_)
173 &&
dict.readIfPresent(
"e3", axis2_)
180 dict.readIfPresent(
"e3", axis1_)
181 &&
dict.readIfPresent(
"e1", axis2_)
188 dict.readIfPresent(
"axis", axis1_)
189 &&
dict.readIfPresent(
"direction", axis2_)
192 order_ = E3_E1_COMPAT;
197 <<
"No entries of the type (e1, e2) or (e2, e3) or (e3, e1) found" 239 coordinateRotations::
axes(axis,
Zero, E3_E1_COMPAT)
245 coordinateRotations::
axes()
274 os <<
"e1: " << axis1_ <<
" e2: " << axis2_;
277 os <<
"e2: " << axis1_ <<
" e3: " << axis2_;
280 os <<
"e1: " << axis2_ <<
" e3: " << axis1_;
283 os <<
"axis: " << axis1_ <<
" direction: " << axis2_;
298 const bool subDict = !keyword.empty();
302 os.beginBlock(keyword);
303 os.writeEntry(
"type",
type());
310 os.writeEntry(
"e1", axis1_);
311 os.writeEntry(
"e2", axis2_);
316 os.writeEntry(
"e2", axis1_);
317 os.writeEntry(
"e3", axis2_);
322 os.writeEntry(
"e1", axis2_);
323 os.writeEntry(
"e3", axis1_);
328 os.writeEntry(
"axis", axis1_);
329 os.writeEntry(
"direction", axis2_);
E3_E1 specified as axis/direction.
User specification of a coordinate rotation.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Macros for easy insertion into run-time selection tables.
bool read(const char *buf, int32_t &val)
Same as readInt32.
The axis1 (dominant) is local Y, axis2 is local Z.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
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.
A class for handling words, derived from Foam::string.
addAliasToRunTimeSelectionTable(coordinateRotation, axes, dictionary, axes, axesRotation, 1806)
errorManip< error > abort(error &err)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
OBJstream os(runTime.globalPath()/outputName)
static vector findOrthogonal(const vector &axis)
Determine best-guess for an orthogonal axis.
void read(const dictionary &dict)
Read from dictionary.
virtual void writeEntry(const word &keyword, Ostream &os) const
Write dictionary entry.
#define WarningInFunction
Report a warning using Foam::Warning.
A coordinateRotation specified using global axes.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
addNamedToRunTimeSelectionTable(coordinateRotation, axes, dictionary, axes)
The axis1 (dominant) is local X, axis2 is local Y.
Tensor of scalars, i.e. Tensor<scalar>.
virtual void write(Ostream &os) const
Write information.
virtual void clear()
Reset specification.
axes()
Default construct - an identity transform.
virtual tensor R() const
The rotation tensor calculated from the specified axes and order.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
static constexpr const zero Zero
Global zero (0)