32 void Foam::RBD::rigidBodyMotion::initialize()
62 motionState_(*
this, dict),
63 motionState0_(motionState_),
86 motionState_(*
this, stateDict),
87 motionState0_(motionState_),
137 state.
qDdot() = aDamp_*(aRelax_*state.
qDdot() + (1 - aRelax_)*qDdotPrev);
148 motionState_.
deltaT() = deltaT;
150 if (motionState0_.
deltaT() < SMALL)
152 motionState0_.
deltaT() = deltaT;
157 solver_->solve(tau, fx);
172 Info<<
"Rigid-body motion of the " <<
name(bodyID) <<
nl 173 <<
" Centre of rotation: " << CofR.
r() <<
nl 174 <<
" Orientation: " << CofR.
E() <<
nl 175 <<
" Linear velocity: " << vCofR.
l() <<
nl 176 <<
" Angular velocity: " << vCofR.
w()
224 if (weight[i] > SMALL)
227 if (weight[i] > 1 - SMALL)
236 .transformPoint(initialPoints[i]);
257 const label bodyID = bodyIDs[bi];
279 w[bi] = (*(weights[bi]))[i];
280 sum1mw += w[bi]/(1 + SMALL - w[bi]);
290 w[bi] = lambda*w[bi]/(1 + SMALL - w[bi]);
295 w[bodyIDs.
size()] = 1 - sumw;
297 points[i] =
average(ss, w).transformPoint(initialPoints[i]);
static autoPtr< rigidBodySolver > New(rigidBodyMotion &body, const dictionary &dict)
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void forwardDynamics(rigidBodyModelState &state, const scalarField &tau, const Field< spatialVector > &fx) const
Calculate the joint acceleration qDdot from the joint state q,.
DynamicList< spatialTransform > X0_
Transform for external forces to the bodies reference frame.
Vector< Cmpt > l() const
Return the linear part of the spatial vector as a vector.
A list of keyword definitions, which are a keyword followed by any number of values (e...
const subBody & mergedBody(label mergedBodyID) const
Return the merged body for the given body ID.
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
void status(const label bodyID) const
Report the status of the motion of the given body.
void size(const label)
Override size to be inconsistent with allocated storage.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
const DynamicList< label > & lambda() const
List of indices of the parent of each body.
label masterID() const
Return the master body Id.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool merged(label bodyID) const
Return true if the body with given ID has been merged with a parent.
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.
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.
Septernion class used to perform translations and rotations in 3D space.
Holds the motion state of rigid-body model.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
vectorField pointField
pointField is a vectorField.
const spatialVector & v(const label i) const
Return the spatial velocity of the bodies.
spatialTransform X0(const label bodyId) const
Return the current transform to the global frame for the given body.
void solve(scalar deltaT, const scalarField &tau, const Field< spatialVector > &fx)
Integrate velocities, orientation and position.
const vector & g() const
Return the acceleration due to gravity.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
static const septernion I
void forwardDynamics(rigidBodyModelState &state, const scalarField &tau, const Field< spatialVector > &fx) const
Calculate and optionally relax the joint acceleration qDdot from.
Vector< Cmpt > w() const
Return the angular part of the spatial vector as a vector.
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
tmp< pointField > transformPoints(const label bodyID, const pointField &initialPoints) const
Transform the given initial pointField of the specified body.
rigidBodyMotion()
Construct null.
const spatialTransform & masterXT() const
Return the transform with respect to the master body.
scalar deltaT() const
Return access to the time-step.
quaternion slerp(const quaternion &qa, const quaternion &qb, const scalar t)
Spherical linear interpolation of quaternions.
Basic rigid-body model representing a system of rigid-bodies connected by 1-6 DoF joints...
const word & name(const label bodyID) const
Return the name of body with the given ID.
A class for managing temporary objects.
T & ref() const
Return non-const reference or generate a fatal error.
~rigidBodyMotion()
Destructor.
rigidBodyModel()
Null-constructor which adds the single root-body at the origin.
void forwardDynamicsCorrection(const rigidBodyModelState &state) const
Correct the velocity and acceleration of the bodies in the model.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
const scalarField & qDdot() const
Return access to the joint acceleration.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.