82 auto* ctorPtr = dictionaryConstructorTable(bodyType);
91 *dictionaryConstructorTablePtr_
125 os.writeEntry(
"type",
type());
126 os.writeEntry(
"mass", m());
127 os.writeEntry(
"centreOfMass", c());
128 os.writeEntry(
"inertia", Ic());
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
const vector & c() const
Return the centre of mass of the rigid-body.
scalar m() const
Return the mass of the rigid-body.
const symmTensor & Ic() const
Return the inertia tensor of the rigid-body about the centre of mass.
static autoPtr< rigidBody > New(const word &name, const scalar &m, const vector &c, const symmTensor &Ic)
Select constructed from components.
virtual void write(Ostream &) const
Write.
virtual bool massless() const
Return false as this body is not massless.
void merge(const subBody &)
Merge a body into this parent body.
rigidBody(const word &name, const scalar &m, const vector &c, const symmTensor &Ic)
Construct from mass, centre of mass and moment of inertia tensor.
virtual ~rigidBody()
Destructor.
virtual autoPtr< rigidBody > clone() const
Return clone of this rigidBody.
const word & name() const
Return name.
const spatialTransform & masterXT() const
Return the transform with respect to the master body.
const rigidBody & body() const
Return the original body from which this sub-body was constructed.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
OBJstream os(runTime.globalPath()/outputName)
rigidBodyInertia transform(const spatialTransform &X, const rigidBodyInertia &I)
Return (^BX_A)^* I ^AX_B.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
SymmTensor< scalar > symmTensor
SymmTensor of scalars, i.e. SymmTensor<scalar>.
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.