The movement driver that describes initial point locations, 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 () | |
Default construct. More... | |
lumpedPointMovement (const dictionary &dict, label ownerId=-1) | |
Construct from dictionary, optionally with some owner information. More... | |
virtual | ~lumpedPointMovement ()=default |
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... | |
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 externalFileCoupler & | coupler () const |
Communication control. More... | |
externalFileCoupler & | coupler () |
Communication control. More... | |
bool | couplingPending (const label timeIndex) const |
Check if coupling is pending (according to the calcFrequency) More... | |
void | couplingCompleted (const label timeIndex) const |
Register that coupling is completed at this calcFrequency. More... | |
const lumpedPointState & | state0 () const |
The initial state (positions/rotations) More... | |
const lumpedPointState & | state () const |
The current state (positions/rotations) More... | |
const point & | origin () const |
The offset for lumped points, used on input. More... | |
void | scalePoints (lumpedPointState &state) const |
Scale the lumped points (on input). 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... | |
quaternion::eulerOrder | rotationOrder () const |
The Euler-angle rotation order. More... | |
bool | degrees () const |
Rotation angles in degrees. More... | |
bool | hasPatchControl (const label patchIndex) const |
Check if patch control exists for specified patch. More... | |
bool | hasPatchControl (const polyPatch &pp) const |
Check if patch control exists for specified patch. More... | |
bool | hasInterpolator (const pointPatch &fpatch) const |
Check if patch control exists for specified patch. More... | |
void | checkPatchControl (const polyPatch &pp) const |
Check if patch control exists for specified patch. More... | |
void | setPatchControl (const polyPatch &pp, const wordList &ctrlNames, const pointField &points0) |
Define pressure-zones mapping for faces in the specified patches. More... | |
void | setMapping (const polyMesh &mesh, const labelUList &patchIds, const pointField &points0) |
Define pressure-zones mapping for faces in the specified patches. More... | |
void | setInterpolator (const pointPatch &fpatch, const pointField &points0) |
Check if patch control exists for specified patch. More... | |
bool | hasMapping () const |
True if the pressure-zones mapping has already been performed. More... | |
bool | hasInterpolator (const label patchIndex) const |
Check if patch interpolator exists for specified patch. More... | |
List< scalar > | areas (const polyMesh &pmesh) const |
The areas for each pressure-zone. 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 > | pointsDisplacement (const pointPatch &fpatch, const pointField &points0) const |
Displace points according to the current state. More... | |
tmp< pointField > | pointsDisplacement (const lumpedPointState &state, const pointPatch &fpatch, const pointField &points0) const |
Displace points according to specified state. More... | |
tmp< pointField > | pointsPosition (const lumpedPointState &state, const pointPatch &fpatch, const pointField &points0) const |
The points absolute position according to specified state. 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 lumpedPointState &state, const fileName &file) const |
Write state as VTK PolyData format. 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 pointField &points0) const |
Write displaced geometry according to the current state,. More... | |
void | writeVTP (const fileName &file, const lumpedPointState &state, const polyMesh &mesh, const pointField &points0) const |
Write displaced geometry according to the specified state,. 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 int | debug |
Debug switch. More... | |
static const word | canonicalName |
The canonical name ("lumpedPointMovement") for the dictionary. More... | |
The movement driver that describes initial point locations, 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 |
---|---|---|---|
points | Initial locations of lumped points | yes | |
pointLabels | The FEA ids for the points | no | |
origin | Shift offset when reading points | no | (0 0 0) |
rotationOrder | The Euler rotation order | no | zxz |
degrees | Input rotations in degrees | no | false |
relax | Relaxation/scaling for updating positions | no | 1 |
controllers | Motion controllers (dictionary) | yes | |
forces | Force settings (dictionary) | no | |
communication | Communication settings (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 | |
calcFrequency | Calculation/coupling frequency | no | 1 |
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 269 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 276 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 283 of file lumpedPointMovement.H.
Default construct.
Definition at line 121 of file lumpedPointMovement.C.
|
explicit |
Construct from dictionary, optionally with some owner information.
Definition at line 146 of file lumpedPointMovement.C.
References dict.
|
virtualdefault |
Destructor.
void readDict | ( | const dictionary & | dict | ) |
Update settings from dictionary.
Definition at line 187 of file lumpedPointMovement.C.
References dict, HashTable< T, Key, Hash >::empty(), Foam::endl(), quaternion::eulerOrderNames, Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, dictionary::findDict(), Foam::flatOutput(), forAllIters, lumpedPointState::formatNames, Enum< EnumType >::get(), dictionary::getOrDefault(), Foam::Info, tmp< T >::New(), Foam::nl, points0(), dictionary::readEntry(), dictionary::readIfPresent(), lumpedPointState::scalePoints(), HashSet< Key, Hash >::set(), HashTable< T, Key, Hash >::sortedToc(), dictionary::subDict(), dictionary::subOrEmptyDict(), Foam::Zero, and MinMax< T >::zero_one().
|
inline |
If no number of lumped points (locations) were specified.
Definition at line 28 of file lumpedPointMovementI.H.
References lumpedPointState::empty().
|
inline |
The number of lumped points (number of locations)
Definition at line 34 of file lumpedPointMovementI.H.
|
inline |
An owner Id, if needed for bookkeeping purposes.
Definition at line 40 of file lumpedPointMovementI.H.
Referenced by lumpedPointDisplacementPointPatchVectorField::~lumpedPointDisplacementPointPatchVectorField().
|
inline |
Change the owner id, if needed for bookkeeping purposes.
Definition at line 46 of file lumpedPointMovementI.H.
|
inline |
Communication control.
Definition at line 69 of file lumpedPointMovementI.H.
|
inline |
Communication control.
Definition at line 75 of file lumpedPointMovementI.H.
bool couplingPending | ( | const label | timeIndex | ) | const |
Check if coupling is pending (according to the calcFrequency)
Definition at line 175 of file lumpedPointMovement.C.
References timeIndex.
void couplingCompleted | ( | const label | timeIndex | ) | const |
Register that coupling is completed at this calcFrequency.
Definition at line 181 of file lumpedPointMovement.C.
References timeIndex.
Referenced by lumpedPointDisplacementPointPatchVectorField::updateCoeffs().
|
inline |
The initial state (positions/rotations)
Definition at line 81 of file lumpedPointMovementI.H.
|
inline |
The current state (positions/rotations)
Definition at line 87 of file lumpedPointMovementI.H.
Referenced by lumpedPointMovement::writeStateVTP().
|
inline |
The offset for lumped points, used on input.
Definition at line 93 of file lumpedPointMovementI.H.
|
inline |
Scale the lumped points (on input).
Definition at line 100 of file lumpedPointMovementI.H.
References lumpedPointState::scalePoints().
|
inline |
The relaxation factor when changing states.
Definition at line 108 of file lumpedPointMovementI.H.
|
inline |
The relaxation factor when changing states.
Definition at line 114 of file lumpedPointMovementI.H.
|
inline |
The input (state) file name.
Definition at line 120 of file lumpedPointMovementI.H.
|
inline |
The output (forces) file name.
Definition at line 126 of file lumpedPointMovementI.H.
|
inline |
The log file name.
Definition at line 132 of file lumpedPointMovementI.H.
|
inline |
The input (state) file format.
Definition at line 139 of file lumpedPointMovementI.H.
|
inline |
The output (forces) file format.
Definition at line 146 of file lumpedPointMovementI.H.
|
inline |
The Euler-angle rotation order.
Definition at line 153 of file lumpedPointMovementI.H.
|
inline |
Rotation angles in degrees.
Definition at line 159 of file lumpedPointMovementI.H.
|
inline |
Check if patch control exists for specified patch.
Definition at line 53 of file lumpedPointMovementI.H.
Check if patch control exists for specified patch.
Definition at line 338 of file lumpedPointMovement.C.
References patchIdentifier::index().
bool hasInterpolator | ( | const pointPatch & | fpatch | ) | const |
Check if patch control exists for specified patch.
Definition at line 347 of file lumpedPointMovement.C.
References pointPatch::index().
void checkPatchControl | ( | const polyPatch & | pp | ) | const |
Check if patch control exists for specified patch.
Definition at line 356 of file lumpedPointMovement.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, patchIdentifier::index(), patchIdentifier::name(), and Foam::nl.
void setPatchControl | ( | const polyPatch & | pp, |
const wordList & | ctrlNames, | ||
const pointField & | points0 | ||
) |
Define pressure-zones mapping for faces in the specified patches.
The face centres are compared to the controller points,
pp | The patch with a control |
ctrlNames | The patch ids to be included in the mapping |
points0 | The initial mesh points, prior to movement |
Definition at line 387 of file lumpedPointMovement.C.
References polyPatch::boundaryMesh(), HashTable< T, Key, Hash >::cfind(), Foam::expressions::patchExpr::debug, HashTable< T, Key, Hash >::empty(), Foam::endl(), Foam::exit(), polyMesh::faces(), Foam::FatalError, FatalErrorInFunction, forAll, patchIdentifier::index(), HashSet< Key, Hash >::insert(), polyBoundaryMesh::mesh(), Foam::nl, pointLabels(), points0(), Foam::Pout, List< T >::resize(), HashTable< T, Key, Hash >::size(), HashTable< T, Key, Hash >::sortedToc(), Foam::sqr(), and polyPatch::start().
void setMapping | ( | const polyMesh & | mesh, |
const labelUList & | patchIds, | ||
const pointField & | points0 | ||
) |
Define pressure-zones mapping for faces in the specified patches.
The face centres are compared to the controller points,
mesh | The volume mesh reference |
patchIds | The patch ids to be included in the mapping |
points0 | The initial mesh points, prior to movement |
void setInterpolator | ( | const pointPatch & | fpatch, |
const pointField & | points0 | ||
) |
Check if patch control exists for specified patch.
Definition at line 481 of file lumpedPointMovement.C.
References DynamicList< T, SizeMin >::append(), HashTable< T, Key, Hash >::cfind(), DynamicList< T, SizeMin >::clear(), List< T >::clear(), Foam::expressions::patchExpr::debug, HashTable< T, Key, Hash >::empty(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::flatOutput(), forAll, forAllConstIters(), pointPatch::index(), Foam::Info, Foam::inplaceReorder(), HashSet< Key, Hash >::insert(), line< Point, PointRef >::mag(), Foam::magSqr(), pointPatch::meshPoints(), pointPatch::name(), Foam::nl, Foam::normalised(), Barycentric2D< Cmpt >::outside(), pointLabels(), points0(), triangle< Point, PointRef >::pointToBarycentric(), DynamicList< T, SizeMin >::resize(), List< T >::resize(), Pair< T >::second(), bitSet::set(), List< T >::set(), HashTable< T, Key, Hash >::size(), Foam::sortedOrder(), HashTable< T, Key, Hash >::sortedToc(), Foam::sqr(), Foam::Swap(), bitSet::test(), triFace::tri(), line< Point, PointRef >::unitVec(), and line< Point, PointRef >::vec().
|
inline |
True if the pressure-zones mapping has already been performed.
Definition at line 165 of file lumpedPointMovementI.H.
|
inline |
Check if patch interpolator exists for specified patch.
Definition at line 60 of file lumpedPointMovementI.H.
Foam::List< Foam::scalar > areas | ( | const polyMesh & | pmesh | ) | const |
The areas for each pressure-zone.
Definition at line 830 of file lumpedPointMovement.C.
References GeometricField< Type, PatchField, GeoMesh >::boundaryField(), polyMesh::boundaryMesh(), Foam::endl(), forAll, forAllConstIters(), Pstream::listCombineGather(), Pstream::listCombineScatter(), Foam::mag(), mesh, Foam::nl, patches, fvMesh::Sf(), WarningInFunction, and Foam::Zero.
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 891 of file lumpedPointMovement.C.
References GeometricField< Type, PatchField, GeoMesh >::boundaryField(), polyMesh::boundaryMesh(), fvMesh::Cf(), Foam::dimPressure, Foam::endl(), objectRegistry::findObject(), forAll, forAllConstIters(), Foam::Info, Pstream::listCombineGather(), Pstream::listCombineScatter(), mesh, Foam::nl, p, patches, List< T >::resize(), List< T >::set(), fvMesh::Sf(), WarningInFunction, and Foam::Zero.
Foam::tmp< Foam::pointField > pointsDisplacement | ( | const pointPatch & | fpatch, |
const pointField & | points0 | ||
) | const |
Displace points according to the current state.
Definition at line 1024 of file lumpedPointMovement.C.
References points0().
Foam::tmp< Foam::pointField > pointsDisplacement | ( | const lumpedPointState & | state, |
const pointPatch & | fpatch, | ||
const pointField & | points0 | ||
) | const |
Displace points according to specified state.
Definition at line 1035 of file lumpedPointMovement.C.
References forAll, pointPatch::index(), lumpedPointInterpolator::interpolate(), pointPatch::meshPoints(), tmp< T >::New(), p0, lumpedPointState::points(), points0(), lumpedPointState::rotations(), and pointPatch::size().
Foam::tmp< Foam::pointField > pointsPosition | ( | const lumpedPointState & | state, |
const pointPatch & | fpatch, | ||
const pointField & | points0 | ||
) | const |
The points absolute position according to specified state.
Definition at line 1082 of file lumpedPointMovement.C.
References forAll, pointPatch::index(), lumpedPointInterpolator::interpolate(), pointPatch::meshPoints(), tmp< T >::New(), p0, lumpedPointState::points(), points0(), lumpedPointState::rotations(), and pointPatch::size().
void writeDict | ( | Ostream & | os | ) | const |
Write axis, locations, division as a dictionary.
Definition at line 1127 of file lumpedPointMovement.C.
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 1155 of file lumpedPointMovement.C.
References forAll, Foam::nl, points, UList< T >::size(), TimeState::timeIndex(), TimeState::timeOutputValue(), Ostream::writeEntry(), 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 1298 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 1134 of file lumpedPointMovement.C.
References lumpedPointState::readData().
void writeStateVTP | ( | const lumpedPointState & | state, |
const fileName & | file | ||
) | const |
Write state as VTK PolyData format.
Definition at line 38 of file lumpedPointMovementWriter.C.
References Foam::identity(), List< T >::resize(), lumpedPointState::size(), and lumpedPointState::writeVTP().
Referenced by lumpedPointMovement::writeStateVTP().
void writeStateVTP | ( | const fileName & | file | ) | const |
Write state as VTK PolyData format.
Definition at line 75 of file lumpedPointMovementWriter.C.
References lumpedPointMovement::state(), and lumpedPointMovement::writeStateVTP().
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 82 of file lumpedPointMovementWriter.C.
References Foam::vtk::CONNECTIVITY, format(), Foam::vtk::INLINE_ASCII, UPstream::master(), Foam::vtk::newFormatter(), nPoints, Foam::vtk::NUMBER_OF_POINTS, Foam::vtk::NUMBER_OF_VERTS, Foam::vtk::OFFSETS, Foam::vtk::PIECE, points, Foam::vtk::POINTS, lumpedPointState::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 217 of file lumpedPointMovementWriter.C.
References polyMesh::boundaryMesh(), polyMesh::faces(), Foam::vtk::INLINE_ASCII, PrimitivePatch< FaceList, PointField >::localFaces(), PrimitivePatch< FaceList, PointField >::localPoints(), mesh, Field< Type >::null(), List< face >::null(), patches, patchIds, points0(), polyBoundaryMesh::range(), and writer< Type >::write().
void writeVTP | ( | const fileName & | file, |
const polyMesh & | mesh, | ||
const pointField & | points0 | ||
) | const |
Write displaced geometry according to the current state,.
write as VTK PolyData format.
Definition at line 259 of file lumpedPointMovementWriter.C.
References mesh, and points0().
void writeVTP | ( | const fileName & | file, |
const lumpedPointState & | state, | ||
const polyMesh & | mesh, | ||
const pointField & | points0 | ||
) | const |
Write displaced geometry according to the specified state,.
write as VTK PolyData format.
Definition at line 270 of file lumpedPointMovementWriter.C.
References polyMesh::boundaryMesh(), forAll, Foam::vtk::INLINE_ASCII, PrimitivePatch< FaceList, PointField >::localFaces(), mesh, Field< Type >::null(), List< face >::null(), patches, patchIds, points0(), and writer< Type >::write().
|
static |
Names for the output format types.
Definition at line 294 of file lumpedPointMovement.H.
|
static |
Names for the scaling types.
Definition at line 297 of file lumpedPointMovement.H.
|
static |
Debug switch.
Definition at line 382 of file lumpedPointMovement.H.
Referenced by lumpedPointDisplacementPointPatchVectorField::updateCoeffs().
|
static |
The canonical name ("lumpedPointMovement") for the dictionary.
Definition at line 385 of file lumpedPointMovement.H.
Referenced by lumpedPointIOMovement::getMovementObject(), and lumpedPointIOMovement::New().