Loading...
Searching...
No Matches
lumpedPointState Class Reference

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

#include <lumpedPointState.H>

Collaboration diagram for lumpedPointState:

Public Types

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

Public Member Functions

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

Static Public Attributes

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

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 104 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 113 of file lumpedPointState.H.

Constructor & Destructor Documentation

◆ lumpedPointState() [1/6]

lumpedPointState ( )

Default construct.

Definition at line 108 of file lumpedPointState.C.

Referenced by lumpedPointState(), operator=(), and relax().

Here is the caller graph for this function:

◆ lumpedPointState() [2/6]

lumpedPointState ( const lumpedPointState & rhs)

Copy construct.

Definition at line 118 of file lumpedPointState.C.

References lumpedPointState(), and Foam::rhs().

Here is the call graph for this function:

◆ 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 128 of file lumpedPointState.C.

References degrees(), and pts.

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 160 of file lumpedPointState.C.

References degrees(), pts, size(), and Foam::Zero.

Here is the call graph for this function:

◆ 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 175 of file lumpedPointState.C.

References degrees(), pts, size(), and Foam::Zero.

Here is the call graph for this function:

◆ 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 190 of file lumpedPointState.C.

References degrees(), and dict.

Here is the call graph for this function:

◆ ~lumpedPointState()

virtual ~lumpedPointState ( )
virtualdefault

Destructor.

Member Function Documentation

◆ good()

bool good ( ) const
inline

Has positions and consistent number of rotations?

Definition at line 21 of file lumpedPointStateI.H.

Referenced by valid().

Here is the caller graph for this function:

◆ empty()

bool empty ( ) const
inline

If no points were specified.

Definition at line 27 of file lumpedPointStateI.H.

◆ size()

Foam::label size ( ) const
inline

The number of points.

Definition at line 33 of file lumpedPointStateI.H.

Referenced by lumpedPointState(), and lumpedPointState().

Here is the caller graph for this function:

◆ valid()

bool valid ( ) const
inline

Same as good().

Definition at line 264 of file lumpedPointState.H.

References good().

Here is the call graph for this function:

◆ points()

const Foam::pointField & points ( ) const
inline

The points corresponding to mass centres.

Definition at line 39 of file lumpedPointStateI.H.

◆ angles()

const Foam::vectorField & angles ( ) const
inline

The orientation of the points (mass centres).

Definition at line 45 of file lumpedPointStateI.H.

◆ rotations()

const Foam::tensorField & rotations ( ) const
inline

The local-to-global transformation for each point.

Definition at line 51 of file lumpedPointStateI.H.

Referenced by 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 229 of file lumpedPointState.C.

◆ rotationOrder()

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

The Euler-angle rotation order.

Definition at line 63 of file lumpedPointStateI.H.

◆ degrees()

bool degrees ( ) const
inline

Rotation angles in degrees.

Definition at line 69 of file lumpedPointStateI.H.

Referenced by lumpedPointState(), lumpedPointState(), lumpedPointState(), lumpedPointState(), readData(), readData(), and readPlain().

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 238 of file lumpedPointState.C.

References alpha, Foam::degToRad(), lumpedPointState(), 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 312 of file lumpedPointState.C.

References degrees(), and dict.

Referenced by readData().

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

◆ writeData()

bool writeData ( Ostream & os) const

Output as dictionary content.

Definition at line 326 of file lumpedPointState.C.

References os(), and writeDict().

Here is the call graph for this function:

◆ writeDict()

void writeDict ( Ostream & os) const

Output as dictionary content.

Definition at line 333 of file lumpedPointState.C.

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

Referenced by writeData().

Here is the call graph for this function:
Here is the caller 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 267 of file lumpedPointState.C.

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

Referenced by readData().

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

◆ writePlain()

void writePlain ( Ostream & os) const

Output as plain content.

Definition at line 348 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 374 of file lumpedPointState.C.

References Pstream::broadcasts(), degrees(), UPstream::master(), UPstream::parRun(), PLAIN, readData(), readPlain(), and UPstream::worldComm.

Here is the call graph for this function:

◆ writeVTP()

◆ operator=()

void operator= ( const lumpedPointState & rhs)

Assignment operator.

Definition at line 209 of file lumpedPointState.C.

References lumpedPointState(), and Foam::rhs().

Here is the call graph for this function:

◆ operator+=()

void operator+= ( const point & origin)

Shift points by specified origin.

Definition at line 220 of file lumpedPointState.C.

References p.

Member Data Documentation

◆ formatNames

Names for the input format types.

Definition at line 125 of file lumpedPointState.H.

◆ visUnused

bool visUnused = true
static

Enable/disable visualization of unused points.

Definition at line 176 of file lumpedPointState.H.

◆ visLength

Foam::scalar visLength = 0.1
static

The length for visualization triangles.

Definition at line 181 of file lumpedPointState.H.

Referenced by writeVTP().


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