61 const rigidBodyModel& model
65 externalForce_(nullptr),
87 const vector force = externalForce_().value(state.
t());
88 const vector moment(location_ ^ force);
92 Info<<
" location " << location_
94 <<
" moment " << moment
110 coeffs_.readEntry(
"location", location_);
112 externalForce_ = Function1<vector>::New(
"force",
coeffs_, &
model_.time());
125 os.writeEntry(
"location", location_);
127 externalForce_().writeData(
os);
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Base class for defining restraints for rigid-body dynamics.
restraint(const word &name, const dictionary &dict, const rigidBodyModel &model)
Construct from the dict dictionary and Time.
const word & name() const
Return the name.
label bodyIndex_
Index of the body the force is applied to.
virtual bool read(const dictionary &dict)
Update properties from given dictionary.
dictionary coeffs_
Restraint model specific coefficient dictionary.
virtual void write(Ostream &) const =0
Write.
const rigidBodyModel & model_
Reference to the model.
Time-dependent external force restraint using Function1.
virtual void write(Ostream &) const
Write.
virtual bool read(const dictionary &dict)
Update properties from given dictionary.
virtual void restrain(scalarField &tau, Field< spatialVector > &fx, const rigidBodyModelState &state) const
Accumulate the retraint internal joint forces into the tau field and.
externalForce(const word &name, const dictionary &dict, const rigidBodyModel &model)
Construct from components.
virtual ~externalForce()
Destructor.
Holds the motion state of rigid-body model.
scalar t() const
Return access to the time.
Basic rigid-body model representing a system of rigid-bodies connected by 1-6 DoF joints.
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.
OBJstream os(runTime.globalPath()/outputName)
Namespace for rigid-body dynamics restraints.
SpatialVector< scalar > spatialVector
SpatialVector of scalars.
messageStream Info
Information stream (stdout output on master, null elsewhere).
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static constexpr const zero Zero
Global zero (0).
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.