FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

Tensor< Cmpt > Class Template Reference

Templated 3D tensor derived from VectorSpace adding construction from 9 components, element access using xx(), xy() etc. member functions and the inner-product (dot-product) and outer-product of two Vectors (tensor-product) operators. More...

#include <OpenFOAM/Tensor_.H>


Detailed Description

template<class Cmpt>
class Foam::Tensor< Cmpt >

Templated 3D tensor derived from VectorSpace adding construction from 9 components, element access using xx(), xy() etc. member functions and the inner-product (dot-product) and outer-product of two Vectors (tensor-product) operators.

Source files

Definition at line 57 of file Tensor_.H.

Inheritance diagram for Tensor< Cmpt >:
Collaboration diagram for Tensor< Cmpt >:

List of all members.

Public Types

enum  { rank = 2 }
enum  components {
  XX, XY, XZ, YX,
  YY, YZ, ZX, ZY,
  ZZ
}
 

Component labeling enumeration.

More...
typedef Tensor< label >  labelType
 Equivalent type of labels used for valid component indexing.

Public Member Functions

 Tensor ()
 Construct null.
 Tensor (const VectorSpace< Tensor< Cmpt >, Cmpt, 9 > &)
 Construct given VectorSpace.
 Tensor (const SphericalTensor< Cmpt > &)
 Construct given SphericalTensor.
 Tensor (const SymmTensor< Cmpt > &)
 Construct given SymmTensor.
 Tensor (const Vector< Cmpt > &x, const Vector< Cmpt > &y, const Vector< Cmpt > &z)
 Construct given the three vectors.
 Tensor (const Cmpt txx, const Cmpt txy, const Cmpt txz, const Cmpt tyx, const Cmpt tyy, const Cmpt tyz, const Cmpt tzx, const Cmpt tzy, const Cmpt tzz)
 Construct given the nine components.
 Tensor (Istream &)
 Construct from Istream.
const Cmpt &  xx () const
const Cmpt &  xy () const
const Cmpt &  xz () const
const Cmpt &  yx () const
const Cmpt &  yy () const
const Cmpt &  yz () const
const Cmpt &  zx () const
const Cmpt &  zy () const
const Cmpt &  zz () const
Cmpt &  xx ()
Cmpt &  xy ()
Cmpt &  xz ()
Cmpt &  yx ()
Cmpt &  yy ()
Cmpt &  yz ()
Cmpt &  zx ()
Cmpt &  zy ()
Cmpt &  zz ()
const Vector< Cmpt >  x () const
const Vector< Cmpt >  y () const
const Vector< Cmpt >  z () const
Tensor< Cmpt >  T () const
 Transpose.
void  operator= (const SphericalTensor< Cmpt > &)
 Assign to a SphericalTensor.
void  operator= (const SymmTensor< Cmpt > &)
 Assign to a SymmTensor.

Static Public Attributes

static const char *const  typeName = "labelTensor"
static const char *  componentNames []
static const Tensor  zero
static const Tensor  one
static const Tensor  max
static const Tensor  min

Member Typedef Documentation

typedef Tensor<label> labelType

Equivalent type of labels used for valid component indexing.

Definition at line 65 of file Tensor_.H.


Member Enumeration Documentation

anonymous enum
Enumerator:
rank 

Definition at line 70 of file Tensor_.H.

enum components

Component labeling enumeration.

Enumerator:
XX 
XY 
XZ 
YX 
YY 
YZ 
ZX 
ZY 
ZZ 

Definition at line 88 of file Tensor_.H.


Constructor & Destructor Documentation

Tensor (  ) [inline]

Construct null.

Definition at line 37 of file TensorI_.H.

Tensor ( const VectorSpace< Tensor< Cmpt >, Cmpt, 9 > &   vs  ) [inline]

Construct given VectorSpace.

Definition at line 43 of file TensorI_.H.

Tensor ( const SphericalTensor< Cmpt > &   st  ) [inline]

Construct given SphericalTensor.

Definition at line 51 of file TensorI_.H.

References SphericalTensor< Cmpt >::ii().

Tensor ( const Vector< Cmpt > &   x,
const Vector< Cmpt > &   y,
const Vector< Cmpt > &   z  
) [inline]

Construct given the three vectors.

Construct given the three vector components.

Definition at line 72 of file TensorI_.H.

References Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

Tensor ( const Cmpt   txx,
const Cmpt   txy,
const Cmpt   txz,
const Cmpt   tyx,
const Cmpt   tyy,
const Cmpt   tyz,
const Cmpt   tzx,
const Cmpt   tzy,
const Cmpt   tzz  
) [inline]

Construct given the nine components.

Construct from components.

Definition at line 87 of file TensorI_.H.

Tensor ( Istream &   is  ) [inline]

Construct from Istream.

Definition at line 101 of file TensorI_.H.


Member Function Documentation

Cmpt & xx (  ) [inline]

Definition at line 186 of file TensorI_.H.

Cmpt & xy (  ) [inline]

Definition at line 192 of file TensorI_.H.

Cmpt & xz (  ) [inline]

Definition at line 198 of file TensorI_.H.

Cmpt & yx (  ) [inline]

Definition at line 205 of file TensorI_.H.

Cmpt & yy (  ) [inline]

Definition at line 211 of file TensorI_.H.

Cmpt & yz (  ) [inline]

Definition at line 217 of file TensorI_.H.

Cmpt & zx (  ) [inline]

Definition at line 224 of file TensorI_.H.

Cmpt & zy (  ) [inline]

Definition at line 230 of file TensorI_.H.

Cmpt & zz (  ) [inline]

Definition at line 236 of file TensorI_.H.

const Vector< Cmpt > x (  ) const [inline]
const Vector< Cmpt > y (  ) const [inline]
const Vector< Cmpt > z (  ) const [inline]
void operator= ( const SphericalTensor< Cmpt > &   st  ) [inline]

Assign to a SphericalTensor.

Definition at line 258 of file TensorI_.H.

References SphericalTensor< Cmpt >::ii().

void operator= ( const SymmTensor< Cmpt > &   st  ) [inline]

Member Data Documentation

const char *const typeName = "labelTensor" [static]

Definition at line 78 of file Tensor_.H.

const char * componentNames [static]
Initial value:
{
    "xx", "xy", "xz",
    "yx", "yy", "yz",
    "zx", "zy", "zz"
}

Definition at line 79 of file Tensor_.H.

const Foam::labelTensor zero [static]

Definition at line 81 of file Tensor_.H.

const Foam::labelTensor one [static]

Definition at line 82 of file Tensor_.H.

const Tensor max [static]

Definition at line 83 of file Tensor_.H.

const Tensor min [static]

Definition at line 84 of file Tensor_.H.


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