Public Types | Public Member Functions | Static Public Attributes | List of all members
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...

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

Public Types

enum  { rank = 2 }
 
enum  components {
  XX, XY, XZ, YX,
  YY, YZ, ZX, ZY,
  ZZ
}
 Component labeling enumeration. More...
 
typedef Tensor< labellabelType
 Equivalent type of labels used for valid component indexing. More...
 
- Public Types inherited from VectorSpace< Tensor< Cmpt >, Cmpt, 9 >
enum  
 
typedef Cmpt cmptType
 Component type. More...
 

Public Member Functions

 Tensor ()
 Construct null. More...
 
template<class Cmpt2 >
 Tensor (const VectorSpace< Tensor< Cmpt2 >, Cmpt2, 9 > &)
 Construct given VectorSpace of the same rank. More...
 
 Tensor (const SphericalTensor< Cmpt > &)
 Construct given SphericalTensor. More...
 
 Tensor (const SymmTensor< Cmpt > &)
 Construct given SymmTensor. More...
 
 Tensor (const Vector< Vector< Cmpt > > &)
 Construct given triad. More...
 
 Tensor (const Vector< Cmpt > &x, const Vector< Cmpt > &y, const Vector< Cmpt > &z)
 Construct given the three vector components. More...
 
 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. More...
 
 Tensor (Istream &)
 Construct from Istream. More...
 
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 ()
 
Vector< Cmpt > x () const
 
Vector< Cmpt > y () const
 
Vector< Cmpt > z () const
 
Vector< Cmpt > vectorComponent (const direction) const
 
Tensor< Cmpt > T () const
 Transpose. More...
 
void operator= (const SphericalTensor< Cmpt > &)
 Assign to a SphericalTensor. More...
 
void operator= (const SymmTensor< Cmpt > &)
 Assign to a SymmTensor. More...
 
void operator= (const Vector< Vector< Cmpt > > &)
 Assign to a triad. More...
 
- Public Member Functions inherited from VectorSpace< Tensor< Cmpt >, Cmpt, 9 >
 VectorSpace ()
 Construct null. More...
 
 VectorSpace (Istream &)
 Construct from Istream. More...
 
 VectorSpace (const VectorSpace< Tensor< Cmpt >, 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< Tensor< Cmpt >, Cmpt, nCmpt > &)
 
void operator+= (const VectorSpace< Tensor< Cmpt >, Cmpt, nCmpt > &)
 
void operator-= (const VectorSpace< Tensor< Cmpt >, Cmpt, nCmpt > &)
 
void operator*= (const scalar)
 
void operator/= (const scalar)
 

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
 
static const Tensor I
 

Additional Inherited Members

- Public Attributes inherited from VectorSpace< Tensor< Cmpt >, Cmpt, 9 >
Cmpt v_ [nCmpt]
 The components of this vector space. More...
 

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 224 of file complexI.H.

Member Typedef Documentation

Equivalent type of labels used for valid component indexing.

Definition at line 64 of file Tensor.H.

Member Enumeration Documentation

anonymous enum
Enumerator
rank 

Definition at line 69 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 36 of file TensorI.H.

Referenced by Tensor< Cmpt >::Tensor().

Here is the caller graph for this function:

Tensor ( const VectorSpace< Tensor< Cmpt2 >, Cmpt2, 9 > &  vs)
inline

Construct given VectorSpace of the same rank.

Definition at line 42 of file TensorI.H.

Tensor ( const SphericalTensor< Cmpt > &  st)
inline
Tensor ( const SymmTensor< Cmpt > &  st)
inline
Tensor ( const Vector< Vector< Cmpt > > &  tr)
inline
Tensor ( const Vector< Cmpt > &  x,
const Vector< Cmpt > &  y,
const Vector< Cmpt > &  z 
)
inline
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
Tensor ( Istream is)
inline

Construct from Istream.

Definition at line 112 of file TensorI.H.

Member Function Documentation

const Cmpt & xx ( ) const
inline
const Cmpt & xy ( ) const
inline
const Cmpt & xz ( ) const
inline
const Cmpt & yx ( ) const
inline
const Cmpt & yy ( ) const
inline
const Cmpt & yz ( ) const
inline
const Cmpt & zx ( ) const
inline
const Cmpt & zy ( ) const
inline
const Cmpt & zz ( ) const
inline
Cmpt & xx ( )
inline

Definition at line 223 of file TensorI.H.

References VectorSpace< Tensor< Cmpt >, Cmpt, 9 >::v_, and Tensor< Cmpt >::XX.

Cmpt & xy ( )
inline

Definition at line 230 of file TensorI.H.

References VectorSpace< Tensor< Cmpt >, Cmpt, 9 >::v_, and Tensor< Cmpt >::XY.

Cmpt & xz ( )
inline

Definition at line 237 of file TensorI.H.

References VectorSpace< Tensor< Cmpt >, Cmpt, 9 >::v_, and Tensor< Cmpt >::XZ.

Cmpt & yx ( )
inline

Definition at line 244 of file TensorI.H.

References VectorSpace< Tensor< Cmpt >, Cmpt, 9 >::v_, and Tensor< Cmpt >::YX.

Cmpt & yy ( )
inline

Definition at line 251 of file TensorI.H.

References VectorSpace< Tensor< Cmpt >, Cmpt, 9 >::v_, and Tensor< Cmpt >::YY.

Cmpt & yz ( )
inline

Definition at line 258 of file TensorI.H.

References VectorSpace< Tensor< Cmpt >, Cmpt, 9 >::v_, and Tensor< Cmpt >::YZ.

Cmpt & zx ( )
inline

Definition at line 265 of file TensorI.H.

References VectorSpace< Tensor< Cmpt >, Cmpt, 9 >::v_, and Tensor< Cmpt >::ZX.

Cmpt & zy ( )
inline

Definition at line 272 of file TensorI.H.

References VectorSpace< Tensor< Cmpt >, Cmpt, 9 >::v_, and Tensor< Cmpt >::ZY.

Cmpt & zz ( )
inline

Definition at line 279 of file TensorI.H.

References VectorSpace< Tensor< Cmpt >, Cmpt, 9 >::v_, and Tensor< Cmpt >::ZZ.

Vector< Cmpt > x ( ) const
inline
Vector< Cmpt > y ( ) const
inline
Vector< Cmpt > z ( ) const
inline
Vector< Cmpt > vectorComponent ( const direction  cmpt) const
inline

Definition at line 142 of file TensorI.H.

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

Here is the call graph for this function:

Tensor< Cmpt > T ( ) const
inline
void operator= ( const SphericalTensor< Cmpt > &  st)
inline
void operator= ( const SymmTensor< Cmpt > &  st)
inline
void operator= ( const Vector< Vector< Cmpt > > &  tr)
inline

Member Data Documentation

const char *const typeName = "labelTensor"
static

Definition at line 77 of file Tensor.H.

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

Definition at line 78 of file Tensor.H.

const Foam::labelTensor zero
static

Definition at line 80 of file Tensor.H.

const Foam::labelTensor one
static

Definition at line 81 of file Tensor.H.

const Tensor max
static

Definition at line 82 of file Tensor.H.

const Tensor min
static

Definition at line 83 of file Tensor.H.

const Tensor I
static

Definition at line 84 of file Tensor.H.


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