35 namespace functionObjects
52 Foam::functionObjects::rigidBodyPoints::motion()
const
54 const fvMeshMovers::motionSolver& mover =
55 refCast<const fvMeshMovers::motionSolver>(
mesh_.
mover());
57 return (refCast<const RBD::rigidBodyMotion>(mover.motion()));
72 angularVelocityUnits_(
"[rad/s]"),
73 angularAccelerationUnits_(
"[rad/s^2]")
91 angularVelocityUnits_.readIfPresent(
"angularVelocityUnits",
dict);
92 angularAccelerationUnits_.readIfPresent(
"angularAccelerationUnits",
dict);
94 dict.lookup(
"body") >> body_;
97 names_.setSize(pointsTable.
size());
98 points_.setSize(pointsTable.
size());
103 names_[i] = iter.key();
104 points_[i++] = iter();
118 writeHeaderValue(
file,
"Body", body_);
119 writeHeaderValue(
file,
"Point", points_[i]);
120 writeHeaderValue(
file,
"Angular Velocity Units", angularVelocityUnits_);
124 "Angular Acceleration Units",
125 angularAccelerationUnits_
127 writeCommented(
file,
"Time");
131 <<
"Linear velocity" <<
tab
132 <<
"Angular velocity" <<
tab
133 <<
"Linear acceleration" <<
tab
134 <<
"Angular acceleration" <<
endl;
156 const vector p(motion.
p(bodyID, points_[i]));
160 writeTime(files()[i]);
165 << angularVelocityUnits_.toUser(v.
w()) <<
tab
167 << angularAccelerationUnits_.toUser(a.
w()) <<
endl;
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Macros for easy insertion into run-time selection tables.
An STL-conforming hash table.
label size() const
Return number of elements in table.
const spatialVector & v(const label i) const
Return the spatial velocity of the bodies.
spatialVector a(const label bodyID, const vector &p) const
Return the acceleration of the given point on the given body.
vector p(const label bodyID, const vector &p) const
Return the current position of the given point on the given body.
label bodyIndex(const word &name) const
Return the ID of the body with the given name.
Six degree of freedom motion for a rigid body.
Vector< Cmpt > w() const
Return the angular part of the spatial vector as a vector.
Vector< Cmpt > l() const
Return the linear part of the spatial vector as a vector.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static bool master(const label communicator=0)
Am I the master process.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Abstract base-class for Time/database functionObjects.
Specialisation of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
const fvMesh & mesh_
Reference to the fvMesh.
functionObject base class for creating, maintaining and writing log files e.g. integrated of averaged...
virtual bool write()
Write function.
virtual bool read(const dictionary &)
Read optional controls.
Writes the position, linear and angular velocities and accelerations of a list of points on a body sp...
rigidBodyPoints(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
virtual void writeFileHeader(const label i=0)
overloaded writeFileHeader from writeFile
virtual bool execute()
Execute, currently does nothing.
virtual bool write()
Write the rigidBodyPoints.
virtual ~rigidBodyPoints()
Destructor.
virtual bool read(const dictionary &)
Read the rigidBodyPoints data.
const fvMeshMover & mover() const
Return the mover function class.
A class for handling words, derived from string.
defineTypeNameAndDebug(adjustTimeStepToCombustion, 0)
addToRunTimeSelectionTable(functionObject, adjustTimeStepToCombustion, dictionary)
void writeHeader(std::ostream &, const bool isBinary, const std::string &title)
Write header.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.