rigidBodyMotion Class Reference

Six degree of freedom motion for a rigid body. More...

Inheritance diagram for rigidBodyMotion:
[legend]
Collaboration diagram for rigidBodyMotion:
[legend]

Public Member Functions

 rigidBodyMotion (const Time &time)
 Construct null. More...
 
 rigidBodyMotion (const Time &time, const dictionary &dict)
 Construct from dictionary. More...
 
 rigidBodyMotion (const Time &time, const dictionary &dict, const dictionary &stateDict)
 Construct from constant and state dictionaries. More...
 
 ~rigidBodyMotion ()
 Destructor. More...
 
bool report () const
 Return the report Switch. More...
 
const rigidBodyModelStatestate () const
 Return the motion state. More...
 
rigidBodyModelStatestate ()
 Return the motion state for modification. More...
 
spatialTransform X00 (const label bodyId) const
 Return the initial transform to the global frame for the. More...
 
void newTime ()
 Store the motion state at the beginning of the time-step. More...
 
void forwardDynamics (rigidBodyModelState &state, const scalarField &tau, const Field< spatialVector > &fx) const
 Calculate and optionally relax the joint acceleration qDdot from. More...
 
void solve (const scalar t, const scalar deltaT, const scalarField &tau, const Field< spatialVector > &fx)
 Integrate velocities, orientation and position. More...
 
void status (const label bodyID) const
 Report the status of the motion of the given body. More...
 
const vector vCofR (const label bodyID) const
 Report linear velocity of the given body. More...
 
const vector cCofR (const label bodyID) const
 Report CofR of the given body. More...
 
tmp< pointFieldtransformPoints (const label bodyID, const pointField &initialPoints) const
 Transform the given initial pointField of the specified body. More...
 
tmp< pointFieldtransformPoints (const label bodyID, const scalarField &weight, const pointField &initialPoints) const
 Transform the given initial pointField of the specified body. More...
 
tmp< pointFieldtransformPoints (const labelList &bodyIDs, const List< const scalarField * > &weights, const pointField &initialPoints) const
 Transform the given initial pointField of the specified body. More...
 
void write (Ostream &) const
 Write. More...
 
bool read (const dictionary &dict)
 Read coefficients dictionary and update system parameters,. More...
 
- Public Member Functions inherited from rigidBodyModel
 TypeName ("rigidBodyModel")
 Runtime type information. More...
 
 rigidBodyModel (const Time &time)
 Null-constructor which adds the single root-body at the origin. More...
 
 rigidBodyModel (const Time &time, const dictionary &dict)
 Construct from dictionary. More...
 
virtual ~rigidBodyModel ()
 Destructor. More...
 
const Timetime () const
 Return the time. More...
 
label nBodies () const
 Return the number of bodies in the model (bodies().size()) More...
 
PtrList< rigidBodybodies () const
 Return the list of the bodies in the model. More...
 
const DynamicList< label > & lambda () const
 List of indices of the parent of each body. More...
 
const PtrList< joint > & joints () const
 Return the list of joints in the model. More...
 
label nDoF () const
 Return the number of degrees of freedom of the model. More...
 
bool unitQuaternions () const
 Return true if any of the joints using quaternions. More...
 
const vectorg () const
 Return the acceleration due to gravity. More...
 
vectorg ()
 Allow the acceleration due to gravity to be set. More...
 
const wordname (const label bodyID) const
 Return the name of body with the given ID. More...
 
const rigidBodyInertiaI (const label i) const
 Return the inertia of body i. More...
 
const spatialVectorv (const label i) const
 Return the spatial velocity of the bodies. More...
 
const spatialVectora (const label i) const
 Return the spatial acceleration of the bodies. More...
 
virtual label join (const label parentID, const spatialTransform &XT, autoPtr< joint > jointPtr, autoPtr< rigidBody > bodyPtr)
 Join the given body to the parent with ID parentID via the given. More...
 
label join (const label parentID, const spatialTransform &XT, autoPtr< joints::composite > cJoint, autoPtr< rigidBody > bodyPtr)
 Join the given body to the parent with ID parentID via the given. More...
 
label merge (const label parentID, const spatialTransform &X, autoPtr< rigidBody > bodyPtr)
 Merge the given body with transform X into the parent with ID. More...
 
bool merged (label bodyID) const
 Return true if the body with given ID has been merged with a parent. More...
 
label master (label bodyID) const
 Return the ID of the master body for a sub-body otherwise. More...
 
label mergedBodyIndex (const label mergedBodyID) const
 Return the index of the merged body in the mergedBody list. More...
 
label mergedBodyID (const label mergedBodyIndex) const
 Return the merged body ID for the given merged body index. More...
 
const subBodymergedBody (label mergedBodyID) const
 Return the merged body for the given body ID. More...
 
label bodyID (const word &name) const
 Return the ID of the body with the given name. More...
 
spatialTransform X0 (const label bodyId) const
 Return the current transform to the global frame for the given body. More...
 
vector masterPoint (const label bodyID, const vector &p) const
 
spatialVector v (const label bodyID, const vector &p) const
 Return the velocity of the given point on the given body. More...
 
void applyRestraints (scalarField &tau, Field< spatialVector > &fx, const rigidBodyModelState &state) const
 Apply the restraints and accumulate the internal joint forces. More...
 
void forwardDynamics (rigidBodyModelState &state, const scalarField &tau, const Field< spatialVector > &fx) const
 Calculate the joint acceleration qDdot from the joint state q,. More...
 
void forwardDynamicsCorrection (const rigidBodyModelState &state) const
 Correct the velocity and acceleration of the bodies in the model. More...
 
bool read (const dictionary &dict)
 Read coefficients dictionary and update system parameters,. More...
 

Friends

class rigidBodySolver
 

Additional Inherited Members

- Protected Member Functions inherited from rigidBodyModel
virtual label join_ (const label parentID, const spatialTransform &XT, autoPtr< joint > jointPtr, autoPtr< rigidBody > bodyPtr)
 Join the given body to the parent with ID parentID via the given. More...
 
- Protected Attributes inherited from rigidBodyModel
const Timetime_
 Reference to time database. More...
 
PtrList< rigidBodybodies_
 List of the bodies. More...
 
PtrList< subBodymergedBodies_
 Bodies may be merged into existing bodies, the inertia of which is. More...
 
HashTable< label > bodyIDs_
 Lookup-table of the IDs of the bodies. More...
 
DynamicList< label > lambda_
 List of indices of the parent of each body. More...
 
PtrList< jointjoints_
 Each body it attached with a joint which are held on this list. More...
 
DynamicList< spatialTransformXT_
 Transform from the parent body frame to the joint frame. More...
 
label nDoF_
 The number of degrees of freedom of the model. More...
 
bool unitQuaternions_
 True if any of the joints using quaternions. More...
 
PtrList< restraintrestraints_
 Motion restraints. More...
 
vector g_
 Acceleration due to gravity. More...
 
DynamicList< spatialTransformXlambda_
 Transform from the parent body to the current body. More...
 
DynamicList< spatialTransformX0_
 Transform for external forces to the bodies reference frame. More...
 
DynamicList< spatialVectorv_
 The spatial velocity of the bodies. More...
 
DynamicList< spatialVectora_
 The spatial acceleration of the bodies. More...
 
DynamicList< spatialVectorc_
 The velocity dependent spatial acceleration of the joints. More...
 
DynamicList< spatialTensorIA_
 Velocity-product acceleration. More...
 
DynamicList< spatialVectorpA_
 Articulated body bias force. More...
 
DynamicList< compactSpatialTensorS_
 Motion subspace for joints with 3 degrees of freedom. More...
 
DynamicList< spatialVectorS1_
 Motion subspace for joints with 1 degrees of freedom. More...
 
DynamicList< compactSpatialTensorU_
 Sub-expression IA.S in the forward-dynamics algorithm. More...
 
DynamicList< spatialVectorU1_
 Sub-expression IA.S1 in the forward-dynamics algorithm. More...
 
DynamicList< tensorDinv_
 Sub-expression (S^T.U)^-1 in the forward-dynamics algorithm. More...
 
DynamicList< vectoru_
 Sub-expression tau - S^T.pA in the forward-dynamics algorithm. More...
 

Detailed Description

Six degree of freedom motion for a rigid body.

Angular momentum stored in body fixed reference frame. Reference orientation of the body (where Q = I) must align with the cartesian axes such that the Inertia tensor is in principle component form. Can add restraints (e.g. a spring) and constraints (e.g. motion may only be on a plane).

The time-integrator for the motion is run-time selectable with options for symplectic (explicit), Crank-Nicolson and Newmark schemes.

Source files

Definition at line 75 of file rigidBodyMotion.H.

Constructor & Destructor Documentation

◆ rigidBodyMotion() [1/3]

rigidBodyMotion ( const Time time)

Construct null.

Definition at line 48 of file rigidBodyMotion.C.

◆ rigidBodyMotion() [2/3]

rigidBodyMotion ( const Time time,
const dictionary dict 
)

Construct from dictionary.

Definition at line 60 of file rigidBodyMotion.C.

References dict, and g.

◆ rigidBodyMotion() [3/3]

rigidBodyMotion ( const Time time,
const dictionary dict,
const dictionary stateDict 
)

Construct from constant and state dictionaries.

Definition at line 93 of file rigidBodyMotion.C.

References dict, and g.

◆ ~rigidBodyMotion()

Destructor.

Definition at line 128 of file rigidBodyMotion.C.

Member Function Documentation

◆ report()

bool report ( ) const
inline

Return the report Switch.

Definition at line 30 of file rigidBodyMotionI.H.

◆ state() [1/2]

const Foam::RBD::rigidBodyModelState & state ( ) const
inline

Return the motion state.

Definition at line 37 of file rigidBodyMotionI.H.

◆ state() [2/2]

Foam::RBD::rigidBodyModelState & state ( )
inline

Return the motion state for modification.

Definition at line 44 of file rigidBodyMotionI.H.

◆ X00()

Foam::spatialTransform X00 ( const label  bodyId) const

Return the initial transform to the global frame for the.

given body

Definition at line 135 of file rigidBodyMotion.C.

References subBody::masterID(), and subBody::masterXT().

Here is the call graph for this function:

◆ newTime()

void newTime ( )
inline

Store the motion state at the beginning of the time-step.

Definition at line 50 of file rigidBodyMotionI.H.

◆ forwardDynamics()

void forwardDynamics ( rigidBodyModelState state,
const scalarField tau,
const Field< spatialVector > &  fx 
) const

Calculate and optionally relax the joint acceleration qDdot from.

the joint state q, velocity qDot, internal force tau (in the joint frame) and external force fx (in the global frame)

Definition at line 152 of file rigidBodyMotion.C.

References rigidBodyModel::forwardDynamics(), and rigidBodyModelState::qDdot().

Here is the call graph for this function:

◆ solve()

void solve ( const scalar  t,
const scalar  deltaT,
const scalarField tau,
const Field< spatialVector > &  fx 
)

Integrate velocities, orientation and position.

for the given time and time-step

Definition at line 172 of file rigidBodyMotion.C.

References UPstream::master(), and Pstream::scatter().

Here is the call graph for this function:

◆ status()

void status ( const label  bodyID) const

Report the status of the motion of the given body.

Definition at line 200 of file rigidBodyMotion.C.

References spatialTransform::E(), Foam::endl(), Foam::Info, SpatialVector< Cmpt >::l(), Foam::name(), Foam::nl, spatialTransform::r(), SpatialVector< Cmpt >::w(), X0(), and Foam::Zero.

Here is the call graph for this function:

◆ vCofR()

const Foam::vector vCofR ( const label  bodyID) const

Report linear velocity of the given body.

Definition at line 214 of file rigidBodyMotion.C.

References SpatialVector< Cmpt >::l(), and Foam::Zero.

Here is the call graph for this function:

◆ cCofR()

const Foam::vector cCofR ( const label  bodyID) const

Report CofR of the given body.

Definition at line 222 of file rigidBodyMotion.C.

References spatialTransform::r(), and X0().

Here is the call graph for this function:

◆ transformPoints() [1/3]

Foam::tmp< Foam::pointField > transformPoints ( const label  bodyID,
const pointField initialPoints 
) const

Transform the given initial pointField of the specified body.

to correspond to the current motion state

Definition at line 232 of file rigidBodyMotion.C.

References forAll, Foam::inv(), points, tmp< T >::ref(), spatialTransform::transformPoint(), and X0().

Here is the call graph for this function:

◆ transformPoints() [2/3]

Foam::tmp< Foam::pointField > transformPoints ( const label  bodyID,
const scalarField weight,
const pointField initialPoints 
) const

Transform the given initial pointField of the specified body.

to correspond to the current motion state scaled using 'slerp' interpolation

Definition at line 254 of file rigidBodyMotion.C.

References forAll, septernion::I, Foam::inv(), points, tmp< T >::ref(), s, Foam::slerp(), spatialTransform::transformPoint(), and X0().

Here is the call graph for this function:

◆ transformPoints() [3/3]

Foam::tmp< Foam::pointField > transformPoints ( const labelList bodyIDs,
const List< const scalarField * > &  weights,
const pointField initialPoints 
) const

Transform the given initial pointField of the specified body.

to correspond to the current motion state scaled using 'slerp' interpolation

Definition at line 296 of file rigidBodyMotion.C.

References Foam::average(), forAll, septernion::I, Foam::inv(), lambda(), points, tmp< T >::ref(), and X0().

Here is the call graph for this function:

◆ write()

void write ( Ostream os) const
virtual

Write.

Reimplemented from rigidBodyModel.

Definition at line 56 of file rigidBodyMotionIO.C.

References os(), and rigidBodyModel::write().

Here is the call graph for this function:

◆ read()

bool read ( const dictionary dict)

Read coefficients dictionary and update system parameters,.

constraints and restraints but not the current state

Definition at line 34 of file rigidBodyMotionIO.C.

References dict, Function1< Type >::NewIfPresent(), word::null, rigidBodyModel::read(), and rigidBodyModel::time().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ rigidBodySolver

friend class rigidBodySolver
friend

Definition at line 79 of file rigidBodyMotion.H.


The documentation for this class was generated from the following files: