transformer Class Reference

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

Collaboration diagram for transformer:

Public Member Functions

 transformer ()
 Construct null (i.e., no transformation) More...
 
 transformer (Istream &)
 Construct from Istream. More...
 
const vectort () const
 Return the translation vector. More...
 
bool translates () const
 Return true if the transformer performs pure translation. More...
 
const tensorT () const
 Return the transformation tensor. More...
 
tensor invT () const
 Return the inverse transformation tensor. More...
 
bool scales () const
 Return true if the transformer performs pure scaling. More...
 
bool rotates () const
 Return true if the transformer performs pure rotation. More...
 
bool transforms () const
 Return true if the transformer transforms a type. More...
 
template<typename Type >
bool transforms () const
 Return true if the transformer transforms the given type. More...
 
bool transformsPosition () const
 Return true if the transformer transforms a point. More...
 
vector transformPosition (const vector &v) const
 Transform the given position. More...
 
void transformPosition (pointField &, const pointField &) const
 Transform the given pointField. More...
 
tmp< pointFieldtransformPosition (const pointField &) const
 Transform the given pointField. More...
 
vector invTransformPosition (const vector &v) const
 Inverse transform the given position. More...
 
void invTransformPosition (pointField &, const pointField &) const
 Inverse transform the given pointField. More...
 
tmp< pointFieldinvTransformPosition (const pointField &) const
 Inverse transform the given pointField. More...
 
template<class Type >
Type transform (const Type &) const
 Transform the given type. More...
 
template<class Type >
void transform (Field< Type > &, const Field< Type > &) const
 Transform the given field. More...
 
template<class Type >
tmp< Field< Type > > transform (const Field< Type > &) const
 Transform the given field. More...
 
template<class Type >
tmp< Field< Type > > transform (const tmp< Field< Type >> &) const
 Transform the given field. More...
 
template<class Type , template< class > class Container>
void transformList (Container< Type > &) const
 Transform the given container. More...
 
template<class Type >
Type invTransform (const Type &) const
 Inverse transform the given type. More...
 
template<class Type >
void invTransform (Field< Type > &, const Field< Type > &) const
 Inverse transform the given field. More...
 
template<class Type >
tmp< Field< Type > > invTransform (const Field< Type > &) const
 Inverse transform the given field. More...
 
template<class Type >
tmp< Field< Type > > invTransform (const tmp< Field< Type >> &) const
 Inverse transform the given field. More...
 
template<class Type , template< class > class Container>
void invTransformList (Container< Type > &) const
 Inverse transform the given container. More...
 
template<>
Foam::tmp< Foam::Field< bool > > transform (const Field< bool > &fld) const
 
template<>
Foam::tmp< Foam::Field< bool > > transform (const tmp< Field< bool >> &tfld) const
 
template<>
Foam::tmp< Foam::Field< Foam::label > > transform (const Field< label > &fld) const
 
template<>
Foam::tmp< Foam::Field< Foam::label > > transform (const tmp< Field< label >> &tfld) const
 
template<>
Foam::tmp< Foam::Field< Foam::scalar > > transform (const Field< scalar > &fld) const
 
template<>
Foam::tmp< Foam::Field< Foam::scalar > > transform (const tmp< Field< scalar >> &tfld) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > transform (const Field< Type > &fld) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > transform (const tmp< Field< Type >> &tfld) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > invTransform (const Field< Type > &fld) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > invTransform (const tmp< Field< Type >> &tfld) const
 

Static Public Member Functions

static transformer translation (const vector &t)
 Construct a pure translation transformer. More...
 
static transformer scaling (const tensor &T)
 Construct a pure scaling transformer. More...
 
static transformer rotation (const tensor &T)
 Construct a pure rotation transformer. More...
 

Static Public Attributes

static const char *const typeName
 
static const transformer zero
 
static const transformer I
 
static const transformer null
 Null transformer. More...
 

Friends

transformer inv (const transformer &tr)
 Return the inverse of the given transformer. More...
 
bool operator== (const transformer &tr1, const transformer &tr2)
 
bool operator!= (const transformer &tr1, const transformer &tr2)
 
transformer operator& (const transformer &tr1, const transformer &tr2)
 
Istreamoperator>> (Istream &is, transformer &)
 
Ostreamoperator<< (Ostream &os, const transformer &)
 

Detailed Description

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

Source files

Definition at line 83 of file transformer.H.

Constructor & Destructor Documentation

◆ transformer() [1/2]

transformer ( )
inline

Construct null (i.e., no transformation)

Definition at line 70 of file transformerI.H.

Referenced by transformer::translation().

Here is the caller graph for this function:

◆ transformer() [2/2]

transformer ( Istream is)

Construct from Istream.

Definition at line 58 of file transformer.C.

Member Function Documentation

◆ translation()

Foam::transformer translation ( const vector t)
inlinestatic

Construct a pure translation transformer.

Definition at line 31 of file transformerI.H.

References Tensor< scalar >::I, transformer::t(), and transformer::transformer().

Here is the call graph for this function:

◆ scaling()

Foam::transformer scaling ( const tensor T)
inlinestatic

Construct a pure scaling transformer.

Definition at line 37 of file transformerI.H.

References Foam::T(), and VectorSpace< Form, Cmpt, Ncmpts >::zero.

Here is the call graph for this function:

◆ rotation()

Foam::transformer rotation ( const tensor T)
inlinestatic

Construct a pure rotation transformer.

Definition at line 43 of file transformerI.H.

References Foam::T(), and VectorSpace< Form, Cmpt, Ncmpts >::zero.

Referenced by particle::hitSymmetryPatch().

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

◆ t()

const Foam::vector & t ( ) const
inline

Return the translation vector.

Definition at line 82 of file transformerI.H.

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

Here is the caller graph for this function:

◆ translates()

bool translates ( ) const
inline

Return true if the transformer performs pure translation.

(i.e. the translation vector is non-zero and the transformation tensor is I)

Definition at line 88 of file transformerI.H.

References transforms.

◆ T()

const Foam::tensor & T ( ) const
inline

Return the transformation tensor.

Definition at line 94 of file transformerI.H.

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

Here is the caller graph for this function:

◆ invT()

Foam::tensor invT ( ) const
inline

Return the inverse transformation tensor.

Definition at line 100 of file transformerI.H.

References Foam::diag(), Tensor< scalar >::I, Foam::inv(), and Foam::T().

Here is the call graph for this function:

◆ scales()

bool scales ( ) const
inline

Return true if the transformer performs pure scaling.

(i.e. the transformation tensor is diagonal)

Definition at line 121 of file transformerI.H.

◆ rotates()

bool rotates ( ) const
inline

Return true if the transformer performs pure rotation.

(i.e. the transformation tensor is orthogonal)

Definition at line 127 of file transformerI.H.

◆ transforms() [1/2]

bool transforms ( ) const
inline

Return true if the transformer transforms a type.

(i.e. scales or rotates)

Definition at line 133 of file transformerI.H.

Referenced by globalIndexAndTransform::addToTransformIndex(), findCellParticle::hitProcessorPatch(), distributionMap::transform::operator()(), transformer::transform(), cyclicLduInterfaceField::transforms(), and processorLduInterfaceField::transforms().

Here is the caller graph for this function:

◆ transforms() [2/2]

bool transforms
inline

Return true if the transformer transforms the given type.

(i.e. scales or rotates)

Definition at line 140 of file transformerI.H.

References transforms.

◆ transformsPosition()

◆ transformPosition() [1/3]

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

Transform the given position.

Definition at line 152 of file transformerI.H.

References p, Foam::T(), and transforms.

Referenced by cyclicTransform::cyclicTransform(), distributionMap::transformPosition::operator()(), fvMesh::unconform(), and patchToPatch::update().

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

◆ transformPosition() [2/3]

void transformPosition ( pointField res,
const pointField pts 
) const

Transform the given pointField.

Definition at line 76 of file transformer.C.

References Foam::T(), and transforms.

Here is the call graph for this function:

◆ transformPosition() [3/3]

Foam::tmp< Foam::pointField > transformPosition ( const pointField pts) const

Transform the given pointField.

Definition at line 97 of file transformer.C.

References Foam::T(), and transforms.

Here is the call graph for this function:

◆ invTransformPosition() [1/3]

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

Inverse transform the given position.

Definition at line 176 of file transformerI.H.

References p, and transforms.

◆ invTransformPosition() [2/3]

void invTransformPosition ( pointField res,
const pointField pts 
) const

Inverse transform the given pointField.

Definition at line 145 of file transformer.C.

References Foam::T(), and transforms.

Here is the call graph for this function:

◆ invTransformPosition() [3/3]

Foam::tmp< Foam::pointField > invTransformPosition ( const pointField pts) const

Inverse transform the given pointField.

Definition at line 121 of file transformer.C.

References Foam::T(), and transforms.

Here is the call graph for this function:

◆ transform() [1/12]

◆ transform() [2/12]

void transform ( Field< Type > &  res,
const Field< Type > &  fld 
) const

Transform the given field.

Definition at line 43 of file transformerTemplates.C.

References fld(), Foam::T(), Foam::transform(), and transforms.

Here is the call graph for this function:

◆ transform() [3/12]

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

Transform the given field.

◆ transform() [4/12]

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

Transform the given field.

◆ transformList()

void transformList ( Container< Type > &  l) const

Transform the given container.

Definition at line 91 of file transformerTemplates.C.

References forAllIter, Foam::T(), Foam::transform(), and transforms.

Referenced by distributionMap::transform::operator()().

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

◆ invTransform() [1/6]

Type invTransform ( const Type &  x) const

Inverse transform the given type.

Definition at line 104 of file transformerTemplates.C.

References Foam::transform(), transforms, and x.

Referenced by fvMesh::unconform().

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

◆ invTransform() [2/6]

void invTransform ( Field< Type > &  res,
const Field< Type > &  fld 
) const

Inverse transform the given field.

Definition at line 118 of file transformerTemplates.C.

References fld(), Foam::transform(), and transforms.

Here is the call graph for this function:

◆ invTransform() [3/6]

tmp<Field<Type> > invTransform ( const Field< Type > &  ) const

Inverse transform the given field.

◆ invTransform() [4/6]

tmp<Field<Type> > invTransform ( const tmp< Field< Type >> &  ) const

Inverse transform the given field.

◆ invTransformList()

void invTransformList ( Container< Type > &  l) const

Inverse transform the given container.

Definition at line 166 of file transformerTemplates.C.

References forAllIter, Foam::transform(), and transforms.

Here is the call graph for this function:

◆ transform() [5/12]

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

Definition at line 167 of file transformer.C.

References fld().

Here is the call graph for this function:

◆ transform() [6/12]

tmp< Field< bool > > transform ( const tmp< Field< bool >> &  tfld) const

Definition at line 177 of file transformer.C.

◆ transform() [7/12]

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

Definition at line 187 of file transformer.C.

References fld().

Here is the call graph for this function:

◆ transform() [8/12]

tmp< Field< label > > transform ( const tmp< Field< label >> &  tfld) const

Definition at line 197 of file transformer.C.

◆ transform() [9/12]

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

Definition at line 207 of file transformer.C.

References fld().

Here is the call graph for this function:

◆ transform() [10/12]

tmp< Field< scalar > > transform ( const tmp< Field< scalar >> &  tfld) const

Definition at line 217 of file transformer.C.

◆ transform() [11/12]

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

Definition at line 57 of file transformerTemplates.C.

References fld(), Foam::T(), Foam::transform(), and transforms.

Here is the call graph for this function:

◆ transform() [12/12]

Foam::tmp<Foam::Field<Type> > transform ( const tmp< Field< Type >> &  tfld) const

Definition at line 74 of file transformerTemplates.C.

References Foam::T(), Foam::transform(), and transforms.

Here is the call graph for this function:

◆ invTransform() [5/6]

Foam::tmp<Foam::Field<Type> > invTransform ( const Field< Type > &  fld) const

Definition at line 132 of file transformerTemplates.C.

References fld(), Foam::transform(), and transforms.

Here is the call graph for this function:

◆ invTransform() [6/6]

Foam::tmp<Foam::Field<Type> > invTransform ( const tmp< Field< Type >> &  tfld) const

Definition at line 149 of file transformerTemplates.C.

References Foam::transform(), and transforms.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ inv

transformer inv ( const transformer tr)
friend

Return the inverse of the given transformer.

◆ operator==

bool operator== ( const transformer tr1,
const transformer tr2 
)
friend

◆ operator!=

bool operator!= ( const transformer tr1,
const transformer tr2 
)
friend

◆ operator&

transformer operator& ( const transformer tr1,
const transformer tr2 
)
friend

◆ operator>>

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

◆ operator<<

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

Member Data Documentation

◆ typeName

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

Definition at line 121 of file transformer.H.

◆ zero

const Foam::transformer zero
static

Definition at line 123 of file transformer.H.

◆ I

const Foam::transformer I
static

Definition at line 124 of file transformer.H.

◆ null

const Foam::transformer null
static

Null transformer.

Definition at line 127 of file transformer.H.

Referenced by processorPolyPatch::transform().


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