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

A templated (3 x 3) diagonal tensor of objects of <T>, effectively containing 3 elements, derived from VectorSpace. More...

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

Public Types

enum  components { XX, YY, ZZ }
 
typedef DiagTensor< label > labelType
 
- Public Types inherited from VectorSpace< DiagTensor< Cmpt >, Cmpt, 3 >
typedef VectorSpace< Form, Cmpt, Ncmpts > vsType
 
typedef Cmpt cmptType
 
typedef Cmpt magType
 
typedef Cmpt * iterator
 

Public Member Functions

 DiagTensor ()=default
 
 DiagTensor (const DiagTensor &)=default
 
DiagTensoroperator= (const DiagTensor &)=default
 
 DiagTensor (const Foam::zero)
 
template<class Cmpt2 >
 DiagTensor (const VectorSpace< DiagTensor< Cmpt2 >, Cmpt2, 3 > &)
 
 DiagTensor (const Cmpt &txx, const Cmpt &tyy, const Cmpt &tzz)
 
 DiagTensor (Istream &is)
 
const Cmpt & xx () const
 
const Cmpt & yy () const
 
const Cmpt & zz () const
 
Cmpt & xx ()
 
Cmpt & yy ()
 
Cmpt & zz ()
 
- Public Member Functions inherited from VectorSpace< DiagTensor< Cmpt >, Cmpt, 3 >
 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 Public Attributes inherited from VectorSpace< DiagTensor< Cmpt >, Cmpt, 3 >
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< DiagTensor< Cmpt >, Cmpt, 3 >
static constexpr direction size () noexcept
 
static Form uniform (const Cmpt &s)
 
- Public Attributes inherited from VectorSpace< DiagTensor< Cmpt >, Cmpt, 3 >
const typedef Cmpt * const_iterator
 
Cmpt v_ [Ncmpts]
 

Detailed Description

template<class Cmpt>
class Foam::DiagTensor< Cmpt >

A templated (3 x 3) diagonal tensor of objects of <T>, effectively containing 3 elements, derived from VectorSpace.

See also
Test-DiagTensor.C
Source files

Definition at line 52 of file DiagTensor.H.

Member Typedef Documentation

◆ labelType

typedef DiagTensor<label> labelType

Definition at line 61 of file DiagTensor.H.

Member Enumeration Documentation

◆ components

enum components
Enumerator
XX 
YY 
ZZ 

Definition at line 71 of file DiagTensor.H.

Constructor & Destructor Documentation

◆ DiagTensor() [1/6]

DiagTensor ( )
default

◆ DiagTensor() [2/6]

DiagTensor ( const DiagTensor< Cmpt > &  )
default

◆ DiagTensor() [3/6]

DiagTensor ( const Foam::zero  )
inline

Definition at line 28 of file DiagTensorI.H.

◆ DiagTensor() [4/6]

DiagTensor ( const VectorSpace< DiagTensor< Cmpt2 >, Cmpt2, 3 > &  vs)
inline

Definition at line 37 of file DiagTensorI.H.

◆ DiagTensor() [5/6]

DiagTensor ( const Cmpt &  txx,
const Cmpt &  tyy,
const Cmpt &  tzz 
)
inline

Definition at line 47 of file DiagTensorI.H.

◆ DiagTensor() [6/6]

DiagTensor ( Istream is)
inlineexplicit

Definition at line 60 of file DiagTensorI.H.

Member Function Documentation

◆ operator=()

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

◆ xx() [1/2]

Cmpt & xx
inline

◆ yy() [1/2]

Cmpt & yy
inline

◆ zz() [1/2]

Cmpt & zz
inline

◆ xx() [2/2]

Cmpt& xx ( )
inline

◆ yy() [2/2]

Cmpt& yy ( )
inline

◆ zz() [2/2]

Cmpt& zz ( )
inline

Member Data Documentation

◆ rank

constexpr direction rank = 2
staticconstexpr

Definition at line 67 of file DiagTensor.H.


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