63 return unitQuaternions_;
86 return mergedBody(bodyID).name();
90 return bodies_[bodyID].name();
119 return mergedBody(bodyID).masterIndex();
131 return -1 - mergedBodyIndex;
138 return -1 - mergedBodyID;
145 if (!merged(mergedBodyID))
148 <<
"Body " << mergedBodyID <<
" has not been merged"
152 return mergedBodies_[mergedBodyIndex(mergedBodyID)];
158 return bodyIndices_[
name];
172 mergedBody(bodyID).masterXT().
inv()
203 X0_[master(bodyID)].E().
T(),
204 masterPoint(bodyID,
p)
222 X0_[master(bodyID)].E().
T(),
223 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 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.
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.
vector masterPoint(const label bodyID, const vector &p) const
spatialVector a(const label bodyID, const vector &p) const
Return the acceleration of the given point on the given body.
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.
PtrList< rigidBody > bodies() const
Return the list of the bodies in 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< joint > & joints() const
Return the list of joints in the model.
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.
word name(const bool)
Return a word representation of a bool.
errorManip< error > abort(error &err)
SpatialVector< scalar > spatialVector
SpatialVector of scalars.
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
scalarList X0(nSpecie, 0.0)