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_;
Six degree of freedom motion for a rigid body.
bool report() const
Return the report Switch.
point velocity(const point &pt) const
Return the velocity of a position.
A list of keyword definitions, which are a keyword followed by any number of values (e...
virtual void write(Ostream &) const
Write.
virtual void restrain(const sixDoFRigidBodyMotion &motion, vector &restraintPosition, vector &restraintForce, vector &restraintMoment) const
Calculate the restraint position, force and moment.
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.
linearSpring(const word &name, const dictionary &sDoFRBMRDict)
Construct from components.
Macros for easy insertion into run-time selection tables.
point transform(const point &initialPoints) const
Transform the given initial state point by the current motion.
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.
defineTypeNameAndDebug(linearAxialAngularSpring, 0)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
addToRunTimeSelectionTable(sixDoFRigidBodyMotionRestraint, linearAxialAngularSpring, dictionary)
dimensioned< scalar > mag(const dimensioned< Type > &)