vectorTensorTransform Class Reference

Vector-tensor class used to perform translations and rotations in 3D space. More...

Collaboration diagram for vectorTensorTransform:

Public Member Functions

 vectorTensorTransform (const vectorTensorTransform &)=default
 Copy construct. More...
 
vectorTensorTransformoperator= (const vectorTensorTransform &)=default
 Copy assignment. More...
 
 vectorTensorTransform ()
 Default construct - no translation, identity rotation. More...
 
 vectorTensorTransform (const vector &t, const tensor &R, bool hasR=true)
 Construct given a translation vector, rotation tensor and hasR bool. More...
 
 vectorTensorTransform (const vector &t)
 Construct a pure translation vectorTensorTransform given a translation vector. More...
 
 vectorTensorTransform (const tensor &R)
 Construct a pure rotation vectorTensorTransform given a rotation tensor. More...
 
 vectorTensorTransform (Istream &)
 Construct from Istream. More...
 
bool hasR () const noexcept
 True if it has a non-identity rotation tensor. More...
 
const vectort () const noexcept
 The translation vector. More...
 
const tensorR () const noexcept
 The (forward) rotation tensor. More...
 
vectort () noexcept
 Non-const access to the translation vector. More...
 
tensorR () noexcept
 Non-const access to the rotation tensor. Sets hasR = true. More...
 
void checkRotation (const scalar tol=ROOTVSMALL)
 Test for identity rotation and set hasR accordingly. More...
 
vector transformPosition (const vector &v) const
 Transform the given position. More...
 
pointField transformPosition (const pointField &pts) const
 Transform the given field of points. More...
 
void transformPositionList (UList< point > &pts) const
 Inplace transform the given points. More...
 
vector invTransformPosition (const vector &v) const
 Inverse transform the given position. More...
 
pointField invTransformPosition (const pointField &pts) const
 Inverse transform the given field of points. More...
 
void invTransformPositionList (UList< point > &pts) const
 Inplace inverse transform the given points. More...
 
template<class Type >
tmp< Field< Type > > transform (const Field< Type > &fld) const
 Transform the given field. More...
 
template<class Type >
void transformList (UList< Type > &fld) const
 Inplace transform the given field. More...
 
void operator &= (const vectorTensorTransform &)
 
void operator= (const vector &)
 Assign translation. More...
 
void operator+= (const vector &)
 
void operator-= (const vector &)
 
void operator= (const tensor &)
 
void operator &= (const tensor &)
 

Static Public Attributes

static const char *const typeName
 
static const vectorTensorTransform zero
 
static const vectorTensorTransform I
 

Friends

Istreamoperator>> (Istream &is, vectorTensorTransform &)
 
Ostreamoperator<< (Ostream &os, const vectorTensorTransform &)
 

Detailed Description

Vector-tensor class used to perform translations and rotations in 3D space.

Source files

Definition at line 59 of file vectorTensorTransform.H.

Constructor & Destructor Documentation

◆ vectorTensorTransform() [1/6]

Copy construct.

◆ vectorTensorTransform() [2/6]

Default construct - no translation, identity rotation.

Definition at line 24 of file vectorTensorTransformI.H.

◆ vectorTensorTransform() [3/6]

vectorTensorTransform ( const vector t,
const tensor R,
bool  hasR = true 
)
inline

Construct given a translation vector, rotation tensor and hasR bool.

Definition at line 33 of file vectorTensorTransformI.H.

◆ vectorTensorTransform() [4/6]

vectorTensorTransform ( const vector t)
inlineexplicit

Construct a pure translation vectorTensorTransform given a translation vector.

Definition at line 45 of file vectorTensorTransformI.H.

◆ vectorTensorTransform() [5/6]

vectorTensorTransform ( const tensor R)
inlineexplicit

Construct a pure rotation vectorTensorTransform given a rotation tensor.

Definition at line 53 of file vectorTensorTransformI.H.

◆ vectorTensorTransform() [6/6]

vectorTensorTransform ( Istream is)
explicit

Construct from Istream.

Definition at line 49 of file vectorTensorTransform.C.

Member Function Documentation

◆ operator=() [1/3]

vectorTensorTransform& operator= ( const vectorTensorTransform )
default

Copy assignment.

◆ hasR()

bool hasR ( ) const
inlinenoexcept

True if it has a non-identity rotation tensor.

Definition at line 150 of file vectorTensorTransform.H.

Referenced by globalIndexAndTransform::addToTransformIndex(), and globalIndexAndTransform::globalIndexAndTransform().

Here is the caller graph for this function:

◆ t() [1/2]

const vector& t ( ) const
inlinenoexcept

The translation vector.

Definition at line 155 of file vectorTensorTransform.H.

Referenced by globalIndexAndTransform::addToTransformIndex(), globalIndexAndTransform::globalIndexAndTransform(), and Foam::operator==().

Here is the caller graph for this function:

◆ R() [1/2]

const tensor& R ( ) const
inlinenoexcept

◆ t() [2/2]

vector& t ( )
inlinenoexcept

Non-const access to the translation vector.

Definition at line 168 of file vectorTensorTransform.H.

◆ R() [2/2]

Foam::tensor & R ( )
inlinenoexcept

Non-const access to the rotation tensor. Sets hasR = true.

Definition at line 63 of file vectorTensorTransformI.H.

◆ checkRotation()

void checkRotation ( const scalar  tol = ROOTVSMALL)

Test for identity rotation and set hasR accordingly.

Definition at line 57 of file vectorTensorTransform.C.

References Foam::mag().

Here is the call graph for this function:

◆ transformPosition() [1/2]

Foam::vector transformPosition ( const vector v) const
inline

Transform the given position.

Definition at line 74 of file vectorTensorTransformI.H.

References R.

◆ transformPosition() [2/2]

Foam::pointField transformPosition ( const pointField pts) const
inline

Transform the given field of points.

Definition at line 90 of file vectorTensorTransformI.H.

References pts, and R.

◆ transformPositionList()

void transformPositionList ( UList< point > &  pts) const
inline

Inplace transform the given points.

Definition at line 109 of file vectorTensorTransformI.H.

References p, pts, and R.

Referenced by weightedPosition::operator()(), and mapDistribute::transformPosition::operator()().

Here is the caller graph for this function:

◆ invTransformPosition() [1/2]

Foam::vector invTransformPosition ( const vector v) const
inline

Inverse transform the given position.

Definition at line 131 of file vectorTensorTransformI.H.

References R, and Foam::T().

Here is the call graph for this function:

◆ invTransformPosition() [2/2]

Foam::pointField invTransformPosition ( const pointField pts) const
inline

Inverse transform the given field of points.

Definition at line 147 of file vectorTensorTransformI.H.

References pts, and R.

◆ invTransformPositionList()

void invTransformPositionList ( UList< point > &  pts) const
inline

Inplace inverse transform the given points.

Definition at line 166 of file vectorTensorTransformI.H.

References p, pts, and R.

Referenced by weightedPosition::operator()(), and mapDistribute::transformPosition::operator()().

Here is the caller graph for this function:

◆ transform()

tmp<Field<Type> > transform ( const Field< Type > &  fld) const

Transform the given field.

◆ transformList()

void transformList ( UList< Type > &  fld) const

Inplace transform the given field.

◆ operator &=() [1/2]

void operator&= ( const vectorTensorTransform )
inline

◆ operator=() [2/3]

void operator= ( const vector t)
inline

Assign translation.

Definition at line 205 of file vectorTensorTransformI.H.

◆ operator+=()

void operator+= ( const vector t)
inline

Definition at line 211 of file vectorTensorTransformI.H.

◆ operator-=()

void operator-= ( const vector t)
inline

Definition at line 217 of file vectorTensorTransformI.H.

◆ operator=() [3/3]

void operator= ( const tensor R)
inline

Definition at line 223 of file vectorTensorTransformI.H.

References R.

◆ operator &=() [2/2]

void operator&= ( const tensor )
inline

Friends And Related Function Documentation

◆ operator>>

Istream& operator>> ( Istream is,
vectorTensorTransform  
)
friend

◆ operator<<

Ostream& operator<< ( Ostream os,
const vectorTensorTransform  
)
friend

Member Data Documentation

◆ typeName

const char *const typeName
static
Initial value:
=
"vectorTensorTransform"

Definition at line 86 of file vectorTensorTransform.H.

◆ zero

Definition at line 88 of file vectorTensorTransform.H.

◆ I

Definition at line 90 of file vectorTensorTransform.H.


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