32 void Foam::RBD::rigidBodyMotion::initialise()
62 motionState_(*
this, dict),
63 motionState0_(motionState_),
86 motionState_(*
this, stateDict),
87 motionState0_(motionState_),
137 state.
qDdot() = aDamp_*(aRelax_*state.
qDdot() + (1 - aRelax_)*qDdotPrev);
149 motionState_.
t() = t;
150 motionState_.
deltaT() = deltaT;
152 if (motionState0_.
deltaT() < small)
154 motionState0_.
t() = t;
155 motionState0_.
deltaT() = deltaT;
160 solver_->solve(tau, fx);
175 Info<<
"Rigid-body motion of the " <<
name(bodyID) <<
nl 176 <<
" Centre of rotation: " << CofR.
r() <<
nl 177 <<
" Orientation: " << CofR.
E() <<
nl 178 <<
" Linear velocity: " << vCofR.
l() <<
nl 179 <<
" Angular velocity: " << vCofR.
w()
189 return X0(bodyID).
inv() &
X00(bodyID);
const subBody & mergedBody(label mergedBodyID) const
Return the merged body for the given body ID.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
static autoPtr< rigidBodySolver > New(rigidBodyMotion &body, const dictionary &dict)
DynamicList< spatialTransform > X0_
Transform for external forces to the bodies reference frame.
A list of keyword definitions, which are a keyword followed by any number of values (e...
void forwardDynamicsCorrection(const rigidBodyModelState &state) const
Correct the velocity and acceleration of the bodies in the model.
const spatialVector & v(const label i) const
Return the spatial velocity of the bodies.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void status(const label bodyID) const
Report the status of the motion of the given body.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
static bool master(const label communicator=0)
Am I the master process.
spatialTransform X00(const label bodyId) const
Return the initial transform to the global frame for the.
Vector< scalar > vector
A scalar version of the templated Vector.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
Holds the motion state of rigid-body model.
scalar t() const
Return access to the time.
This specialised rigidBody holds the original body after it has been merged into a master...
const word & name(const label bodyID) const
Return the name of body with the given ID.
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
Vector< Cmpt > l() const
Return the linear part of the spatial vector as a vector.
void solve(const scalar t, const scalar deltaT, const scalarField &tau, const Field< spatialVector > &fx)
Integrate velocities, orientation and position.
scalar deltaT() const
Return access to the time-step.
label masterID() const
Return the master body Id.
rigidBodyMotion()
Construct null.
const vector & g() const
Return the acceleration due to gravity.
Vector< Cmpt > w() const
Return the angular part of the spatial vector as a vector.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
Basic rigid-body model representing a system of rigid-bodies connected by 1-6 DoF joints...
spatialTransform transform0(const label bodyID) const
Return the transformation of bodyID relative to the initial time.
spatialTransform X0(const label bodyId) const
Return the current transform to the global frame for the given body.
~rigidBodyMotion()
Destructor.
rigidBodyModel()
Null-constructor which adds the single root-body at the origin.
const scalarField & qDdot() const
Return access to the joint acceleration.
void forwardDynamics(rigidBodyModelState &state, const scalarField &tau, const Field< spatialVector > &fx) const
Calculate the joint acceleration qDdot from the joint state q,.
bool merged(label bodyID) const
Return true if the body with given ID has been merged with a parent.
void forwardDynamics(rigidBodyModelState &state, const scalarField &tau, const Field< spatialVector > &fx) const
Calculate and optionally relax the joint acceleration qDdot from.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
const spatialTransform & masterXT() const
Return the transform with respect to the master body.