Public Types | Public Member Functions | Static Public Attributes | List of all members
Tensor2D< Cmpt > Class Template Reference

A templated (2 x 2) tensor of objects of <T> derived from VectorSpace. More...

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

Public Types

enum  components { XX, XY, YX, YY }
 
typedef Tensor2D< label > labelType
 
- Public Types inherited from VectorSpace< Tensor2D< Cmpt >, Cmpt, 4 >
typedef VectorSpace< Form, Cmpt, Ncmpts > vsType
 
typedef Cmpt cmptType
 
typedef Cmpt magType
 
typedef Cmpt * iterator
 

Public Member Functions

 Tensor2D ()=default
 
 Tensor2D (const Tensor2D &)=default
 
Tensor2Doperator= (const Tensor2D &)=default
 
 Tensor2D (const Foam::zero)
 
 Tensor2D (const VectorSpace< Tensor2D< Cmpt >, Cmpt, 4 > &vs)
 
 Tensor2D (const SymmTensor2D< Cmpt > &st)
 
 Tensor2D (const SphericalTensor2D< Cmpt > &st)
 
 Tensor2D (const Vector2D< Cmpt > &x, const Vector2D< Cmpt > &y)
 
 Tensor2D (const Cmpt txx, const Cmpt txy, const Cmpt tyx, const Cmpt tyy)
 
 Tensor2D (Istream &is)
 
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 > cx () const
 
Vector2D< Cmpt > cy () const
 
template<direction Col>
Vector2D< Cmpt > col () const
 
Vector2D< Cmpt > col (const direction c) const
 
template<direction Col>
void col (const Vector2D< Cmpt > &v)
 
void col (const direction c, const Vector2D< Cmpt > &v)
 
void cols (const Vector2D< Cmpt > &x, const Vector2D< Cmpt > &y)
 
Vector2D< Cmpt > x () const
 
Vector2D< Cmpt > y () const
 
template<direction Row>
Vector2D< Cmpt > row () const
 
Vector2D< Cmpt > row (const direction r) const
 
template<direction Row>
void row (const Vector2D< Cmpt > &v)
 
void row (const direction r, const Vector2D< Cmpt > &v)
 
void rows (const Vector2D< Cmpt > &x, const Vector2D< Cmpt > &y)
 
Vector2D< Cmpt > diag () const
 
void diag (const Vector2D< Cmpt > &v)
 
Tensor2D< Cmpt > T () const
 
Tensor2D< Cmpt > inner (const Tensor2D< Cmpt > &t2) const
 
Tensor2D< Cmpt > schur (const Tensor2D< Cmpt > &t2) const
 
void operator= (const SymmTensor2D< Cmpt > &)
 
void operator= (const SphericalTensor2D< Cmpt > &)
 
Vector2D< Cmpt > vectorComponent (const direction cmpt) const
 
template<Foam::direction Col>
Foam::Vector2D< Cmpt > col () const
 
template<Foam::direction Row>
Foam::Vector2D< Cmpt > row () const
 
- Public Member Functions inherited from VectorSpace< Tensor2D< Cmpt >, Cmpt, 4 >
 VectorSpace ()=default
 
 VectorSpace (const Foam::zero)
 
 VectorSpace (const VectorSpace< Form, Cmpt, Ncmpts > &vs)
 
 VectorSpace (const VectorSpace< Form2, Cmpt2, Ncmpts > &)
 
 VectorSpace (Istream &is)
 
const Cmpt & component (const direction) const
 
Cmpt & component (const direction)
 
void component (Cmpt &, const direction) const
 
void replace (const direction, const Cmpt &)
 
const Cmpt * cdata () const noexcept
 
Cmpt * data () noexcept
 
const ConstBlock< SubVector, BStart > block () const
 
const Foam::VectorSpace< Form, Cmpt, Ncmpts >::template ConstBlock< SubVector, BStart > block () const
 
const Cmpt & operator[] (const direction) const
 
Cmpt & operator[] (const direction)
 
void operator= (const VectorSpace< Form, Cmpt, Ncmpts > &)
 
void operator= (const Foam::zero)
 
void operator+= (const VectorSpace< Form, Cmpt, Ncmpts > &)
 
void operator-= (const VectorSpace< Form, Cmpt, Ncmpts > &)
 
void operator*= (const scalar)
 
void operator/= (const scalar)
 
iterator begin () noexcept
 
const_iterator begin () const noexcept
 
iterator end () noexcept
 
const_iterator end () const noexcept
 
const_iterator cbegin () const noexcept
 
const_iterator cend () const noexcept
 

Static Public Attributes

static constexpr direction rank = 2
 
static const Tensor2D I
 
- Static Public Attributes inherited from VectorSpace< Tensor2D< Cmpt >, Cmpt, 4 >
static constexpr direction dim
 
static constexpr direction nComponents
 
static constexpr direction mRows
 
static constexpr direction nCols
 
static const char *const typeName
 
static const char *const componentNames []
 
static const Form zero
 
static const Form one
 
static const Form max
 
static const Form min
 
static const Form rootMax
 
static const Form rootMin
 

Additional Inherited Members

- Static Public Member Functions inherited from VectorSpace< Tensor2D< Cmpt >, Cmpt, 4 >
static constexpr direction size () noexcept
 
static Form uniform (const Cmpt &s)
 
- Public Attributes inherited from VectorSpace< Tensor2D< Cmpt >, Cmpt, 4 >
const typedef Cmpt * const_iterator
 
Cmpt v_ [Ncmpts]
 

Detailed Description

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

A templated (2 x 2) tensor of objects of <T> derived from VectorSpace.

See also
Test-Tensor2D.C
Source files

Definition at line 55 of file Tensor2D.H.

Member Typedef Documentation

◆ labelType

typedef Tensor2D<label> labelType

Definition at line 64 of file Tensor2D.H.

Member Enumeration Documentation

◆ components

enum components
Enumerator
XX 
XY 
YX 
YY 

Definition at line 79 of file Tensor2D.H.

Constructor & Destructor Documentation

◆ Tensor2D() [1/9]

Tensor2D ( )
default

◆ Tensor2D() [2/9]

Tensor2D ( const Tensor2D< Cmpt > &  )
default

◆ Tensor2D() [3/9]

Tensor2D ( const Foam::zero  )
inline

Definition at line 25 of file Tensor2DI.H.

◆ Tensor2D() [4/9]

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

Definition at line 33 of file Tensor2DI.H.

◆ Tensor2D() [5/9]

Tensor2D ( const SymmTensor2D< Cmpt > &  st)
inline

Definition at line 42 of file Tensor2DI.H.

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

Here is the call graph for this function:

◆ Tensor2D() [6/9]

Tensor2D ( const SphericalTensor2D< Cmpt > &  st)
inline

Definition at line 50 of file Tensor2DI.H.

References SphericalTensor2D< Cmpt >::ii(), and Foam::Zero.

Here is the call graph for this function:

◆ Tensor2D() [7/9]

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

Definition at line 59 of file Tensor2DI.H.

References x, and y.

◆ Tensor2D() [8/9]

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

Definition at line 71 of file Tensor2DI.H.

◆ Tensor2D() [9/9]

Tensor2D ( Istream is)
inlineexplicit

Definition at line 82 of file Tensor2DI.H.

Member Function Documentation

◆ operator=() [1/3]

Tensor2D& operator= ( const Tensor2D< Cmpt > &  )
default

◆ 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

◆ cx()

Foam::Vector2D< Cmpt > cx
inline

Definition at line 154 of file Tensor2DI.H.

◆ cy()

Foam::Vector2D< Cmpt > cy
inline

Definition at line 160 of file Tensor2DI.H.

◆ col() [1/5]

Vector2D<Cmpt> col ( ) const
inline

◆ col() [2/5]

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

Definition at line 179 of file Tensor2DI.H.

References Foam::abort(), Foam::constant::universal::c, Foam::FatalError, FatalErrorInFunction, and Foam::Zero.

Here is the call graph for this function:

◆ col() [3/5]

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

Definition at line 224 of file Tensor2DI.H.

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

Here is the call graph for this function:

◆ col() [4/5]

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

Definition at line 284 of file Tensor2DI.H.

References Foam::abort(), Foam::constant::universal::c, Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

◆ cols()

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

Definition at line 260 of file Tensor2DI.H.

References x, and y.

◆ x()

Foam::Vector2D< Cmpt > x
inline

Definition at line 141 of file Tensor2DI.H.

Referenced by triSurfaceTools::curvatures().

Here is the caller graph for this function:

◆ y()

Foam::Vector2D< Cmpt > y
inline

Definition at line 147 of file Tensor2DI.H.

Referenced by triSurfaceTools::curvatures().

Here is the caller graph for this function:

◆ row() [1/5]

Vector2D<Cmpt> row ( ) const
inline

Referenced by Tensor2D< Cmpt >::vectorComponent().

Here is the caller graph for this function:

◆ row() [2/5]

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

Definition at line 207 of file Tensor2DI.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, x, y, and Foam::Zero.

Here is the call graph for this function:

◆ row() [3/5]

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

Definition at line 243 of file Tensor2DI.H.

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

Here is the call graph for this function:

◆ row() [4/5]

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

Definition at line 303 of file Tensor2DI.H.

References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

◆ rows()

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

Definition at line 272 of file Tensor2DI.H.

References x, and y.

◆ diag() [1/2]

Foam::Vector2D< Cmpt > diag
inline

Definition at line 321 of file Tensor2DI.H.

◆ diag() [2/2]

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

Definition at line 328 of file Tensor2DI.H.

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

Here is the call graph for this function:

◆ T()

Foam::Tensor2D< Cmpt > T
inline

Definition at line 337 of file Tensor2DI.H.

◆ inner()

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

Definition at line 349 of file Tensor2DI.H.

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

Referenced by Foam::operator&().

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

◆ schur()

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

Definition at line 366 of file Tensor2DI.H.

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

Here is the call graph for this function:

◆ operator=() [2/3]

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

Definition at line 381 of file Tensor2DI.H.

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

Here is the call graph for this function:

◆ operator=() [3/3]

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

Definition at line 389 of file Tensor2DI.H.

References SphericalTensor2D< Cmpt >::ii(), and Foam::Zero.

Here is the call graph for this function:

◆ vectorComponent()

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

Definition at line 235 of file Tensor2D.H.

References Tensor2D< Cmpt >::row().

Here is the call graph for this function:

◆ col() [5/5]

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

Definition at line 168 of file Tensor2DI.H.

References Foam::Zero.

◆ row() [5/5]

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

Definition at line 196 of file Tensor2DI.H.

References x, y, and Foam::Zero.

Member Data Documentation

◆ rank

constexpr direction rank = 2
staticconstexpr

Definition at line 70 of file Tensor2D.H.

◆ I

const Foam::tensor2D I
static

Definition at line 75 of file Tensor2D.H.


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