All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
transformer Class Reference

Vector-tensor class used to perform translations and rotations 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<>
tmp< Field< bool > > transform (const Field< bool > &) const
 
template<>
tmp< Field< bool > > transform (const tmp< Field< bool >> &) const
 
template<>
tmp< Field< label > > transform (const Field< label > &) const
 
template<>
tmp< Field< label > > transform (const tmp< Field< label >> &) const
 
template<>
tmp< Field< scalar > > transform (const Field< scalar > &) const
 
template<>
tmp< Field< scalar > > transform (const tmp< Field< scalar >> &) 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 and rotations 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 Foam::inv(), Foam::operator!=(), transformer::rotation(), transformer::scaling(), and 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, and transformer::transformer().

Referenced by NamedEnum< compressibleField, 8 >::names().

Here is the call graph for this function:
Here is the caller 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 transformer::transformer(), and VectorSpace< Vector< scalar >, scalar, 3 >::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 transformer::rotates(), transformer::scales(), transformer::t(), transformer::T(), transformer::transformer(), transformer::translates(), and VectorSpace< Vector< scalar >, scalar, 3 >::zero.

Referenced by particle< Type >::hitSymmetryPatch(), and NamedEnum< compressibleField, 8 >::names().

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::inv(), transformer::invTransformPosition(), Foam::name(), Foam::operator==(), transformer::rotation(), and transformer::transformPosition().

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 transformer::transforms().

Referenced by transformer::rotation().

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

◆ T()

◆ 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, transformer::inv, transformer::T(), and Tensor< Cmpt >::T().

Referenced by Foam::inv(), transformer::invTransform(), transformer::invTransformList(), and transformer::invTransformPosition().

Here is the call graph for this function:
Here is the caller 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.

Referenced by transformer::rotation().

Here is the caller graph for this function:

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

Referenced by transformer::rotation().

Here is the caller graph for this function:

◆ transforms() [1/2]

◆ transforms() [2/2]

bool transforms ( ) const
inline

Return true if the transformer transforms the given type.

(i.e. scales or rotates)

Definition at line 140 of file transformerI.H.

References transformer::transforms().

Here is the call graph for this function:

◆ transformsPosition()

◆ transformPosition() [1/3]

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

◆ transformPosition() [2/3]

void transformPosition ( pointField res,
const pointField pts 
) const

Transform the given pointField.

Definition at line 77 of file transformer.C.

References transformer::t(), transformer::T(), transformer::transformPosition(), and transformer::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 98 of file transformer.C.

References transformer::invTransformPosition(), transformer::t(), transformer::T(), and transformer::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 177 of file transformerI.H.

References transformer::invT(), p, transformer::t(), and transformer::transforms().

Referenced by transformer::invTransformPosition(), mapDistribute::transformPosition::operator()(), particle< Type >::prepareForInteractionListReferral(), and transformer::transformPosition().

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

◆ invTransformPosition() [2/3]

void invTransformPosition ( pointField res,
const pointField pts 
) const

Inverse transform the given pointField.

Definition at line 146 of file transformer.C.

References transformer::t(), transformer::T(), Tensor< Cmpt >::T(), transformer::transform(), and transformer::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 122 of file transformer.C.

References transformer::invTransformPosition(), transformer::t(), transformer::T(), Tensor< Cmpt >::T(), and transformer::transforms().

Here is the call graph for this function:

◆ transform() [1/18]

◆ transform() [2/18]

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

Transform the given field.

Definition at line 44 of file transformerTemplates.C.

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

Here is the call graph for this function:

◆ transform() [3/18]

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

Transform the given field.

◆ transform() [4/18]

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, transformer::T(), Foam::transform(), and transformer::transforms().

Referenced by mapDistribute::transform::operator()(), and molecule::transformProperties().

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 transformer::invT(), Foam::transform(), transformer::transforms(), and x.

Referenced by transformer::invTransform().

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 119 of file transformerTemplates.C.

References transformer::invT(), transformer::invTransform(), Foam::transform(), and transformer::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, transformer::invT(), Foam::transform(), and transformer::transforms().

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

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

◆ transform() [5/18]

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

Definition at line 168 of file transformer.C.

References fld(), and transformer::transform().

Here is the call graph for this function:

◆ transform() [6/18]

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

Definition at line 178 of file transformer.C.

References transformer::transform().

Here is the call graph for this function:

◆ transform() [7/18]

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

Definition at line 188 of file transformer.C.

References fld(), and transformer::transform().

Here is the call graph for this function:

◆ transform() [8/18]

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

Definition at line 198 of file transformer.C.

References transformer::transform().

Here is the call graph for this function:

◆ transform() [9/18]

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

Definition at line 208 of file transformer.C.

References fld(), and transformer::transform().

Here is the call graph for this function:

◆ transform() [10/18]

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

Definition at line 218 of file transformer.C.

◆ transform() [11/18]

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

◆ transform() [12/18]

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

◆ transform() [13/18]

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

◆ transform() [14/18]

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

◆ transform() [15/18]

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

◆ transform() [16/18]

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

◆ transform() [17/18]

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

Definition at line 58 of file transformerTemplates.C.

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

Here is the call graph for this function:

◆ transform() [18/18]

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

Definition at line 75 of file transformerTemplates.C.

References transformer::T(), Foam::transform(), and transformer::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 133 of file transformerTemplates.C.

References fld(), transformer::invT(), transformer::invTransform(), Foam::transform(), and transformer::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 150 of file transformerTemplates.C.

References transformer::invT(), Foam::transform(), and transformer::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.

Referenced by transformer::invT().

◆ operator==

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

Referenced by Foam::operator!=().

◆ 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

◆ null

const Foam::transformer null
static

Null transformer.

Definition at line 128 of file transformer.H.

Referenced by processorPolyPatch::transform().


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