63 return unitQuaternions_;
86 return mergedBody(bodyID).name();
90 return bodies_[bodyID].name();
126 return mergedBody(bodyID).masterIndex();
138 return -1 - mergedBodyIndex;
145 return -1 - mergedBodyID;
152 if (!merged(mergedBodyID))
155 <<
"Body " << mergedBodyID <<
" has not been merged"
159 return mergedBodies_[mergedBodyIndex(mergedBodyID)];
165 return bodyIndices_[
name];
179 mergedBody(bodyID).masterXT().
inv()
206 return X0_[master(bodyID)].E().T() & d;
220 X0_[master(bodyID)].E().
T(),
221 masterPoint(bodyID,
p)
239 X0_[master(bodyID)].E().
T(),
240 masterPoint(bodyID,
p)
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
This class represents the linear and angular inertia of a rigid body by the mass, centre of mass and ...
const spatialVector & v(const label i) const
Return the spatial velocity of body i.
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.
bool unitQuaternions() const
Return true if any of the joints using quaternions.
label master(label bodyID) const
Return the ID of the master body for a sub-body otherwise.
const spatialVector & a(const label i) const
Return the spatial acceleration of body i.
vector masterPoint(const label bodyID, const vector &p) const
const subBody & mergedBody(label mergedBodyID) const
Return the merged body for the given body ID.
vector p(const label bodyID, const vector &p) const
Return the current position of the given point on the given body.
PtrList< rigidBody > bodies_
List of the bodies.
const vector & g() const
Return the acceleration due to gravity.
label nDoF() const
Return the number of degrees of freedom of the model.
label mergedBodyIndex(const label mergedBodyID) const
Return the index of the merged body in the mergedBody list.
label bodyIndex(const word &name) const
Return the ID of the body with the given name.
const DynamicList< label > & lambda() const
List of indices of the parent of each body.
const word & name(const label bodyID) const
Return the name of body with the given ID.
const PtrList< rigidBody > & bodies() const
Return the list of the bodies in the model.
const PtrList< joint > & joints() const
Return the list of joints in the model.
vector d(const label bodyID, const vector &d) const
Return the current direction of the given direction.
const rigidBodyInertia & I(const label i) const
Return the inertia of body i.
bool merged(label bodyID) const
Return true if the body with given ID has been merged with a parent.
This specialised rigidBody holds the original body after it has been merged into a master.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManip< error > abort(error &err)
void inv(pointPatchField< tensor > &, const pointPatchField< tensor > &)
SpatialVector< scalar > spatialVector
SpatialVector of scalars.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
void T(GeometricField< Type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type, GeoMesh, PrimitiveField2 > &gf1)
scalarList X0(nSpecie, 0.0)