36 namespace sixDoFRigidBodyMotionRestraints
42 sixDoFRigidBodyMotionRestraint,
85 restraintPosition = motion.
transform(refAttachmentPt_);
87 vector r = restraintPosition - anchor_;
94 restraintForce = -stiffness_*(magR - restLength_)*r - damping_*(r & v)*r;
96 restraintMoment =
Zero;
100 Info<<
" attachmentPt - anchor " << r*magR
101 <<
" spring length " << magR
102 <<
" force " << restraintForce
115 sDoFRBMRCoeffs_.readEntry(
"anchor", anchor_);
116 sDoFRBMRCoeffs_.readEntry(
"refAttachmentPt", refAttachmentPt_);
117 sDoFRBMRCoeffs_.readEntry(
"stiffness", stiffness_);
118 sDoFRBMRCoeffs_.readEntry(
"damping", damping_);
119 sDoFRBMRCoeffs_.readEntry(
"restLength", restLength_);
130 os.writeEntry(
"anchor", anchor_);
131 os.writeEntry(
"refAttachmentPt", refAttachmentPt_);
132 os.writeEntry(
"stiffness", stiffness_);
133 os.writeEntry(
"damping", damping_);
134 os.writeEntry(
"restLength", restLength_);
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.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
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.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
A class for handling words, derived from Foam::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...
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
OBJstream os(runTime.globalPath()/outputName)
addToRunTimeSelectionTable(sixDoFRigidBodyMotionRestraint, linearAxialAngularSpring, dictionary)
point velocity(const point &pt) const
Return the velocity of a position.
messageStream Info
Information stream (stdout output on master, null elsewhere)
static constexpr const zero Zero
Global zero (0)