The movement driver that describes initial point locations, the segmentation for pressure integration, the current state of the points/rotations, and forwarding to the externalFileCoupler communication coordinator. More...
Public Types | |
enum | outputFormatType { PLAIN, DICTIONARY } |
Output format types. More... | |
enum | scalingType { LENGTH = 0, FORCE, MOMENT } |
Output format types. More... | |
Public Member Functions | |
lumpedPointMovement () | |
Construct null. More... | |
lumpedPointMovement (const dictionary &dict, label ownerId=-1) | |
Construct from dictionary, optionally with some owner information. More... | |
virtual | ~lumpedPointMovement () |
Destructor. More... | |
void | readDict (const dictionary &dict) |
Update settings from dictionary. More... | |
bool | empty () const |
If no number of lumped points (locations) were specified. More... | |
label | size () const |
The number of lumped points (number of locations) More... | |
const vector & | axis () const |
The normalized reference axis. More... | |
const scalarField & | locations () const |
Read access to the locations. More... | |
scalar | division () const |
The division (0-1) when calculating pressure forces. More... | |
label | ownerId () const |
An owner Id, if needed for bookkeeping purposes. More... | |
void | ownerId (label id) |
Change the owner id, if needed for bookkeeping purposes. More... | |
const scalarField & | thresholds () const |
Threshold locations for pressure forces. More... | |
label | threshold (const point &position) const |
Classify the position to be located in one of the threshold zones. More... | |
const externalFileCoupler & | coupler () const |
Communication control. More... | |
externalFileCoupler & | coupler () |
Communication control. More... | |
const lumpedPointState & | state0 () const |
The initial state (positions/rotations) More... | |
const lumpedPointState & | state () const |
The current state (positions/rotations) More... | |
scalar | relax () const |
The relaxation factor when changing states. More... | |
scalar & | relax () |
The relaxation factor when changing states. More... | |
const word & | inputName () const |
The input (state) file name. More... | |
const word & | outputName () const |
The output (forces) file name. More... | |
const word & | logName () const |
The log file name. More... | |
lumpedPointState::inputFormatType | inputFormat () const |
The input (state) file format. More... | |
lumpedPointMovement::outputFormatType | outputFormat () const |
The output (forces) file format. More... | |
void | setBoundBox (const polyMesh &mesh, const labelUList &patchIds, const pointField &points0) |
Define the bounding-box required to enclose the specified patches. More... | |
void | setMapping (const polyMesh &mesh, const labelUList &patchIds, const pointField &points0) |
Define the pressure-zones mapping for faces in the specified. More... | |
bool | hasMapping () const |
True if the pressure-zones mapping has already been performed. More... | |
const List< labelList > & | zones () const |
Return the pressure-zones mapping with the associated. More... | |
bool | forcesAndMoments (const polyMesh &pmesh, List< vector > &forces, List< vector > &moments) const |
The forces and moments acting on each pressure-zone. More... | |
tmp< pointField > | displacePoints (const pointField &points0, const labelList &pointLabels) const |
Displace points according to the current state. More... | |
tmp< pointField > | displacePoints (const lumpedPointState &state, const pointField &points0, const labelList &pointLabels) const |
Displace points according to specified state. More... | |
const interpolationWeights & | interpolator () const |
Interpolation weights. More... | |
void | writeDict (Ostream &os) const |
Write axis, locations, division as a dictionary. More... | |
bool | writeData (Ostream &os, const UList< vector > &forces, const UList< vector > &moments, const outputFormatType fmt=outputFormatType::PLAIN, const Time *timeinfo=nullptr) const |
Write points, forces, moments. Only call from the master process. More... | |
bool | writeData (const UList< vector > &forces, const UList< vector > &moments=List< vector >(), const Time *timeinfo=nullptr) const |
Write points, forces, moments. More... | |
bool | readState () |
Read state from file, applying relaxation as requested. More... | |
void | writeStateVTP (const fileName &file) const |
Write state as VTK PolyData format. More... | |
void | writeForcesAndMomentsVTP (const fileName &file, const UList< vector > &forces, const UList< vector > &moments) const |
Write forces on points as VTK PolyData format. More... | |
void | writeZonesVTP (const fileName &file, const polyMesh &mesh, const pointField &points0) const |
Write pressure-zones geometry, write as VTK PolyData format. More... | |
void | writeVTP (const fileName &file, const polyMesh &mesh, const labelUList &patchIds, const pointField &points0) const |
Write displaced geometry according to the current state,. More... | |
void | writeVTP (const fileName &file, const lumpedPointState &state, const polyMesh &mesh, const labelUList &patchLst, const pointField &points0) const |
Write displaced geometry according to the specified state,. More... | |
Static Public Member Functions | |
static IOobject | selectIO (const IOobject &io, const fileName &altFile, const word &ioName="") |
Deprecated(2018-08) compatibility method. More... | |
Static Public Attributes | |
static const Enum< outputFormatType > | formatNames |
Names for the output format types. More... | |
static const Enum< scalingType > | scalingNames |
Names for the scaling types. More... | |
static const word | canonicalName |
The canonical name ("lumpedPointMovement") for the dictionary. More... | |
The movement driver that describes initial point locations, the segmentation for pressure integration, the current state of the points/rotations, and forwarding to the externalFileCoupler communication coordinator.
The lumpedPointIOMovement class is simply a registered version of the same.
See externalFileCoupler for more information about some of the communication parameters and setup.
Dictionary parameters
Property | Description | Required | Default |
---|---|---|---|
axis | Reference axis for the locations | yes | |
locations | List of lumped point locations | yes | |
centre | Offset of patch points to locations | no | automatic |
division | Division (0-1) for pressure forces | no | 0 |
relax | Relaxation/scaling for updating positions | no | |
interpolationScheme | The interpolation scheme | yes | |
forces | Optional forces dictionary | no | |
communication | Required communication dictionary | yes |
Parameters for communication dictionary
Property | Description | Required | Default |
---|---|---|---|
inputName | Name of positions input file | yes | |
outputName | Name of forces output file | yes | |
logName | Name of log file | no | movement.log |
inputFormat | Input format: dictionary/plain | yes | |
outputFormat | Output format: dictionary/plain | yes | |
scaleInput | Input scaling parameter dictionary | no | |
scaleOutput | Output scaling parameter dictionary | no |
Parameters for optional communication/scaleInput dictionary
Property | Description | Required | Default |
---|---|---|---|
length | Scaling for input positions | no | 1 |
Parameters for optional communication/scaleOutput dictionary
Property | Description | Required | Default |
---|---|---|---|
length | Scaling for output positions | no | 1 |
force | Scaling for force | no | 1 |
moment | Scaling for moment | no | 1 |
Parameters for optional forces dictionary
Property | Description | Required | Default |
---|---|---|---|
p | Name of the pressure field | no | p |
pRef | Reference pressure in Pa | no | 0 |
rhoRef | Reference density for incompressible | no | 1 |
Definition at line 260 of file lumpedPointMovement.H.
|
strong |
Output format types.
Enumerator | |
---|---|
PLAIN | "plain" is a simple ASCII format |
DICTIONARY | "dictionary" is the OpenFOAM dictionary format |
Definition at line 265 of file lumpedPointMovement.H.
enum scalingType |
Output format types.
Enumerator | |
---|---|
LENGTH | The "length" scaling. |
FORCE | The "force" scaling. |
MOMENT | The "moment" scaling. |
Definition at line 272 of file lumpedPointMovement.H.
Construct null.
Definition at line 166 of file lumpedPointMovement.C.
lumpedPointMovement | ( | const dictionary & | dict, |
label | ownerId = -1 |
||
) |
Construct from dictionary, optionally with some owner information.
Definition at line 194 of file lumpedPointMovement.C.
References dict.
|
virtual |
Destructor.
Definition at line 233 of file lumpedPointMovement.C.
References Foam::deleteDemandDrivenData().
void readDict | ( | const dictionary & | dict | ) |
Update settings from dictionary.
Definition at line 241 of file lumpedPointMovement.C.
References Foam::deleteDemandDrivenData(), dict, dictionary::findDict(), lumpedPointState::formatNames, lumpedPointMovement::formatNames, Enum< EnumType >::get(), Foam::Info, Foam::nl, dictionary::readEntry(), dictionary::readIfPresent(), dictionary::subDict(), and dictionary::subOrEmptyDict().
|
inline |
If no number of lumped points (locations) were specified.
Definition at line 28 of file lumpedPointMovementI.H.
|
inline |
The number of lumped points (number of locations)
Definition at line 34 of file lumpedPointMovementI.H.
|
inline |
The normalized reference axis.
Definition at line 40 of file lumpedPointMovementI.H.
Referenced by lumpedPointMovement::writeStateVTP().
|
inline |
Read access to the locations.
Definition at line 46 of file lumpedPointMovementI.H.
|
inline |
The division (0-1) when calculating pressure forces.
Definition at line 52 of file lumpedPointMovementI.H.
|
inline |
An owner Id, if needed for bookkeeping purposes.
Definition at line 58 of file lumpedPointMovementI.H.
Referenced by lumpedPointDisplacementPointPatchVectorField::~lumpedPointDisplacementPointPatchVectorField().
|
inline |
Change the owner id, if needed for bookkeeping purposes.
Definition at line 64 of file lumpedPointMovementI.H.
|
inline |
Threshold locations for pressure forces.
Definition at line 70 of file lumpedPointMovementI.H.
|
inline |
Classify the position to be located in one of the threshold zones.
Definition at line 82 of file lumpedPointMovementI.H.
|
inline |
Communication control.
Definition at line 89 of file lumpedPointMovementI.H.
|
inline |
Communication control.
Definition at line 95 of file lumpedPointMovementI.H.
|
inline |
The initial state (positions/rotations)
Definition at line 102 of file lumpedPointMovementI.H.
|
inline |
The current state (positions/rotations)
Definition at line 108 of file lumpedPointMovementI.H.
Referenced by lumpedPointMovement::writeStateVTP().
|
inline |
The relaxation factor when changing states.
Definition at line 114 of file lumpedPointMovementI.H.
|
inline |
The relaxation factor when changing states.
Definition at line 120 of file lumpedPointMovementI.H.
|
inline |
The input (state) file name.
Definition at line 126 of file lumpedPointMovementI.H.
|
inline |
The output (forces) file name.
Definition at line 132 of file lumpedPointMovementI.H.
|
inline |
The log file name.
Definition at line 138 of file lumpedPointMovementI.H.
|
inline |
The input (state) file format.
Definition at line 145 of file lumpedPointMovementI.H.
|
inline |
The output (forces) file format.
Definition at line 152 of file lumpedPointMovementI.H.
void setBoundBox | ( | const polyMesh & | mesh, |
const labelUList & | patchIds, | ||
const pointField & | points0 | ||
) |
Define the bounding-box required to enclose the specified patches.
Calculates the centre as required.
mesh | The volume mesh reference |
patchIds | The patch ids to be included in the bounding box. |
points0 | The initial mesh points, prior to movement |
Definition at line 338 of file lumpedPointMovement.C.
References polyMesh::boundaryMesh(), Foam::expressions::patchExpr::debug, Foam::endl(), boundBox::invertedBox, mesh, patches, patchId(), patchIds, points0(), and Foam::Pout.
void setMapping | ( | const polyMesh & | mesh, |
const labelUList & | patchIds, | ||
const pointField & | points0 | ||
) |
Define the pressure-zones mapping for faces in the specified.
patches. The face centres are compared to the threshold positions, which are determined by locations along the defined axis.
mesh | The volume mesh reference |
patchIds | The patch ids to be included in the mapping |
points0 | The initial mesh points, prior to movement |
Definition at line 377 of file lumpedPointMovement.C.
References polyMesh::boundaryMesh(), Foam::expressions::patchExpr::debug, Foam::endl(), f(), polyMesh::faces(), forAll, mesh, n, primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), Foam::nl, patches, patchId(), patchIds, points0(), Foam::Pout, Foam::returnReduce(), List< T >::setSize(), polyPatch::start(), and Foam::Zero.
|
inline |
True if the pressure-zones mapping has already been performed.
Definition at line 158 of file lumpedPointMovementI.H.
|
inline |
Return the pressure-zones mapping with the associated.
patch face ids.
Definition at line 165 of file lumpedPointMovementI.H.
bool forcesAndMoments | ( | const polyMesh & | pmesh, |
List< vector > & | forces, | ||
List< vector > & | moments | ||
) | const |
The forces and moments acting on each pressure-zone.
The zones must be previously defined via setMapping.
Definition at line 457 of file lumpedPointMovement.C.
References GeometricField< Type, PatchField, GeoMesh >::boundaryField(), polyMesh::boundaryMesh(), fvMesh::Cf(), Foam::dimPressure, Foam::endl(), objectRegistry::findObject(), forAll, Foam::Info, Pstream::listCombineGather(), Pstream::listCombineScatter(), mesh, Foam::nl, p, patches, List< T >::setSize(), fvMesh::Sf(), polyBoundaryMesh::start(), WarningInFunction, polyBoundaryMesh::whichPatch(), and Foam::Zero.
Foam::tmp< Foam::pointField > displacePoints | ( | const pointField & | points0, |
const labelList & | pointLabels | ||
) | const |
Displace points according to the current state.
Definition at line 610 of file lumpedPointMovement.C.
References pointLabels(), and points0().
Foam::tmp< Foam::pointField > displacePoints | ( | const lumpedPointState & | state, |
const pointField & | points0, | ||
const labelList & | pointLabels | ||
) | const |
Displace points according to specified state.
Definition at line 621 of file lumpedPointMovement.C.
References forAll, p0, pointLabels(), lumpedPointState::points(), points0(), tmp< T >::ref(), lumpedPointState::rotations(), and interpolationWeights::valueWeights().
const Foam::interpolationWeights & interpolator | ( | ) | const |
Interpolation weights.
Definition at line 885 of file lumpedPointMovement.C.
References interpolationWeights::New().
void writeDict | ( | Ostream & | os | ) | const |
Write axis, locations, division as a dictionary.
Definition at line 678 of file lumpedPointMovement.C.
References Ostream::writeEntry().
Referenced by Foam::operator<<().
bool writeData | ( | Ostream & | os, |
const UList< vector > & | forces, | ||
const UList< vector > & | moments, | ||
const outputFormatType | fmt = outputFormatType::PLAIN , |
||
const Time * | timeinfo = nullptr |
||
) | const |
Write points, forces, moments. Only call from the master process.
Definition at line 706 of file lumpedPointMovement.C.
References forAll, Foam::nl, Foam::pos(), UList< T >::size(), Foam::val, Foam::vtk::writeList(), and VectorSpace< Vector< scalar >, scalar, 3 >::zero.
bool writeData | ( | const UList< vector > & | forces, |
const UList< vector > & | moments = List<vector>() , |
||
const Time * | timeinfo = nullptr |
||
) | const |
Write points, forces, moments.
Definition at line 845 of file lumpedPointMovement.C.
References IOstreamOption::ASCII, IOstreamOption::currentVersion, UPstream::master(), IOstreamOption::UNCOMPRESSED, and Foam::writeData().
bool readState | ( | ) |
Read state from file, applying relaxation as requested.
Definition at line 687 of file lumpedPointMovement.C.
References lumpedPointState::readData().
void writeStateVTP | ( | const fileName & | file | ) | const |
Write state as VTK PolyData format.
Definition at line 37 of file lumpedPointMovementWriter.C.
References lumpedPointMovement::axis(), lumpedPointMovement::state(), and lumpedPointState::writeVTP().
void writeForcesAndMomentsVTP | ( | const fileName & | file, |
const UList< vector > & | forces, | ||
const UList< vector > & | moments | ||
) | const |
Write forces on points as VTK PolyData format.
Definition at line 44 of file lumpedPointMovementWriter.C.
References Foam::vtk::CONNECTIVITY, format(), Foam::vtk::INLINE_ASCII, Foam::vtk::newFormatter(), nPoints, Foam::vtk::NUMBER_OF_POINTS, Foam::vtk::NUMBER_OF_VERTS, Foam::vtk::OFFSETS, Foam::vtk::PIECE, points, Foam::vtk::POINTS, Foam::vtk::POLY_DATA, UList< T >::size(), OFstream::stdStream(), Foam::vtk::VERTS, Foam::vtk::writeIdentity(), and Foam::vtk::writeList().
void writeZonesVTP | ( | const fileName & | file, |
const polyMesh & | mesh, | ||
const pointField & | points0 | ||
) | const |
Write pressure-zones geometry, write as VTK PolyData format.
Definition at line 173 of file lumpedPointMovementWriter.C.
References Foam::vtk::CONNECTIVITY, f(), polyMesh::faces(), forAll, format(), Foam::vtk::INLINE_ASCII, PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), mesh, Foam::vtk::newFormatter(), PrimitivePatch< Face, FaceList, PointField, PointType >::nPoints(), Foam::vtk::NUMBER_OF_POINTS, Foam::vtk::NUMBER_OF_POLYS, Foam::vtk::OFFSETS, Foam::vtk::PIECE, Foam::vtk::POINTS, points0(), Foam::vtk::POLY_DATA, Foam::vtk::POLYS, OFstream::stdStream(), Foam::vtk::write(), and Foam::vtk::writeList().
void writeVTP | ( | const fileName & | file, |
const polyMesh & | mesh, | ||
const labelUList & | patchIds, | ||
const pointField & | points0 | ||
) | const |
Write displaced geometry according to the current state,.
write as VTK PolyData format.
Definition at line 303 of file lumpedPointMovementWriter.C.
References mesh, patchIds, and points0().
void writeVTP | ( | const fileName & | file, |
const lumpedPointState & | state, | ||
const polyMesh & | mesh, | ||
const labelUList & | patchLst, | ||
const pointField & | points0 | ||
) | const |
Write displaced geometry according to the specified state,.
write as VTK PolyData format.
Definition at line 315 of file lumpedPointMovementWriter.C.
References polyMesh::boundaryMesh(), Foam::vtk::CONNECTIVITY, f(), format(), Foam::vtk::INLINE_ASCII, mesh, PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), Foam::vtk::newFormatter(), PrimitivePatch< Face, FaceList, PointField, PointType >::nPoints(), Foam::vtk::NUMBER_OF_POINTS, Foam::vtk::NUMBER_OF_POLYS, Foam::vtk::OFFSETS, patchId(), patchIds, Foam::vtk::PIECE, Foam::vtk::POINTS, points0(), Foam::vtk::POLY_DATA, Foam::vtk::POLYS, OFstream::stdStream(), and Foam::vtk::writeList().
|
inlinestatic |
Deprecated(2018-08) compatibility method.
Definition at line 603 of file lumpedPointMovement.H.
References IOobject::selectIO().
|
static |
Names for the output format types.
Definition at line 282 of file lumpedPointMovement.H.
Referenced by lumpedPointMovement::readDict().
|
static |
Names for the scaling types.
Definition at line 285 of file lumpedPointMovement.H.
|
static |
The canonical name ("lumpedPointMovement") for the dictionary.
Definition at line 378 of file lumpedPointMovement.H.
Referenced by lumpedPointIOMovement::lookupInRegistry(), and lumpedPointIOMovement::New().