37 dict.readEntry(
"mass", mass_);
38 dict.readEntry(
"momentOfInertia", momentOfInertia_);
39 aRelax_ =
dict.getOrDefault<scalar>(
"accelerationRelaxation", 1);
40 aDamp_ =
dict.getOrDefault<scalar>(
"accelerationDamping", 1);
41 report_ =
dict.getOrDefault<
Switch>(
"report",
false);
42 updateConstraints_ =
dict.getOrDefault(
"updateConstraints",
false);
56 motionState_.write(
os);
58 os.writeEntry(
"centreOfMass", initialCentreOfMass_);
59 os.writeEntry(
"initialOrientation", initialQ_);
60 os.writeEntry(
"mass", mass_);
61 os.writeEntry(
"momentOfInertia", momentOfInertia_);
62 os.writeEntry(
"accelerationRelaxation", aRelax_);
63 os.writeEntry(
"accelerationDamping", aDamp_);
64 os.writeEntry(
"report", report_);
65 os.writeEntry(
"updateConstraints", updateConstraints_);
67 if (!restraints_.empty())
69 os.beginBlock(
"restraints");
73 const word& restraintType(restraints_[rI].
type());
75 os.beginBlock(restraints_[rI].
name());
77 os.writeEntry(
"sixDoFRigidBodyMotionRestraint", restraintType);
79 restraints_[rI].write(
os);
87 if (!constraints_.empty())
93 const word& constraintType(constraints_[rI].
type());
97 os.
writeEntry(
"sixDoFRigidBodyMotionConstraint", constraintType);
99 constraints_[rI].sixDoFRigidBodyMotionConstraint::write(
os);
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual Ostream & endBlock()
Write end block group.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
virtual Ostream & beginBlock(const keyType &kw)
Write begin block group with the given name.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
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 a number of values (eg,...
void addConstraints(const dictionary &dict)
Add restraints to the motion, public to allow external.
void write(Ostream &) const
Write.
bool read(const dictionary &dict)
Read coefficients dictionary and update system parameters,.
void addRestraints(const dictionary &dict)
Add restraints to the motion, public to allow external.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Ostream & indent(Ostream &os)
Indent stream.
#define forAll(list, i)
Loop across all elements in list.