89 for(
label i = 0; i < model_.joints()[
lambda].nDoF(); ++ i)
91 const scalar q = state.
q()[parent.qIndex() + i];
92 const scalar qDot = state.
qDot()[parent.qIndex() + i];
93 const scalar qDdot = state.
qDdot()[parent.qIndex() + i];
95 const scalar
f = f_->value(q);
96 const scalar fMinusDf = f_->value(q - delta_/2);
97 const scalar fPlusDf = f_->value(q + delta_/2);
98 const scalar dfdq = (fPlusDf - fMinusDf)/delta_;
99 const scalar d2fdq2 = (fPlusDf - 2*f + fMinusDf)/
sqr(delta_);
105 c += (dfdq*qDdot + d2fdq2*
sqr(qDot))*s;
108 const scalar magW =
mag(
x.w());
Abstract base-class for all rigid-body joints.
Run-time selectable general function of one variable.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual autoPtr< joint > clone() const
Clone this joint.
dimensionedScalar lambda(laminarTransport.lookup("lambda"))
A list of keyword definitions, which are a keyword followed by any number of values (e...
spatialVector v
The constrained joint velocity.
spatialVector S1
The joint motion sub-space (1-DoF)
compactSpatialTensor S
The joint motion sub-space (3-DoF)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
defineTypeNameAndDebug(composite, 0)
addToRunTimeSelectionTable(joint, composite, dictionary)
virtual ~function()
Destructor.
spatialVector c
The constrained joint acceleration correction.
const dimensionedScalar c
Speed of light in a vacuum.
Macros for easy insertion into run-time selection tables.
Holds the motion state of rigid-body model.
Joint state returned by jcalc.
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))
const scalarField & q() const
Return access to the joint position and orientation.
const scalarField & qDot() const
Return access to the joint velocity.
virtual void jcalc(joint::XSvc &J, const rigidBodyModelState &state) const
Update the model state for this joint.
Quaternion class used to perform rotations in 3D space.
const List< spatialVector > & S() const
Return the joint motion sub-space.
spatialTransform X
The joint transformation.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
#define R(A, B, C, D, E, F, K, M)
dimensioned< scalar > mag(const dimensioned< Type > &)
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Basic rigid-body model representing a system of rigid-bodies connected by 1-6 DoF joints...
const scalarField & qDdot() const
Return access to the joint acceleration.
function(const rigidBodyModel &model, const dictionary &dict)
Construct for given model from dictionary.