81 point attachmentPt = bodyPoint(refAttachmentPt_);
84 vector r = attachmentPt - anchor_;
89 vector v = bodyPointVelocity(refAttachmentPt_).l();
94 (allowSlack_ && magR < restLength_)
96 : (-stiffness_*(magR - restLength_) - damping_*(r & v))*r
99 vector moment(attachmentPt ^ force);
103 Info<<
" attachmentPt " << attachmentPt
104 <<
" attachmentPt - anchor " << r*magR
105 <<
" spring length " << magR
106 <<
" allow slack " << allowSlack_
107 <<
" force " << force
108 <<
" moment " << moment
124 coeffs_.lookup(
"anchor") >> anchor_;
125 coeffs_.lookup(
"refAttachmentPt") >> refAttachmentPt_;
126 coeffs_.lookup(
"stiffness") >> stiffness_;
127 coeffs_.lookup(
"damping") >> damping_;
128 coeffs_.lookup(
"restLength") >> restLength_;
129 allowSlack_ = coeffs_.lookupOrDefault<
Switch>(
"allowSlack",
false);
144 writeEntry(os,
"refAttachmentPt", refAttachmentPt_);
Macros for easy insertion into run-time selection tables.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Base class for defining restraints for rigid-body dynamics.
virtual bool read(const dictionary &dict)
Update properties from given dictionary.
virtual void write(Ostream &) const =0
Write.
virtual void write(Ostream &) const
Write.
virtual bool read(const dictionary &dict)
Update properties from given dictionary.
virtual void restrain(scalarField &tau, Field< spatialVector > &fx, const rigidBodyModelState &state) const
Accumulate the retraint internal joint forces into the tau field and.
virtual ~linearSpring()
Destructor.
linearSpring(const word &name, const dictionary &dict, const rigidBodyModel &model)
Construct from components.
Holds the motion state of rigid-body model.
Basic rigid-body model representing a system of rigid-bodies connected by 1-6 DoF joints.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
A list of keyword definitions, which are a keyword followed by any number of values (e....
A class for handling words, derived from string.
addToRunTimeSelectionTable(restraint, externalForce, dictionary)
defineTypeNameAndDebug(externalForce, 0)
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
SpatialVector< scalar > spatialVector
SpatialVector of scalars.
dimensioned< scalar > mag(const dimensioned< Type > &)