54 Foam::functionObjects::sixDoFRigidBodyState::angleTypes
56Foam::functionObjects::sixDoFRigidBodyState::angleTypeNames_
58 { angleTypes::RADIANS,
"radians" },
59 { angleTypes::DEGREES,
"degrees" },
72 <<
"centreOfRotation" <<
tab
73 <<
"centreOfMass" <<
tab
82Foam::functionObjects::sixDoFRigidBodyState::sixDoFRigidBodyState
91 angleFormat_(angleTypes::RADIANS)
105 angleTypeNames_.getOrDefault
142 switch (angleFormat_)
144 case angleTypes::RADIANS:
149 case angleTypes::DEGREES:
151 rotationAngle.x() =
radToDeg(rotationAngle.x());
152 rotationAngle.y() =
radToDeg(rotationAngle.y());
153 rotationAngle.z() =
radToDeg(rotationAngle.z());
155 angularVelocity.x() =
radToDeg(angularVelocity.x());
156 angularVelocity.y() =
radToDeg(angularVelocity.y());
157 angularVelocity.z() =
radToDeg(angularVelocity.z());
163 <<
"Unhandled enumeration " << angleTypeNames_[angleFormat_]
168 writeCurrentTime(file());
173 << rotationAngle <<
tab
175 << angularVelocity <<
endl;
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
const Cmpt & x() const noexcept
Access to the vector x component.
const Cmpt & z() const noexcept
Access to the vector z component.
const Cmpt & y() const noexcept
Access to the vector y component.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
The dynamicMotionSolverFvMesh.
Abstract base-class for Time/database function objects.
virtual bool read(const dictionary &dict)
Read and set the function object if its data have changed.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
const fvMesh & mesh_
Reference to the fvMesh.
fvMeshFunctionObject(const fvMeshFunctionObject &)=delete
No copy construct.
const objectRegistry & obr_
Reference to the region objectRegistry.
Writes the 6-DoF motion state.
virtual void writeFileHeader(Ostream &os)
Overloaded writeFileHeader from writeFile.
virtual bool execute()
Execute, currently does nothing.
virtual bool write()
Write the sixDoFRigidBodyState.
virtual bool read(const dictionary &)
Read the sixDoFRigidBodyState data.
Base class for writing single files from the function objects.
void writeHeaderValue(Ostream &os, const string &property, const Type &value) const
Write a (commented) header property and value pair.
writeFile(const objectRegistry &obr, const fileName &prefix, const word &name="undefined", const bool writeToFile=true, const string &ext=".dat")
Construct from objectRegistry, prefix, fileName.
virtual void writeHeader(Ostream &os, const string &str) const
Write a commented header to stream.
virtual OFstream & file()
Return access to the file (if only 1).
virtual void writeCommented(Ostream &os, const string &str) const
Write a commented string to stream.
virtual void writeCurrentTime(Ostream &os) const
Write the current time to stream.
Quaternion class used to perform rotations in 3D space.
vector eulerAngles(const eulerOrder order) const
Return the Euler rotation angles corresponding to the specified rotation order.
6-DoF solid-body mesh motion solver for an fvMesh.
const sixDoFRigidBodyMotion & motion() const
Return the six DoF motion object.
Six degree of freedom motion for a rigid body.
point centreOfMass() const
Return the current centre of mass.
const vector & v() const
Return the current velocity.
const tensor & orientation() const
Return the orientation tensor, Q.
vector omega() const
Return the angular velocity in the global frame.
const point & centreOfRotation() const
Return the current centre of rotation.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
Ostream & endl(Ostream &os)
Add newline and flush stream.
constexpr scalar radToDeg() noexcept
Multiplication factor for radians to degrees conversion.
errorManip< error > abort(error &err)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
constexpr char tab
The tab '\t' character(0x09).
Unit conversion functions.