34 namespace sixDoFRigidBodyMotionRestraints
40 sixDoFRigidBodyMotionRestraint,
83 restraintPosition = motion.
transform(refAttachmentPt_);
85 vector r = restraintPosition - anchor_;
92 restraintForce = -stiffness_*(magR - restLength_)*r - damping_*(r & v)*r;
94 restraintMoment =
Zero;
98 Info<<
" attachmentPt - anchor " << r*magR
99 <<
" spring length " << magR
100 <<
" force " << restraintForce
113 sDoFRBMRCoeffs_.lookup(
"anchor") >> anchor_;
114 sDoFRBMRCoeffs_.lookup(
"refAttachmentPt") >> refAttachmentPt_;
115 sDoFRBMRCoeffs_.lookup(
"stiffness") >> stiffness_;
116 sDoFRBMRCoeffs_.lookup(
"damping") >> damping_;
117 sDoFRBMRCoeffs_.lookup(
"restLength") >> restLength_;
130 writeEntry(os,
"refAttachmentPt", refAttachmentPt_);
Six degree of freedom motion for a rigid body.
bool report() const
Return the report Switch.
virtual void restrain(const sixDoFRigidBodyMotion &motion, vector &restraintPosition, vector &restraintForce, vector &restraintMoment) const
Calculate the restraint position, force and moment.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Base class for defining restraints for sixDoF motions.
virtual bool read(const dictionary &sDoFRBMRCoeff)
Update properties from given dictionary.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual ~linearSpring()
Destructor.
point transform(const point &initialPoints) const
Transform the given initial state point by the current motion.
linearSpring(const word &name, const dictionary &sDoFRBMRDict)
Construct from components.
Macros for easy insertion into run-time selection tables.
virtual void write(Ostream &) const
Write.
defineTypeNameAndDebug(axialAngularSpring, 0)
addToRunTimeSelectionTable(sixDoFRigidBodyMotionRestraint, axialAngularSpring, dictionary)
bool read(const char *, int32_t &)
A class for handling words, derived from string.
virtual bool read(const dictionary &sDoFRBMRDict)
Update properties from given dictionary.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
point velocity(const point &pt) const
Return the velocity of a position.
dimensioned< scalar > mag(const dimensioned< Type > &)