Public Types | Public Member Functions | Static Public Attributes | List of all members
Tensor Class Reference

A templated (3 x 3) tensor of objects of <T> derived from MatrixSpace. More...

Inheritance diagram for Tensor:
Inheritance graph
[legend]
Collaboration diagram for Tensor:
Collaboration graph
[legend]

Public Types

enum  components {
  XX, XY, XZ, YX,
  YY, YZ, ZX, ZY,
  ZZ
}
 
typedef Tensor< label > labelType
 

Public Member Functions

 Tensor ()=default
 
 Tensor (const Tensor &)=default
 
Tensoroperator= (const Tensor &)=default
 
 Tensor (const Foam::zero)
 
template<class Cmpt2 >
 Tensor (const MatrixSpace< Tensor< Cmpt2 >, Cmpt2, 3, 3 > &vs)
 
template<class Cmpt2 >
 Tensor (const VectorSpace< Tensor< Cmpt2 >, Cmpt2, 9 > &vs)
 
 Tensor (const SphericalTensor< Cmpt > &st)
 
 Tensor (const SymmTensor< Cmpt > &st)
 
 Tensor (const Vector< Vector< Cmpt >> &vecs, const bool transposed=false)
 
 Tensor (const Vector< Cmpt > &x, const Vector< Cmpt > &y, const Vector< Cmpt > &z, const bool transposed=false)
 
 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)
 
template<template< class, direction, direction > class Block2, direction BRowStart, direction BColStart>
 Tensor (const Block2< Tensor< Cmpt >, BRowStart, BColStart > &block)
 
 Tensor (Istream &is)
 
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 > cx () const
 
Vector< Cmpt > cy () const
 
Vector< Cmpt > cz () const
 
template<direction Col>
Vector< Cmpt > col () const
 
Vector< Cmpt > col (const direction c) const
 
template<direction Col>
void col (const Vector< Cmpt > &v)
 
void col (const direction c, const Vector< Cmpt > &v)
 
void cols (const Vector< Cmpt > &x, const Vector< Cmpt > &y, const Vector< Cmpt > &z)
 
Vector< Cmpt > x () const
 
Vector< Cmpt > y () const
 
Vector< Cmpt > z () const
 
template<direction Row>
Vector< Cmpt > row () const
 
Vector< Cmpt > row (const direction r) const
 
template<direction Row>
void row (const Vector< Cmpt > &v)
 
void row (const direction r, const Vector< Cmpt > &v)
 
void rows (const Vector< Cmpt > &x, const Vector< Cmpt > &y, const Vector< Cmpt > &z)
 
Vector< Cmpt > diag () const
 
void diag (const Vector< Cmpt > &v)
 
Tensor< Cmpt > T () const
 
Tensor< Cmpt > inv () const
 
Tensor< Cmpt > inner (const Tensor< Cmpt > &t2) const
 
Tensor< Cmpt > schur (const Tensor< Cmpt > &t2) const
 
void operator&= (const Tensor< Cmpt > &t)
 
template<class Cmpt2 >
void operator= (const VectorSpace< Tensor< Cmpt2 >, Cmpt2, 9 > &)
 
void operator= (const SphericalTensor< Cmpt > &)
 
void operator= (const SymmTensor< Cmpt > &)
 
void operator= (const Vector< Vector< Cmpt >> &)
 
Vector< Cmpt > vectorComponent (const direction cmpt) const
 
template<class Cmpt >
 Tensor (const Foam::zero)
 
template<class Cmpt >
 Tensor (const SphericalTensor< Cmpt > &st)
 
template<class Cmpt >
 Tensor (const SymmTensor< Cmpt > &st)
 
template<class Cmpt >
 Tensor (const Vector< Vector< Cmpt >> &vecs, const bool transposed)
 
template<class Cmpt >
 Tensor (const Vector< Cmpt > &x, const Vector< Cmpt > &y, const Vector< Cmpt > &z, const bool transposed)
 
template<class Cmpt >
 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)
 
template<class Cmpt >
 Tensor (Istream &is)
 
template<Foam::direction Col>
Foam::Vector< Cmpt > col () const
 
template<class Cmpt >
Foam::Vector< Cmpt > col (const direction c) const
 
template<Foam::direction Row>
Foam::Vector< Cmpt > row () const
 
template<class Cmpt >
Foam::Vector< Cmpt > row (const direction r) const
 
template<class Cmpt >
void col (const direction c, const Vector< Cmpt > &v)
 
template<class Cmpt >
void row (const direction r, const Vector< Cmpt > &v)
 
template<class Cmpt >
void operator= (const SphericalTensor< Cmpt > &st)
 
template<class Cmpt >
void operator= (const SymmTensor< Cmpt > &st)
 
template<class Cmpt >
void operator= (const Vector< Vector< Cmpt >> &tr)
 

Static Public Attributes

static constexpr direction rank = 2
 
static const Tensor I
 

Detailed Description

A templated (3 x 3) tensor of objects of <T> derived from MatrixSpace.

See also
Test-Tensor.C
Source files
See also
Foam::MatrixSpace Foam::Vector

Definition at line 268 of file complexI.H.

Member Typedef Documentation

◆ labelType

typedef Tensor<label> labelType

Definition at line 70 of file Tensor.H.

Member Enumeration Documentation

◆ components

enum components
Enumerator
XX 
XY 
XZ 
YX 
YY 
YZ 
ZX 
ZY 
ZZ 

Definition at line 85 of file Tensor.H.

Constructor & Destructor Documentation

◆ Tensor() [1/19]

Tensor ( )
default

◆ Tensor() [2/19]

Tensor ( const Tensor )
default

◆ Tensor() [3/19]

Tensor ( const Foam::zero  )
inline

◆ Tensor() [4/19]

Tensor ( const MatrixSpace< Tensor< Cmpt2 >, Cmpt2, 3, 3 > &  vs)
inline

Definition at line 37 of file TensorI.H.

◆ Tensor() [5/19]

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

Definition at line 48 of file TensorI.H.

◆ Tensor() [6/19]

Tensor ( const SphericalTensor< Cmpt > &  st)
inline

◆ Tensor() [7/19]

Tensor ( const SymmTensor< Cmpt > &  st)
inline

◆ Tensor() [8/19]

Tensor ( const Vector< Vector< Cmpt >> &  vecs,
const bool  transposed = false 
)
inline

◆ Tensor() [9/19]

Tensor ( const Vector< Cmpt > &  x,
const Vector< Cmpt > &  y,
const Vector< Cmpt > &  z,
const bool  transposed = false 
)
inline

◆ Tensor() [10/19]

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() [11/19]

Tensor ( const Block2< Tensor< Cmpt >, BRowStart, BColStart > &  block)
inline

Definition at line 127 of file TensorI.H.

◆ Tensor() [12/19]

Tensor ( Istream is)
inlineexplicit

◆ Tensor() [13/19]

Tensor ( const Foam::zero  )
inline

Definition at line 28 of file TensorI.H.

◆ Tensor() [14/19]

Tensor ( const SphericalTensor< Cmpt > &  st)
inline

Definition at line 57 of file TensorI.H.

◆ Tensor() [15/19]

Tensor ( const SymmTensor< Cmpt > &  st)
inline

Definition at line 66 of file TensorI.H.

◆ Tensor() [16/19]

Tensor ( const Vector< Vector< Cmpt >> &  vecs,
const bool  transposed 
)
inline

Definition at line 76 of file TensorI.H.

◆ Tensor() [17/19]

Tensor ( const Vector< Cmpt > &  x,
const Vector< Cmpt > &  y,
const Vector< Cmpt > &  z,
const bool  transposed 
)
inline

Definition at line 87 of file TensorI.H.

◆ Tensor() [18/19]

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

Definition at line 107 of file TensorI.H.

◆ Tensor() [19/19]

Tensor ( Istream is)
inline

Definition at line 136 of file TensorI.H.

Member Function Documentation

◆ operator=() [1/8]

Tensor& operator= ( const Tensor )
default

◆ xx() [1/2]

const Cmpt & xx ( ) const
inline

◆ xy() [1/2]

const Cmpt & xy ( ) const
inline

◆ xz() [1/2]

const Cmpt & xz ( ) const
inline

◆ yx() [1/2]

const Cmpt & yx ( ) const
inline

◆ yy() [1/2]

const Cmpt & yy ( ) const
inline

◆ yz() [1/2]

const Cmpt & yz ( ) const
inline

◆ zx() [1/2]

const Cmpt & zx ( ) const
inline

◆ zy() [1/2]

const Cmpt & zy ( ) const
inline

◆ zz() [1/2]

const Cmpt & zz ( ) const
inline

◆ xx() [2/2]

Cmpt & xx ( )
inline

Definition at line 208 of file TensorI.H.

◆ xy() [2/2]

Cmpt & xy ( )
inline

Definition at line 215 of file TensorI.H.

◆ xz() [2/2]

Cmpt & xz ( )
inline

Definition at line 222 of file TensorI.H.

◆ yx() [2/2]

Cmpt & yx ( )
inline

Definition at line 229 of file TensorI.H.

◆ yy() [2/2]

Cmpt & yy ( )
inline

Definition at line 236 of file TensorI.H.

◆ yz() [2/2]

Cmpt & yz ( )
inline

Definition at line 243 of file TensorI.H.

◆ zx() [2/2]

Cmpt & zx ( )
inline

Definition at line 250 of file TensorI.H.

◆ zy() [2/2]

Cmpt & zy ( )
inline

Definition at line 257 of file TensorI.H.

◆ zz() [2/2]

Cmpt & zz ( )
inline

Definition at line 264 of file TensorI.H.

◆ cx()

Foam::Vector< Cmpt > cx ( ) const
inline

Definition at line 292 of file TensorI.H.

Referenced by coordinateSystem::e1(), and lumpedPointState::writeVTP().

Here is the caller graph for this function:

◆ cy()

Foam::Vector< Cmpt > cy ( ) const
inline

Definition at line 299 of file TensorI.H.

Referenced by coordinateSystem::e2(), and lumpedPointState::writeVTP().

Here is the caller graph for this function:

◆ cz()

Foam::Vector< Cmpt > cz ( ) const
inline

Definition at line 306 of file TensorI.H.

Referenced by coordinateSystem::e3().

Here is the caller graph for this function:

◆ col() [1/7]

Vector<Cmpt> col ( ) const
inline

Referenced by cylindrical::R(), and axes::rotation().

Here is the caller graph for this function:

◆ col() [2/7]

Vector<Cmpt> col ( const direction  c) const
inline

◆ col() [3/7]

void col ( const Vector< Cmpt > &  v)
inline

Definition at line 374 of file TensorI.H.

◆ col() [4/7]

void col ( const direction  c,
const Vector< Cmpt > &  v 
)
inline

◆ cols()

void cols ( const Vector< Cmpt > &  x,
const Vector< Cmpt > &  y,
const Vector< Cmpt > &  z 
)
inline

Definition at line 422 of file TensorI.H.

◆ x()

Foam::Vector< Cmpt > x ( ) const
inline

Definition at line 271 of file TensorI.H.

Referenced by triad::operator=(), and triad::triad().

Here is the caller graph for this function:

◆ y()

Foam::Vector< Cmpt > y ( ) const
inline

Definition at line 278 of file TensorI.H.

Referenced by triad::operator=(), and triad::triad().

Here is the caller graph for this function:

◆ z()

Foam::Vector< Cmpt > z ( ) const
inline

Definition at line 285 of file TensorI.H.

Referenced by triad::operator=(), and triad::triad().

Here is the caller graph for this function:

◆ row() [1/7]

Vector<Cmpt> row ( ) const
inline

Referenced by Tensor< scalar >::vectorComponent().

Here is the caller graph for this function:

◆ row() [2/7]

Vector<Cmpt> row ( const direction  r) const
inline

◆ row() [3/7]

void row ( const Vector< Cmpt > &  v)
inline

Definition at line 401 of file TensorI.H.

◆ row() [4/7]

void row ( const direction  r,
const Vector< Cmpt > &  v 
)
inline

◆ rows()

void rows ( const Vector< Cmpt > &  x,
const Vector< Cmpt > &  y,
const Vector< Cmpt > &  z 
)
inline

Definition at line 436 of file TensorI.H.

◆ diag() [1/2]

Foam::Vector< Cmpt > diag ( ) const
inline

Definition at line 481 of file TensorI.H.

◆ diag() [2/2]

void diag ( const Vector< Cmpt > &  v)
inline

Definition at line 488 of file TensorI.H.

◆ T()

Foam::Tensor< Cmpt > T ( ) const
inline

◆ inv()

Tensor< Cmpt > inv ( ) const
inline

Definition at line 779 of file TensorI.H.

◆ inner()

Foam::Tensor< Cmpt > inner ( const Tensor< Cmpt > &  t2) const
inline

Definition at line 510 of file TensorI.H.

Referenced by Foam::operator&().

Here is the caller graph for this function:

◆ schur()

Foam::Tensor< Cmpt > schur ( const Tensor< Cmpt > &  t2) const
inline

Definition at line 533 of file TensorI.H.

◆ operator&=()

void operator&= ( const Tensor< Cmpt > &  t)
inline

Definition at line 549 of file TensorI.H.

◆ operator=() [2/8]

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

Definition at line 558 of file TensorI.H.

◆ operator=() [3/8]

void operator= ( const SphericalTensor< Cmpt > &  )
inline

◆ operator=() [4/8]

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

◆ operator=() [5/8]

void operator= ( const Vector< Vector< Cmpt >> &  )
inline

◆ vectorComponent()

Vector<Cmpt> vectorComponent ( const direction  cmpt) const
inline

Definition at line 312 of file Tensor.H.

Referenced by eddy::writeSurfaceOBJ().

Here is the caller graph for this function:

◆ col() [5/7]

Foam::Vector<Cmpt> col ( ) const
inline

Definition at line 314 of file TensorI.H.

◆ col() [6/7]

Foam::Vector<Cmpt> col ( const direction  c) const
inline

Definition at line 326 of file TensorI.H.

◆ row() [5/7]

Foam::Vector<Cmpt> row ( ) const
inline

Definition at line 344 of file TensorI.H.

◆ row() [6/7]

Foam::Vector<Cmpt> row ( const direction  r) const
inline

Definition at line 356 of file TensorI.H.

◆ col() [7/7]

void col ( const direction  c,
const Vector< Cmpt > &  v 
)
inline

Definition at line 449 of file TensorI.H.

◆ row() [7/7]

void row ( const direction  r,
const Vector< Cmpt > &  v 
)
inline

Definition at line 465 of file TensorI.H.

◆ operator=() [6/8]

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

Definition at line 567 of file TensorI.H.

◆ operator=() [7/8]

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

Definition at line 576 of file TensorI.H.

◆ operator=() [8/8]

void operator= ( const Vector< Vector< Cmpt >> &  tr)
inline

Definition at line 585 of file TensorI.H.

Member Data Documentation

◆ rank

constexpr direction rank = 2
staticconstexpr

Definition at line 76 of file Tensor.H.

◆ I

const Tensor I
static

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