51 rigidBodyMotion& body,
55 rigidBodySolver(body),
56 aoc_(
dict.getOrDefault<scalar>(
"aoc", 0.5)),
57 voc_(
dict.getOrDefault<scalar>(
"voc", 0.5))
78 model_.applyRestraints(rtau, rfx, state());
81 model_.forwardDynamics(state(), rtau, rfx);
84 qDot() = qDot0() + deltaT()*(aoc_*qDdot() + (1 - aoc_)*qDdot0());
87 q() = q0() + deltaT()*(voc_*qDot() + (1 - voc_)*qDot0());
89 correctQuaternionJoints();
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Six degree of freedom motion for a rigid body.
void correctQuaternionJoints()
Correct the quaternion joints based on the current change in q.
rigidBodyMotion & model_
The rigid-body model.
scalarField & qDot()
Return the current joint quaternion.
const scalarField & qDot0() const
Return the current joint quaternion.
rigidBodyModelState & state()
Return the motion state.
scalar deltaT() const
Return the current time-step.
rigidBodySolver(rigidBodyMotion &body)
const scalarField & q0() const
Return the current joint position and orientation.
const scalarField & qDdot0() const
Return the current joint acceleration.
scalarField & q()
Return the current joint position and orientation.
scalarField & qDdot()
Return the current joint acceleration.
Crank-Nicolson 2nd-order time-integrator for 6DoF solid-body motion.
virtual void solve(const scalarField &tau, const Field< spatialVector > &fx)
Integrate the rigid-body motion for one time-step.
virtual ~CrankNicolson()
Destructor.
CrankNicolson(rigidBodyMotion &body, const dictionary &dict)
Construct for the given body from dictionary.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.