95#ifndef lumpedPointMovement_H
96#define lumpedPointMovement_H
125class lumpedPointMovement
165 List<lumpedPointInterpolator> interp_;
175 lumpedPointState state0_;
179 lumpedPointState state_;
185 HashPtrTable<lumpedPointController> controllers_;
188 Map<patchControl> patchControls_;
197 dictionary forcesDict_;
200 externalFileCoupler coupler_;
214 FixedList<scalar, 1> scaleInput_;
215 FixedList<scalar, 3> scaleOutput_;
218 label calcFrequency_;
221 mutable label lastTrigger_;
264 inline bool empty()
const;
267 inline label
size()
const;
300 inline scalar
relax()
const;
303 inline scalar&
relax();
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
A 1D vector of objects of type <T> with a fixed length <N>.
A HashTable of pointers to objects of type <T>, with deallocation management of the pointers.
A HashTable to objects of type <T> with a label key.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Encapsulates the logic for coordinating between OpenFOAM and an external application.
A class for handling file names.
The movement driver that describes initial point locations, the current state of the points/rotations...
void writeForcesAndMomentsVTP(const fileName &file, const UList< vector > &forces, const UList< vector > &moments) const
Write forces on points as VTK PolyData format.
const word & outputName() const
The output (forces) file name.
void writeStateVTP(const lumpedPointState &state, const fileName &file) const
Write state as VTK PolyData format.
bool hasPatchControl(const label patchIndex) const
Check if patch control exists for specified patch.
void scalePoints(lumpedPointState &state) const
Scale the lumped points (on input).
static const word canonicalName
The canonical name ("lumpedPointMovement") for the dictionary.
scalar relax() const
The relaxation factor when changing states.
tmp< pointField > pointsDisplacement(const pointPatch &fpatch, const pointField &points0) const
Displace points according to the current state.
bool degrees() const
Rotation angles in degrees.
static const Enum< outputFormatType > formatNames
Names for the output format types.
tmp< pointField > pointsDisplacement(const lumpedPointState &state, const pointPatch &fpatch, const pointField &points0) const
Displace points according to specified state.
const word & logName() const
The log file name.
label size() const
The number of lumped points (number of locations)
lumpedPointMovement::outputFormatType outputFormat() const
The output (forces) file format.
const lumpedPointState & state() const
The current state (positions/rotations)
bool empty() const
If no number of lumped points (locations) were specified.
tmp< pointField > pointsPosition(const lumpedPointState &state, const pointPatch &fpatch, const pointField &points0) const
The points absolute position according to specified state.
void readDict(const dictionary &dict)
Update settings from dictionary.
void setInterpolator(const pointPatch &fpatch, const pointField &points0)
Check if patch control exists for specified patch.
void setPatchControl(const polyPatch &pp, const wordList &ctrlNames, const pointField &points0)
Define pressure-zones mapping for faces in the specified patches.
bool readState()
Read state from file, applying relaxation as requested.
quaternion::eulerOrder rotationOrder() const
The Euler-angle rotation order.
void couplingCompleted(const label timeIndex) const
Register that coupling is completed at this calcFrequency.
bool couplingPending(const label timeIndex) const
Check if coupling is pending (according to the calcFrequency)
bool writeData(const UList< vector > &forces, const UList< vector > &moments=List< vector >(), const Tuple2< scalar, scalar > *timesWritten=nullptr) const
Write points, forces, moments.
label ownerId() const
An owner Id, if needed for bookkeeping purposes.
static const Enum< scalingType > scalingNames
Names for the scaling types.
const word & inputName() const
The input (state) file name.
bool hasMapping() const
True if the pressure-zones mapping has already been performed.
void checkPatchControl(const polyPatch &pp) const
Check if patch control exists for specified patch.
outputFormatType
Output format types.
@ DICTIONARY
"dictionary" is the OpenFOAM dictionary format
@ PLAIN
"plain" is a simple ASCII format
lumpedPointState::inputFormatType inputFormat() const
The input (state) file format.
const externalFileCoupler & coupler() const
Communication control.
void setMapping(const polyMesh &mesh, const labelUList &patchIds, const pointField &points0)
Define pressure-zones mapping for faces in the specified patches.
const lumpedPointState & state0() const
The initial state (positions/rotations)
bool writeData(Ostream &os, const UList< vector > &forces, const UList< vector > &moments, const outputFormatType fmt=outputFormatType::PLAIN, const Tuple2< scalar, scalar > *timesWritten=nullptr) const
Write points, forces, moments. Only call from the master process.
void writeDict(Ostream &os) const
Write axis, locations, division as a dictionary.
static int debug
Debug switch.
virtual ~lumpedPointMovement()=default
Destructor.
void writeZonesVTP(const fileName &file, const polyMesh &mesh, const pointField &points0) const
Write pressure-zones geometry, write as VTK PolyData format.
bool hasInterpolator(const pointPatch &fpatch) const
Check if patch control exists for specified patch.
lumpedPointMovement()
Default construct.
const point & origin() const
The offset for lumped points, used on input.
lumpedPointMovement(const dictionary &dict, label ownerId=-1)
Construct from dictionary, optionally with some owner information.
bool forcesAndMoments(const polyMesh &pmesh, List< vector > &forces, List< vector > &moments) const
The forces and moments acting on each pressure-zone.
scalingType
Output format types.
@ FORCE
The "force" scaling.
@ LENGTH
The "length" scaling.
@ MOMENT
The "moment" scaling.
bool hasPatchControl(const polyPatch &pp) const
Check if patch control exists for specified patch.
List< scalar > areas(const polyMesh &pmesh) const
The areas for each pressure-zone.
void writeVTP(const fileName &file, const polyMesh &mesh, const pointField &points0) const
Write displaced geometry according to the current state,.
The state of lumped points corresponds to positions and rotations.
inputFormatType
Input format types.
Basic pointPatch represents a set of points from the mesh.
Mesh consisting of general polyhedral cells.
A patch is a list of labels that address the faces in the global face list.
eulerOrder
Euler-angle rotation order.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
List< word > wordList
A List of words.
List< label > labelList
A List of labels.
vector point
Point is a vector.
Specialisations of Field<T> for scalar, vector and tensor.
pointField points0(pointIOField(IOobject("points", mesh.time().constant(), polyMesh::meshSubDir, mesh, IOobject::MUST_READ, IOobject::NO_WRITE, false)))