95 #ifndef lumpedPointMovement_H 96 #define lumpedPointMovement_H 125 class 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();
const word & inputName() const
The input (state) file name.
Encapsulates the logic for coordinating between OpenFOAM and an external application.
const word & outputName() const
The output (forces) file name.
List< scalar > areas(const polyMesh &pmesh) const
The areas for each pressure-zone.
A class for handling file names.
tmp< pointField > pointsPosition(const lumpedPointState &state, const pointPatch &fpatch, const pointField &points0) const
The points absolute position according to specified state.
inputFormatType
Input format types.
void writeStateVTP(const lumpedPointState &state, const fileName &file) const
Write state as VTK PolyData format.
pointField points0(pointIOField(IOobject("points", mesh.time().constant(), polyMesh::meshSubDir, mesh, IOobject::MUST_READ, IOobject::NO_WRITE, false)))
void setInterpolator(const pointPatch &fpatch, const pointField &points0)
Check if patch control exists for specified patch.
static const Enum< outputFormatType > formatNames
Names for the output format types.
bool hasMapping() const
True if the pressure-zones mapping has already been performed.
quaternion::eulerOrder rotationOrder() const
The Euler-angle rotation order.
void couplingCompleted(const label timeIndex) const
Register that coupling is completed at this calcFrequency.
void readDict(const dictionary &dict)
Update settings from dictionary.
void writeZonesVTP(const fileName &file, const polyMesh &mesh, const pointField &points0) const
Write pressure-zones geometry, write as VTK PolyData format.
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 scalePoints(lumpedPointState &state) const
Scale the lumped points (on input).
lumpedPointMovement::outputFormatType outputFormat() const
The output (forces) file format.
void setPatchControl(const polyPatch &pp, const wordList &ctrlNames, const pointField &points0)
Define pressure-zones mapping for faces in the specified patches.
static const Enum< scalingType > scalingNames
Names for the scaling types.
scalingType
Output format types.
virtual ~lumpedPointMovement()=default
Destructor.
static const word canonicalName
The canonical name ("lumpedPointMovement") for the dictionary.
label ownerId() const
An owner Id, if needed for bookkeeping purposes.
lumpedPointState::inputFormatType inputFormat() const
The input (state) file format.
bool degrees() const
Rotation angles in degrees.
const word & logName() const
The log file name.
A class for handling words, derived from Foam::string.
bool forcesAndMoments(const polyMesh &pmesh, List< vector > &forces, List< vector > &moments) const
The forces and moments acting on each pressure-zone.
const externalFileCoupler & coupler() const
Communication control.
bool hasInterpolator(const pointPatch &fpatch) const
Check if patch control exists for specified patch.
outputFormatType
Output format types.
scalar relax() const
The relaxation factor when changing states.
void writeVTP(const fileName &file, const polyMesh &mesh, const pointField &points0) const
Write displaced geometry according to the current state,.
eulerOrder
Euler-angle rotation order.
bool empty() const
If no number of lumped points (locations) were specified.
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...
"dictionary" is the OpenFOAM dictionary format
tmp< pointField > pointsDisplacement(const pointPatch &fpatch, const pointField &points0) const
Displace points according to the current state.
OBJstream os(runTime.globalPath()/outputName)
bool readState()
Read state from file, applying relaxation as requested.
void writeDict(Ostream &os) const
Write axis, locations, division as a dictionary.
void writeForcesAndMomentsVTP(const fileName &file, const UList< vector > &forces, const UList< vector > &moments) const
Write forces on points as VTK PolyData format.
Specialisations of Field<T> for scalar, vector and tensor.
void checkPatchControl(const polyPatch &pp) const
Check if patch control exists for specified patch.
List< word > wordList
A List of words.
bool couplingPending(const label timeIndex) const
Check if coupling is pending (according to the calcFrequency)
vector point
Point is a vector.
const lumpedPointState & state() const
The current state (positions/rotations)
const point & origin() const
The offset for lumped points, used on input.
Basic pointPatch represents a set of points from the mesh.
static int debug
Debug switch.
const lumpedPointState & state0() const
The initial state (positions/rotations)
void setMapping(const polyMesh &mesh, const labelUList &patchIds, const pointField &points0)
Define pressure-zones mapping for faces in the specified patches.
Mesh consisting of general polyhedral cells.
List< label > labelList
A List of labels.
A class for managing temporary objects.
"plain" is a simple ASCII format
A patch is a list of labels that address the faces in the global face list.
bool hasPatchControl(const label patchIndex) const
Check if patch control exists for specified patch.
label size() const
The number of lumped points (number of locations)
lumpedPointMovement()
Default construct.
The state of lumped points corresponds to positions and rotations.