lumpedPointMovement Class Reference

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...

Inheritance diagram for lumpedPointMovement:
[legend]
Collaboration diagram for lumpedPointMovement:
[legend]

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 vectoraxis () const
 The normalized reference axis. More...
 
const scalarFieldlocations () 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 scalarFieldthresholds () 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 externalFileCouplercoupler () const
 Communication control. More...
 
externalFileCouplercoupler ()
 Communication control. More...
 
const lumpedPointStatestate0 () const
 The initial state (positions/rotations) More...
 
const lumpedPointStatestate () 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 wordinputName () const
 The input (state) file name. More...
 
const wordoutputName () const
 The output (forces) file name. More...
 
const wordlogName () 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< pointFielddisplacePoints (const pointField &points0, const labelList &pointLabels) const
 Displace points according to the current state. More...
 
tmp< pointFielddisplacePoints (const lumpedPointState &state, const pointField &points0, const labelList &pointLabels) const
 Displace points according to specified state. More...
 
const interpolationWeightsinterpolator () 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< outputFormatTypeformatNames
 Names for the output format types. More...
 
static const Enum< scalingTypescalingNames
 Names for the scaling types. More...
 
static const word canonicalName
 The canonical name ("lumpedPointMovement") for the dictionary. More...
 

Detailed Description

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
Source files

Definition at line 260 of file lumpedPointMovement.H.

Member Enumeration Documentation

◆ outputFormatType

enum outputFormatType
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.

◆ 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.

Constructor & Destructor Documentation

◆ lumpedPointMovement() [1/2]

Construct null.

Definition at line 166 of file lumpedPointMovement.C.

◆ lumpedPointMovement() [2/2]

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.

◆ ~lumpedPointMovement()

~lumpedPointMovement ( )
virtual

Destructor.

Definition at line 233 of file lumpedPointMovement.C.

References Foam::deleteDemandDrivenData().

Here is the call graph for this function:

Member Function Documentation

◆ readDict()

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().

Here is the call graph for this function:

◆ empty()

bool empty ( ) const
inline

If no number of lumped points (locations) were specified.

Definition at line 28 of file lumpedPointMovementI.H.

◆ size()

Foam::label size ( ) const
inline

The number of lumped points (number of locations)

Definition at line 34 of file lumpedPointMovementI.H.

◆ axis()

const Foam::vector & axis ( ) const
inline

The normalized reference axis.

Definition at line 40 of file lumpedPointMovementI.H.

Referenced by lumpedPointMovement::writeStateVTP().

Here is the caller graph for this function:

◆ locations()

const Foam::scalarField & locations ( ) const
inline

Read access to the locations.

Definition at line 46 of file lumpedPointMovementI.H.

◆ division()

Foam::scalar division ( ) const
inline

The division (0-1) when calculating pressure forces.

Definition at line 52 of file lumpedPointMovementI.H.

◆ ownerId() [1/2]

Foam::label ownerId ( ) const
inline

An owner Id, if needed for bookkeeping purposes.

Definition at line 58 of file lumpedPointMovementI.H.

Referenced by lumpedPointDisplacementPointPatchVectorField::~lumpedPointDisplacementPointPatchVectorField().

Here is the caller graph for this function:

◆ ownerId() [2/2]

void ownerId ( label  id)
inline

Change the owner id, if needed for bookkeeping purposes.

Definition at line 64 of file lumpedPointMovementI.H.

◆ thresholds()

const Foam::scalarField & thresholds ( ) const
inline

Threshold locations for pressure forces.

Definition at line 70 of file lumpedPointMovementI.H.

◆ threshold()

Foam::label threshold ( const point position) const
inline

Classify the position to be located in one of the threshold zones.

Definition at line 82 of file lumpedPointMovementI.H.

◆ coupler() [1/2]

const Foam::externalFileCoupler & coupler ( ) const
inline

Communication control.

Definition at line 89 of file lumpedPointMovementI.H.

◆ coupler() [2/2]

Foam::externalFileCoupler & coupler ( )
inline

Communication control.

Definition at line 95 of file lumpedPointMovementI.H.

◆ state0()

const Foam::lumpedPointState & state0 ( ) const
inline

The initial state (positions/rotations)

Definition at line 102 of file lumpedPointMovementI.H.

◆ state()

const Foam::lumpedPointState & state ( ) const
inline

The current state (positions/rotations)

Definition at line 108 of file lumpedPointMovementI.H.

Referenced by lumpedPointMovement::writeStateVTP().

Here is the caller graph for this function:

◆ relax() [1/2]

Foam::scalar relax ( ) const
inline

The relaxation factor when changing states.

Definition at line 114 of file lumpedPointMovementI.H.

◆ relax() [2/2]

Foam::scalar & relax ( )
inline

The relaxation factor when changing states.

Definition at line 120 of file lumpedPointMovementI.H.

◆ inputName()

const Foam::word & inputName ( ) const
inline

The input (state) file name.

Definition at line 126 of file lumpedPointMovementI.H.

◆ outputName()

const Foam::word & outputName ( ) const
inline

The output (forces) file name.

Definition at line 132 of file lumpedPointMovementI.H.

◆ logName()

const Foam::word & logName ( ) const
inline

The log file name.

Definition at line 138 of file lumpedPointMovementI.H.

◆ inputFormat()

Foam::lumpedPointState::inputFormatType inputFormat ( ) const
inline

The input (state) file format.

Definition at line 145 of file lumpedPointMovementI.H.

◆ outputFormat()

Foam::lumpedPointMovement::outputFormatType outputFormat ( ) const
inline

The output (forces) file format.

Definition at line 152 of file lumpedPointMovementI.H.

◆ setBoundBox()

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.

Parameters
meshThe volume mesh reference
patchIdsThe patch ids to be included in the bounding box.
points0The 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.

Here is the call graph for this function:

◆ setMapping()

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.

Parameters
meshThe volume mesh reference
patchIdsThe patch ids to be included in the mapping
points0The 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.

Here is the call graph for this function:

◆ hasMapping()

bool hasMapping ( ) const
inline

True if the pressure-zones mapping has already been performed.

Definition at line 158 of file lumpedPointMovementI.H.

◆ zones()

const Foam::List< Foam::labelList > & zones ( ) const
inline

Return the pressure-zones mapping with the associated.

patch face ids.

Definition at line 165 of file lumpedPointMovementI.H.

◆ forcesAndMoments()

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.

Here is the call graph for this function:

◆ displacePoints() [1/2]

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().

Here is the call graph for this function:

◆ displacePoints() [2/2]

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().

Here is the call graph for this function:

◆ interpolator()

const Foam::interpolationWeights & interpolator ( ) const

Interpolation weights.

Definition at line 885 of file lumpedPointMovement.C.

References interpolationWeights::New().

Here is the call graph for this function:

◆ writeDict()

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<<().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeData() [1/2]

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.

Here is the call graph for this function:

◆ writeData() [2/2]

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().

Here is the call graph for this function:

◆ readState()

bool readState ( )

Read state from file, applying relaxation as requested.

Definition at line 687 of file lumpedPointMovement.C.

References lumpedPointState::readData().

Here is the call graph for this function:

◆ writeStateVTP()

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().

Here is the call graph for this function:

◆ writeForcesAndMomentsVTP()

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().

Here is the call graph for this function:

◆ writeZonesVTP()

void writeZonesVTP ( const fileName file,
const polyMesh mesh,
const pointField points0 
) const

◆ writeVTP() [1/2]

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().

Here is the call graph for this function:

◆ writeVTP() [2/2]

void writeVTP ( const fileName file,
const lumpedPointState state,
const polyMesh mesh,
const labelUList patchLst,
const pointField points0 
) const

◆ selectIO()

static IOobject selectIO ( const IOobject io,
const fileName altFile,
const word ioName = "" 
)
inlinestatic

Deprecated(2018-08) compatibility method.

Deprecated:
(2018-08) - use IOobject::selectIO directly

Definition at line 603 of file lumpedPointMovement.H.

References IOobject::selectIO().

Here is the call graph for this function:

Member Data Documentation

◆ formatNames

Names for the output format types.

Definition at line 282 of file lumpedPointMovement.H.

Referenced by lumpedPointMovement::readDict().

◆ scalingNames

const Foam::Enum< Foam::lumpedPointMovement::scalingType > scalingNames
static

Names for the scaling types.

Definition at line 285 of file lumpedPointMovement.H.

◆ canonicalName

const Foam::word canonicalName
static

The canonical name ("lumpedPointMovement") for the dictionary.

Definition at line 378 of file lumpedPointMovement.H.

Referenced by lumpedPointIOMovement::lookupInRegistry(), and lumpedPointIOMovement::New().


The documentation for this class was generated from the following files: