Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
rigidBodyModel Class Reference

Basic rigid-body model representing a system of rigid-bodies connected by 1-6 DoF joints. More...

Inheritance diagram for rigidBodyModel:
Inheritance graph
[legend]
Collaboration diagram for rigidBodyModel:
Collaboration graph
[legend]

Public Member Functions

 TypeName ("rigidBodyModel")
 
 rigidBodyModel (const Time &time)
 
 rigidBodyModel (const Time &time, const dictionary &dict)
 
virtual ~rigidBodyModel ()
 
const Timetime () const
 
label nBodies () const
 
PtrList< rigidBodybodies () const
 
const DynamicList< label > & lambda () const
 
const PtrList< joint > & joints () const
 
label nDoF () const
 
bool unitQuaternions () const
 
const vectorg () const
 
vectorg ()
 
const wordname (const label bodyID) const
 
const rigidBodyInertiaI (const label i) const
 
const spatialVectorv (const label i) const
 
const spatialVectora (const label i) const
 
virtual label join (const label parentID, const spatialTransform &XT, autoPtr< joint > jointPtr, autoPtr< rigidBody > bodyPtr)
 
label join (const label parentID, const spatialTransform &XT, autoPtr< joints::composite > cJoint, autoPtr< rigidBody > bodyPtr)
 
label merge (const label parentID, const spatialTransform &X, autoPtr< rigidBody > bodyPtr)
 
bool merged (label bodyID) const
 
label master (label bodyID) const
 
label mergedBodyIndex (const label mergedBodyID) const
 
label mergedBodyID (const label mergedBodyIndex) const
 
const subBodymergedBody (label mergedBodyID) const
 
label bodyID (const word &name) const
 
spatialTransform X0 (const label bodyId) const
 
vector masterPoint (const label bodyID, const vector &p) const
 
spatialVector v (const label bodyID, const vector &p) const
 
void applyRestraints (scalarField &tau, Field< spatialVector > &fx, const rigidBodyModelState &state) const
 
void forwardDynamics (rigidBodyModelState &state, const scalarField &tau, const Field< spatialVector > &fx) const
 
void forwardDynamicsCorrection (const rigidBodyModelState &state) const
 
virtual void write (Ostream &) const
 
bool read (const dictionary &dict)
 

Protected Member Functions

virtual label join_ (const label parentID, const spatialTransform &XT, autoPtr< joint > jointPtr, autoPtr< rigidBody > bodyPtr)
 

Protected Attributes

const Timetime_
 
PtrList< rigidBodybodies_
 
PtrList< subBodymergedBodies_
 
HashTable< label > bodyIDs_
 
DynamicList< label > lambda_
 
PtrList< jointjoints_
 
DynamicList< spatialTransformXT_
 
label nDoF_
 
bool unitQuaternions_
 
PtrList< restraintrestraints_
 
vector g_
 
DynamicList< spatialTransformXlambda_
 
DynamicList< spatialTransformX0_
 
DynamicList< spatialVectorv_
 
DynamicList< spatialVectora_
 
DynamicList< spatialVectorc_
 
DynamicList< spatialTensorIA_
 
DynamicList< spatialVectorpA_
 
DynamicList< compactSpatialTensorS_
 
DynamicList< spatialVectorS1_
 
DynamicList< compactSpatialTensorU_
 
DynamicList< spatialVectorU1_
 
DynamicList< tensorDinv_
 
DynamicList< vectoru_
 

Friends

Ostreamoperator<< (Ostream &, const rigidBodyModel &)
 

Detailed Description

Basic rigid-body model representing a system of rigid-bodies connected by 1-6 DoF joints.

This class holds various body and joint state fields needed by the kinematics and forward-dynamics algorithms presented in

reference:

    Featherstone, R. (2008).
    Rigid body dynamics algorithms.
    Springer.
    Chapter 4.
Source files

Definition at line 79 of file rigidBodyModel.H.

Constructor & Destructor Documentation

◆ rigidBodyModel() [1/2]

rigidBodyModel ( const Time time)

Definition at line 162 of file rigidBodyModel.C.

◆ rigidBodyModel() [2/2]

rigidBodyModel ( const Time time,
const dictionary dict 
)

Definition at line 172 of file rigidBodyModel.C.

References dict, dictionary::found(), dictionary::get(), Foam::glTF::key(), rigidBody::New(), joint::New(), Foam::read(), and dictionary::subDict().

Here is the call graph for this function:

◆ ~rigidBodyModel()

~rigidBodyModel ( )
virtual

Definition at line 217 of file rigidBodyModel.C.

Member Function Documentation

◆ join_()

Foam::label join_ ( const label  parentID,
const spatialTransform XT,
autoPtr< joint jointPtr,
autoPtr< rigidBody bodyPtr 
)
protectedvirtual

Definition at line 116 of file rigidBodyModel.C.

References subBody::masterID(), subBody::masterXT(), rigidBody::name(), joint::nDoF(), and joint::unitQuaternion().

Here is the call graph for this function:

◆ TypeName()

TypeName ( "rigidBodyModel"  )

◆ time()

const Foam::Time & time ( ) const
inline

Definition at line 24 of file rigidBodyModelI.H.

References rigidBodyModel::time_.

Referenced by rigidBodyMotion::read().

Here is the caller graph for this function:

◆ nBodies()

Foam::label nBodies ( ) const
inline

Definition at line 30 of file rigidBodyModelI.H.

◆ bodies()

Foam::PtrList< Foam::RBD::rigidBody > bodies ( ) const
inline

Definition at line 37 of file rigidBodyModelI.H.

◆ lambda()

const Foam::DynamicList< Foam::label > & lambda ( ) const
inline

Definition at line 44 of file rigidBodyModelI.H.

◆ joints()

const Foam::PtrList< Foam::RBD::joint > & joints ( ) const
inline

Definition at line 51 of file rigidBodyModelI.H.

◆ nDoF()

Foam::label nDoF ( ) const
inline

Definition at line 57 of file rigidBodyModelI.H.

Referenced by rigidBodyModelState::rigidBodyModelState().

Here is the caller graph for this function:

◆ unitQuaternions()

bool unitQuaternions ( ) const
inline

Definition at line 63 of file rigidBodyModelI.H.

◆ g() [1/2]

Foam::vector & g ( ) const
inline

Definition at line 69 of file rigidBodyModelI.H.

◆ g() [2/2]

vector& g ( )
inline

◆ name()

const Foam::word & name ( const label  bodyID) const
inline

Definition at line 82 of file rigidBodyModelI.H.

◆ I()

const Foam::RBD::rigidBodyInertia & I ( const label  i) const
inline

Definition at line 98 of file rigidBodyModelI.H.

◆ v() [1/2]

const Foam::spatialVector & v ( const label  i) const
inline

Definition at line 105 of file rigidBodyModelI.H.

◆ a()

const Foam::spatialVector & a ( const label  i) const
inline

Definition at line 111 of file rigidBodyModelI.H.

◆ join() [1/2]

Foam::label join ( const label  parentID,
const spatialTransform XT,
autoPtr< joint jointPtr,
autoPtr< rigidBody bodyPtr 
)
virtual

Definition at line 224 of file rigidBodyModel.C.

References autoPtr::ptr().

Here is the call graph for this function:

◆ join() [2/2]

Foam::label join ( const label  parentID,
const spatialTransform XT,
autoPtr< joints::composite cJoint,
autoPtr< rigidBody bodyPtr 
)

Definition at line 258 of file rigidBodyModel.C.

References autoPtr::ptr().

Here is the call graph for this function:

◆ merge()

Foam::label merge ( const label  parentID,
const spatialTransform X,
autoPtr< rigidBody bodyPtr 
)

Definition at line 316 of file rigidBodyModel.C.

References subBody::masterID(), subBody::masterXT(), subBody::name(), Foam::name(), and autoPtr::reset().

Here is the call graph for this function:

◆ merged()

bool merged ( label  bodyID) const
inline

Definition at line 116 of file rigidBodyModelI.H.

◆ master()

Foam::label master ( label  bodyID) const
inline

Definition at line 122 of file rigidBodyModelI.H.

◆ mergedBodyIndex()

Foam::label mergedBodyIndex ( const label  mergedBodyID) const
inline

Definition at line 143 of file rigidBodyModelI.H.

◆ mergedBodyID()

Foam::label mergedBodyID ( const label  mergedBodyIndex) const
inline

Definition at line 136 of file rigidBodyModelI.H.

◆ mergedBody()

const Foam::RBD::subBody & mergedBody ( label  mergedBodyID) const
inline

Definition at line 150 of file rigidBodyModelI.H.

References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

◆ bodyID()

Foam::label bodyID ( const word name) const
inline

Definition at line 163 of file rigidBodyModelI.H.

References Foam::name().

Here is the call graph for this function:

◆ X0()

Foam::spatialTransform X0 ( const label  bodyId) const

Definition at line 374 of file rigidBodyModel.C.

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

Here is the call graph for this function:

◆ masterPoint()

Foam::vector masterPoint ( const label  bodyID,
const vector p 
) const
inline

Definition at line 170 of file rigidBodyModelI.H.

References Foam::inv(), p, and Foam::Zero.

Here is the call graph for this function:

◆ v() [2/2]

Foam::spatialVector v ( const label  bodyID,
const vector p 
) const
inline

Definition at line 191 of file rigidBodyModelI.H.

References p, and Foam::T().

Here is the call graph for this function:

◆ applyRestraints()

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

Definition at line 28 of file forwardDynamics.C.

References DebugInfo, and forAll.

◆ forwardDynamics()

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

◆ forwardDynamicsCorrection()

void forwardDynamicsCorrection ( const rigidBodyModelState state) const

◆ write()

void write ( Ostream os) const
virtual

Reimplemented in rigidBodyMotion.

Definition at line 388 of file rigidBodyModel.C.

References Foam::endl(), forAll, Foam::indent(), Foam::name(), Foam::nl, and os().

Referenced by Foam::RBD::operator<<(), and rigidBodyMotion::write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read()

bool read ( const dictionary dict)

Definition at line 449 of file rigidBodyModel.C.

References dict.

Referenced by rigidBodyMotion::read().

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator<<

Ostream& operator<< ( Ostream ,
const rigidBodyModel  
)
friend

Member Data Documentation

◆ time_

const Time& time_
protected

Definition at line 99 of file rigidBodyModel.H.

Referenced by rigidBodyModel::time().

◆ bodies_

PtrList<rigidBody> bodies_
protected

Definition at line 107 of file rigidBodyModel.H.

◆ mergedBodies_

PtrList<subBody> mergedBodies_
protected

Definition at line 113 of file rigidBodyModel.H.

◆ bodyIDs_

HashTable<label> bodyIDs_
protected

Definition at line 116 of file rigidBodyModel.H.

◆ lambda_

DynamicList<label> lambda_
protected

Definition at line 119 of file rigidBodyModel.H.

◆ joints_

PtrList<joint> joints_
protected

Definition at line 122 of file rigidBodyModel.H.

◆ XT_

DynamicList<spatialTransform> XT_
protected

Definition at line 125 of file rigidBodyModel.H.

◆ nDoF_

label nDoF_
protected

Definition at line 129 of file rigidBodyModel.H.

◆ unitQuaternions_

bool unitQuaternions_
protected

Definition at line 132 of file rigidBodyModel.H.

◆ restraints_

PtrList<restraint> restraints_
protected

Definition at line 135 of file rigidBodyModel.H.

◆ g_

vector g_
protected

Definition at line 141 of file rigidBodyModel.H.

◆ Xlambda_

DynamicList<spatialTransform> Xlambda_
mutableprotected

Definition at line 147 of file rigidBodyModel.H.

◆ X0_

DynamicList<spatialTransform> X0_
mutableprotected

Definition at line 150 of file rigidBodyModel.H.

◆ v_

DynamicList<spatialVector> v_
mutableprotected

Definition at line 156 of file rigidBodyModel.H.

◆ a_

DynamicList<spatialVector> a_
mutableprotected

Definition at line 159 of file rigidBodyModel.H.

◆ c_

DynamicList<spatialVector> c_
mutableprotected

Definition at line 162 of file rigidBodyModel.H.

◆ IA_

DynamicList<spatialTensor> IA_
mutableprotected

Definition at line 170 of file rigidBodyModel.H.

◆ pA_

DynamicList<spatialVector> pA_
mutableprotected

Definition at line 173 of file rigidBodyModel.H.

◆ S_

DynamicList<compactSpatialTensor> S_
mutableprotected

Definition at line 179 of file rigidBodyModel.H.

◆ S1_

DynamicList<spatialVector> S1_
mutableprotected

Definition at line 182 of file rigidBodyModel.H.

◆ U_

DynamicList<compactSpatialTensor> U_
mutableprotected

Definition at line 185 of file rigidBodyModel.H.

◆ U1_

DynamicList<spatialVector> U1_
mutableprotected

Definition at line 188 of file rigidBodyModel.H.

◆ Dinv_

DynamicList<tensor> Dinv_
mutableprotected

Definition at line 191 of file rigidBodyModel.H.

◆ u_

DynamicList<vector> u_
mutableprotected

Definition at line 194 of file rigidBodyModel.H.


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