lumpedPointState Class Reference

The state of lumped points corresponds to positions and rotations. More...

Collaboration diagram for lumpedPointState:
[legend]

Public Types

enum class  inputFormatType { PLAIN , DICTIONARY }
 Input format types. More...
 

Public Member Functions

 lumpedPointState ()
 Default construct. More...
 
 lumpedPointState (const lumpedPointState &rhs)
 Copy construct. More...
 
 lumpedPointState (const pointField &pts, const vectorField &ang, const quaternion::eulerOrder rotOrder=quaternion::eulerOrder::ZXZ, const bool degrees=false)
 Copy construct from points and angles. More...
 
 lumpedPointState (const pointField &pts, const quaternion::eulerOrder rotOrder=quaternion::eulerOrder::ZXZ, const bool degrees=false)
 Copy construct from points with zero-rotation. More...
 
 lumpedPointState (tmp< pointField > &pts, const quaternion::eulerOrder rotOrder=quaternion::eulerOrder::ZXZ, const bool degrees=false)
 Construct from points with zero-rotation. More...
 
 lumpedPointState (const dictionary &dict, const quaternion::eulerOrder rotOrder=quaternion::eulerOrder::ZXZ, const bool degrees=false)
 Construct from dictionary. More...
 
virtual ~lumpedPointState ()=default
 Destructor. More...
 
bool valid () const
 Has positions and consistent number of rotations? More...
 
bool empty () const
 If no points were specified. More...
 
label size () const
 The number of points. More...
 
const pointFieldpoints () const
 The points corresponding to mass centres. More...
 
const vectorFieldangles () const
 The orientation of the points (mass centres) More...
 
const tensorFieldrotations () const
 The local-to-global transformation for each point. More...
 
void scalePoints (const scalar scaleFactor)
 Scale points by given factor. More...
 
quaternion::eulerOrder rotationOrder () const
 The Euler-angle rotation order. More...
 
bool degrees () const
 Rotation angles in degrees. More...
 
void relax (const scalar alpha, const lumpedPointState &prev)
 Relax the state. More...
 
bool readData (Istream &is, const quaternion::eulerOrder rotOrder=quaternion::eulerOrder::ZXZ, const bool degrees=false)
 Read input as dictionary content. More...
 
bool writeData (Ostream &os) const
 Output as dictionary content. More...
 
void writeDict (Ostream &os) const
 Output as dictionary content. More...
 
bool readPlain (Istream &is, const quaternion::eulerOrder rotOrder=quaternion::eulerOrder::ZXZ, const bool degrees=false)
 Read input as plain content. More...
 
void writePlain (Ostream &os) const
 Output as plain content. More...
 
bool readData (const inputFormatType fmt, const fileName &file, const quaternion::eulerOrder rotOrder=quaternion::eulerOrder::ZXZ, const bool degrees=false)
 Read input from file (master process only) using specified format. More...
 
void writeVTP (const fileName &outputFile, const labelListList &lines=labelListList(), const labelList &pointIds=labelList::null()) const
 Output points/rotations as VTK file for debugging/visualization. More...
 
void operator= (const lumpedPointState &rhs)
 Assignment operator. More...
 
void operator+= (const point &origin)
 Shift points by specified origin. More...
 

Static Public Attributes

static const Enum< inputFormatTypeformatNames
 Names for the input format types. More...
 
static bool visUnused = true
 Enable/disable visualization of unused points. More...
 
static scalar visLength = 0.1
 The length for visualization triangles. More...
 

Detailed Description

The state of lumped points corresponds to positions and rotations.

This class encapsulates the response from the external application and serves as the entry point for applying relaxation, sub-stepping etc.


Dictionary input format

Property Description Required Default
points List of points yes
angles List of Euler rotation angles yes
rotationOrder The Euler-angle rotation order no zxz
degrees Rotation angles in degrees no false


Plain input format. Blank and comment lines starting with a '#' character are ignored. The angles are always in radians.

    NumPoints
    x0 y0 z0 eulerz0 eulerx'0 eulerz''0
    x1 y1 z1 eulerz1 eulerx'1 eulerz''1
    ...
See also
Foam::coordinateRotations::euler, Foam::quaternion
Source files

Definition at line 112 of file lumpedPointState.H.

Member Enumeration Documentation

◆ inputFormatType

enum class inputFormatType
strong

Input format types.

Enumerator
PLAIN 

"plain" is a simple ASCII format

DICTIONARY 

"dictionary" is the OpenFOAM dictionary format

Definition at line 119 of file lumpedPointState.H.

Constructor & Destructor Documentation

◆ lumpedPointState() [1/6]

Default construct.

Definition at line 115 of file lumpedPointState.C.

◆ lumpedPointState() [2/6]

Copy construct.

Definition at line 125 of file lumpedPointState.C.

◆ lumpedPointState() [3/6]

lumpedPointState ( const pointField pts,
const vectorField ang,
const quaternion::eulerOrder  rotOrder = quaternion::eulerOrder::ZXZ,
const bool  degrees = false 
)

Copy construct from points and angles.

Definition at line 135 of file lumpedPointState.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::nl, List< T >::resize(), UList< T >::size(), WarningInFunction, and Foam::Zero.

Here is the call graph for this function:

◆ lumpedPointState() [4/6]

lumpedPointState ( const pointField pts,
const quaternion::eulerOrder  rotOrder = quaternion::eulerOrder::ZXZ,
const bool  degrees = false 
)
explicit

Copy construct from points with zero-rotation.

Definition at line 167 of file lumpedPointState.C.

◆ lumpedPointState() [5/6]

lumpedPointState ( tmp< pointField > &  pts,
const quaternion::eulerOrder  rotOrder = quaternion::eulerOrder::ZXZ,
const bool  degrees = false 
)
explicit

Construct from points with zero-rotation.

Definition at line 182 of file lumpedPointState.C.

◆ lumpedPointState() [6/6]

lumpedPointState ( const dictionary dict,
const quaternion::eulerOrder  rotOrder = quaternion::eulerOrder::ZXZ,
const bool  degrees = false 
)
explicit

Construct from dictionary.

Definition at line 197 of file lumpedPointState.C.

References lumpedPointState::degrees(), and dict.

Here is the call graph for this function:

◆ ~lumpedPointState()

virtual ~lumpedPointState ( )
virtualdefault

Destructor.

Member Function Documentation

◆ valid()

bool valid ( ) const
inline

Has positions and consistent number of rotations?

Definition at line 28 of file lumpedPointStateI.H.

References UList< T >::size().

Here is the call graph for this function:

◆ empty()

bool empty ( ) const
inline

If no points were specified.

Definition at line 34 of file lumpedPointStateI.H.

Referenced by lumpedPointMovement::empty().

Here is the caller graph for this function:

◆ size()

Foam::label size ( ) const
inline

The number of points.

Definition at line 40 of file lumpedPointStateI.H.

Referenced by lumpedPointMovement::writeStateVTP().

Here is the caller graph for this function:

◆ points()

const Foam::pointField & points ( ) const
inline

The points corresponding to mass centres.

Definition at line 46 of file lumpedPointStateI.H.

◆ angles()

const Foam::vectorField & angles ( ) const
inline

The orientation of the points (mass centres)

Definition at line 52 of file lumpedPointStateI.H.

◆ rotations()

const Foam::tensorField & rotations ( ) const
inline

The local-to-global transformation for each point.

Definition at line 58 of file lumpedPointStateI.H.

Referenced by lumpedPointState::writeVTP().

Here is the caller graph for this function:

◆ scalePoints()

void scalePoints ( const scalar  scaleFactor)

Scale points by given factor.

Zero and negative values are ignored.

Definition at line 236 of file lumpedPointState.C.

Referenced by lumpedPointMovement::scalePoints().

Here is the caller graph for this function:

◆ rotationOrder()

Foam::quaternion::eulerOrder rotationOrder ( ) const
inline

The Euler-angle rotation order.

Definition at line 70 of file lumpedPointStateI.H.

◆ degrees()

bool degrees ( ) const
inline

Rotation angles in degrees.

Definition at line 76 of file lumpedPointStateI.H.

Referenced by lumpedPointState::lumpedPointState().

Here is the caller graph for this function:

◆ relax()

void relax ( const scalar  alpha,
const lumpedPointState prev 
)

Relax the state.

alpha = 1 : no relaxation alpha < 1 : relaxation alpha = 0 : do nothing

Definition at line 245 of file lumpedPointState.C.

References alpha, Foam::degToRad(), and Foam::radToDeg().

Here is the call graph for this function:

◆ readData() [1/2]

bool readData ( Istream is,
const quaternion::eulerOrder  rotOrder = quaternion::eulerOrder::ZXZ,
const bool  degrees = false 
)

Read input as dictionary content.

Definition at line 319 of file lumpedPointState.C.

References dict.

◆ writeData()

bool writeData ( Ostream os) const

Output as dictionary content.

Definition at line 333 of file lumpedPointState.C.

References os(), and lumpedPointState::writeData().

Referenced by lumpedPointState::writeData().

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

◆ writeDict()

void writeDict ( Ostream os) const

Output as dictionary content.

Definition at line 340 of file lumpedPointState.C.

References quaternion::eulerOrderNames, os(), Ostream::writeEntry(), and quaternion::ZXZ.

Here is the call graph for this function:

◆ readPlain()

bool readPlain ( Istream is,
const quaternion::eulerOrder  rotOrder = quaternion::eulerOrder::ZXZ,
const bool  degrees = false 
)

Read input as plain content.

Definition at line 274 of file lumpedPointState.C.

References forAll, ISstream::getLine(), and quaternion::ZXZ.

Here is the call graph for this function:

◆ writePlain()

void writePlain ( Ostream os) const

Output as plain content.

Definition at line 355 of file lumpedPointState.C.

References forAll, os(), and p.

Here is the call graph for this function:

◆ readData() [2/2]

bool readData ( const inputFormatType  fmt,
const fileName file,
const quaternion::eulerOrder  rotOrder = quaternion::eulerOrder::ZXZ,
const bool  degrees = false 
)

Read input from file (master process only) using specified format.

Definition at line 381 of file lumpedPointState.C.

References Pstream::broadcasts(), splitCell::master(), UPstream::parRun(), and UPstream::worldComm.

Here is the call graph for this function:

◆ writeVTP()

void writeVTP ( const fileName outputFile,
const labelListList lines = labelListList(),
const labelList pointIds = labelList::null() 
) const

Output points/rotations as VTK file for debugging/visualization.

The points are written as vertices, rotation as a triangle

Definition at line 35 of file lumpedPointStateWriter.C.

References Foam::vtk::CONNECTIVITY, Tensor< Cmpt >::cx(), Tensor< Cmpt >::cy(), forAll, format(), Foam::vtk::INLINE_ASCII, Foam::vtk::LINES, splitCell::master(), Foam::vtk::newFormatter(), nPoints, Foam::vtk::NUMBER_OF_LINES, Foam::vtk::NUMBER_OF_POINTS, Foam::vtk::NUMBER_OF_POLYS, Foam::vtk::NUMBER_OF_VERTS, Foam::vtk::OFFSETS, os(), Foam::vtk::PIECE, Foam::vtk::POINTS, Foam::vtk::POLY_DATA, Foam::vtk::POLYS, lumpedPointState::rotations(), UList< T >::size(), OFstream::stdStream(), Foam::vtk::VERTS, lumpedPointState::visLength, Foam::vtk::write(), Foam::vtk::writeIdentity(), and Foam::vtk::writeList().

Referenced by lumpedPointMovement::writeStateVTP().

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

◆ operator=()

void operator= ( const lumpedPointState rhs)

Assignment operator.

Definition at line 216 of file lumpedPointState.C.

◆ operator+=()

void operator+= ( const point origin)

Shift points by specified origin.

Definition at line 227 of file lumpedPointState.C.

References p.

Member Data Documentation

◆ formatNames

Names for the input format types.

Definition at line 129 of file lumpedPointState.H.

◆ visUnused

bool visUnused = true
static

Enable/disable visualization of unused points.

Definition at line 168 of file lumpedPointState.H.

◆ visLength

Foam::scalar visLength = 0.1
static

The length for visualization triangles.

Definition at line 171 of file lumpedPointState.H.

Referenced by lumpedPointState::writeVTP().


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