Public Types | Public Member Functions | Static Public Attributes
Tensor2D< Cmpt > Class Template Reference

Templated 2D tensor derived from VectorSpace adding construction from 4 components, element access using xx(), xy(), yx() and yy() member functions and the iner-product (dot-product) and outer-product of two Vector2Ds (tensor-product) operators. More...

Inheritance diagram for Tensor2D< Cmpt >:
Inheritance graph
[legend]
Collaboration diagram for Tensor2D< Cmpt >:
Collaboration graph
[legend]

Public Types

enum  { rank = 2 }
 
enum  components { XX, XY, YX, YY }
 Component labeling enumeration. More...
 
- Public Types inherited from VectorSpace< Tensor2D< Cmpt >, Cmpt, 4 >
enum  
 
typedef Cmpt cmptType
 Component type. More...
 

Public Member Functions

 Tensor2D ()
 Construct null. More...
 
 Tensor2D (const VectorSpace< Tensor2D< Cmpt >, Cmpt, 4 > &)
 Construct given VectorSpace. More...
 
 Tensor2D (const SymmTensor2D< Cmpt > &)
 Construct given SymmTensor2D. More...
 
 Tensor2D (const SphericalTensor2D< Cmpt > &)
 Construct given SphericalTensor2D. More...
 
 Tensor2D (const Vector2D< Cmpt > &x, const Vector2D< Cmpt > &y)
 Construct given the two vectors. More...
 
 Tensor2D (const Cmpt txx, const Cmpt txy, const Cmpt tyx, const Cmpt tyy)
 Construct given the four components. More...
 
 Tensor2D (Istream &)
 Construct from Istream. More...
 
const Cmpt & xx () const
 
const Cmpt & xy () const
 
const Cmpt & yx () const
 
const Cmpt & yy () const
 
Cmpt & xx ()
 
Cmpt & xy ()
 
Cmpt & yx ()
 
Cmpt & yy ()
 
Vector2D< Cmpt > x () const
 
Vector2D< Cmpt > y () const
 
Tensor2D< Cmpt > T () const
 Transpose. More...
 
void operator= (const SymmTensor2D< Cmpt > &)
 Copy SymmTensor2D. More...
 
void operator= (const SphericalTensor2D< Cmpt > &)
 Copy SphericalTensor2D. More...
 
- Public Member Functions inherited from VectorSpace< Tensor2D< Cmpt >, Cmpt, 4 >
 VectorSpace ()
 Construct null. More...
 
 VectorSpace (Istream &)
 Construct from Istream. More...
 
 VectorSpace (const VectorSpace< Form, Cmpt, nCmpt > &)
 Construct as copy. More...
 
 VectorSpace (const VectorSpace< Form2, Cmpt2, nCmpt > &)
 Construct as copy of another VectorSpace type of the same rank. More...
 
label size () const
 Return the number of elements in the VectorSpace = nCmpt. More...
 
const Cmpt & component (const direction) const
 
Cmpt & component (const direction)
 
void component (Cmpt &, const direction) const
 
void replace (const direction, const Cmpt &)
 
const Cmpt & operator[] (const direction) const
 
Cmpt & operator[] (const direction)
 
void operator= (const VectorSpace< Form, Cmpt, nCmpt > &)
 
void operator+= (const VectorSpace< Form, Cmpt, nCmpt > &)
 
void operator-= (const VectorSpace< Form, Cmpt, nCmpt > &)
 
void operator*= (const scalar)
 
void operator/= (const scalar)
 

Static Public Attributes

static const char *const typeName = "tensor2D"
 
static const char * componentNames []
 
static const Tensor2D zero
 
static const Tensor2D one
 
static const Tensor2D max
 
static const Tensor2D min
 
static const Tensor2D I
 

Additional Inherited Members

- Data Fields inherited from VectorSpace< Tensor2D< Cmpt >, Cmpt, 4 >
Cmpt v_ [nCmpt]
 The components of this vector space. More...
 

Detailed Description

template<class Cmpt>
class Foam::Tensor2D< Cmpt >

Templated 2D tensor derived from VectorSpace adding construction from 4 components, element access using xx(), xy(), yx() and yy() member functions and the iner-product (dot-product) and outer-product of two Vector2Ds (tensor-product) operators.

Source files

Definition at line 56 of file Tensor2D.H.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
rank 

Definition at line 65 of file Tensor2D.H.

◆ components

enum components

Component labeling enumeration.

Enumerator
XX 
XY 
YX 
YY 

Definition at line 84 of file Tensor2D.H.

Constructor & Destructor Documentation

◆ Tensor2D() [1/7]

Tensor2D
inline

Construct null.

Definition at line 34 of file Tensor2DI.H.

◆ Tensor2D() [2/7]

Tensor2D ( const VectorSpace< Tensor2D< Cmpt >, Cmpt, 4 > &  vs)
inline

Construct given VectorSpace.

Definition at line 39 of file Tensor2DI.H.

◆ Tensor2D() [3/7]

Tensor2D ( const SymmTensor2D< Cmpt > &  st)
inline

Construct given SymmTensor2D.

Definition at line 46 of file Tensor2DI.H.

References SymmTensor2D< Cmpt >::xx(), SymmTensor2D< Cmpt >::xy(), and SymmTensor2D< Cmpt >::yy().

Here is the call graph for this function:

◆ Tensor2D() [4/7]

Tensor2D ( const SphericalTensor2D< Cmpt > &  st)
inline

Construct given SphericalTensor2D.

Definition at line 54 of file Tensor2DI.H.

References SphericalTensor2D< Cmpt >::ii().

Here is the call graph for this function:

◆ Tensor2D() [5/7]

Tensor2D ( const Vector2D< Cmpt > &  x,
const Vector2D< Cmpt > &  y 
)
inline

Construct given the two vectors.

Definition at line 63 of file Tensor2DI.H.

References x, and y.

◆ Tensor2D() [6/7]

Tensor2D ( const Cmpt  txx,
const Cmpt  txy,
const Cmpt  tyx,
const Cmpt  tyy 
)
inline

Construct given the four components.

Definition at line 75 of file Tensor2DI.H.

◆ Tensor2D() [7/7]

Tensor2D ( Istream is)
inline

Construct from Istream.

Definition at line 86 of file Tensor2DI.H.

Member Function Documentation

◆ xx() [1/2]

Cmpt & xx
inline

◆ xy() [1/2]

Cmpt & xy
inline

◆ yx() [1/2]

Cmpt & yx
inline

◆ yy() [1/2]

Cmpt & yy
inline

◆ xx() [2/2]

Cmpt& xx ( )
inline

◆ xy() [2/2]

Cmpt& xy ( )
inline

◆ yx() [2/2]

Cmpt& yx ( )
inline

◆ yy() [2/2]

Cmpt& yy ( )
inline

◆ x()

Vector2D< Cmpt > x
inline

Definition at line 95 of file Tensor2DI.H.

Referenced by calcCurvature().

Here is the caller graph for this function:

◆ y()

Vector2D< Cmpt > y
inline

Definition at line 101 of file Tensor2DI.H.

Referenced by calcCurvature().

Here is the caller graph for this function:

◆ T()

Tensor2D< Cmpt > T
inline

Transpose.

Definition at line 158 of file Tensor2DI.H.

◆ operator=() [1/2]

void operator= ( const SymmTensor2D< Cmpt > &  st)
inline

Copy SymmTensor2D.

Definition at line 171 of file Tensor2DI.H.

References SymmTensor2D< Cmpt >::xx(), SymmTensor2D< Cmpt >::xy(), and SymmTensor2D< Cmpt >::yy().

Here is the call graph for this function:

◆ operator=() [2/2]

void operator= ( const SphericalTensor2D< Cmpt > &  st)
inline

Copy SphericalTensor2D.

Definition at line 179 of file Tensor2DI.H.

References SphericalTensor2D< Cmpt >::ii().

Here is the call graph for this function:

Field Documentation

◆ typeName

const char *const typeName = "tensor2D"
static

Definition at line 73 of file Tensor2D.H.

◆ componentNames

const char * componentNames
static
Initial value:
=
{
"xx", "xy",
"yx", "yy"
}

Definition at line 74 of file Tensor2D.H.

◆ zero

const tensor2D zero
static

Definition at line 76 of file Tensor2D.H.

◆ one

const tensor2D one
static

Definition at line 77 of file Tensor2D.H.

◆ max

const tensor2D max
static

Definition at line 78 of file Tensor2D.H.

◆ min

const tensor2D min
static

Definition at line 79 of file Tensor2D.H.

◆ I

const tensor2D I
static

Definition at line 80 of file Tensor2D.H.


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