55void Foam::coordinateRotations::axisAngle::checkSpec()
57 if (
mag(angle_) < VSMALL ||
mag(axis_) < SMALL)
73 if (
mag(angle) < VSMALL ||
mag(axis) < SMALL)
112 degrees_(crot.degrees_)
155 dict.get<scalar>(
"angle"),
156 dict.getOrDefault(
"degrees", true)
172 return rotation(axis_, angle_, degrees_);
178 os <<
"rotation axis: " << axis_
179 <<
" angle(" << (degrees_ ?
"deg" :
"rad") <<
"): " << angle_;
189 os.beginBlock(keyword);
191 os.writeEntry(
"type",
type());
192 os.writeEntry(
"axis", axis_);
193 os.writeEntry(
"angle", angle_);
196 os.writeEntry(
"degrees",
"false");
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
static const SphericalTensor I
User specification of a coordinate rotation.
A coordinateRotation specified by a rotation axis and a rotation angle about that axis.
axisAngle()
Default construct. Axis = Z, angle = 0.
virtual tensor R() const
Calculate and return the rotation tensor calculated from axis and angle.
virtual void write(Ostream &os) const
Write information.
virtual void writeEntry(const word &keyword, Ostream &os) const
Write dictionary entry.
static tensor rotation(const vector &axis, const scalar angle, bool degrees=false)
The rotation tensor for given axis/angle.
virtual void clear()
Reset specification.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Quaternion class used to perform rotations in 3D space.
tensor R() const
The rotation tensor corresponding to the quaternion.
A class for handling words, derived from Foam::string.
#define defineTypeName(Type)
Define the typeName.
OBJstream os(runTime.globalPath()/outputName)
Namespace for coordinate system rotations.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
constexpr scalar degToRad() noexcept
Multiplication factor for degrees to radians conversion.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
static constexpr const zero Zero
Global zero (0).
Unit conversion functions.