51 rigidBodyMotion& body,
55 rigidBodySolver(body),
56 gamma_(
dict.getOrDefault<scalar>(
"gamma", 0.5)),
61 0.25*
sqr(gamma_ + 0.5),
62 dict.getOrDefault<scalar>(
"beta", 0.25)
85 model_.applyRestraints(rtau, rfx, state());
88 model_.forwardDynamics(state(), rtau, rfx);
92 + deltaT()*(gamma_*qDdot() + (1 - gamma_)*qDdot0());
97 +
sqr(deltaT())*(beta_*qDdot() + (0.5 - beta_)*qDdot0());
99 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.
Newmark 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 ~Newmark()
Destructor.
Newmark(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.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.