39 return bodies_.size();
72 return unitQuaternions_;
95 return mergedBody(bodyID).name();
99 return bodies_[bodyID].name();
133 return mergedBody(bodyID).masterID();
145 return -1 - mergedBodyIndex;
152 return -1 - mergedBodyID;
159 if (!merged(mergedBodyID))
162 <<
"Body " << mergedBodyID <<
" has not been merged" 166 return mergedBodies_[mergedBodyIndex(mergedBodyID)];
172 return bodyIDs_[
name];
186 mergedBody(bodyID).masterXT().
inv()
207 X0_[master(bodyID)].E().
T(),
208 masterPoint(bodyID,
p)
const subBody & mergedBody(label mergedBodyID) const
Return the merged body for the given body ID.
const rigidBodyInertia & I(const label i) const
Return the inertia of body i.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const spatialVector & v(const label i) const
Return the spatial velocity of the bodies.
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
const spatialVector & a(const label i) const
Return the spatial acceleration of the bodies.
label nBodies() const
Return the number of bodies in the model (bodies().size())
label mergedBodyID(const label mergedBodyIndex) const
Return the merged body ID for the given merged body index.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
label master(label bodyID) const
Return the ID of the master body for a sub-body otherwise.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
A class for handling words, derived from Foam::string.
SpatialVector< scalar > spatialVector
SpatialVector of scalars.
label mergedBodyIndex(const label mergedBodyID) const
Return the index of the merged body in the mergedBody list.
const word & name(const label bodyID) const
Return the name of body with the given ID.
const PtrList< joint > & joints() const
Return the list of joints in the model.
bool unitQuaternions() const
Return true if any of the joints using quaternions.
errorManip< error > abort(error &err)
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
label nDoF() const
Return the number of degrees of freedom of the model.
const vector & g() const
Return the acceleration due to gravity.
PtrList< rigidBody > bodies() const
Return the list of the bodies in the model.
const Time & time() const
Return the time.
const DynamicList< label > & lambda() const
List of indices of the parent of each body.
label bodyID(const word &name) const
Return the ID of the body with the given name.
const Time & time_
Reference to time database.
vector masterPoint(const label bodyID, const vector &p) const
bool merged(label bodyID) const
Return true if the body with given ID has been merged with a parent.
static constexpr const zero Zero
Global zero (0)