DiagTensor< Cmpt > Class Template Reference

Templated 3D DiagTensor derived from VectorSpace. More...

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

Public Types

enum  components { XX, YY, ZZ }
 Component labeling enumeration. More...
 
typedef DiagTensor< labellabelType
 Equivalent type of labels used for valid component indexing. More...
 
- Public Types inherited from VectorSpace< DiagTensor< Cmpt >, Cmpt, 3 >
typedef VectorSpace< DiagTensor< Cmpt >, Cmpt, Ncmpts > vsType
 VectorSpace type. More...
 
typedef Cmpt cmptType
 Component type. More...
 
typedef Cmpt magType
 Magnitude type. More...
 
typedef Cmpt * iterator
 Random access iterator for traversing VectorSpace. More...
 

Public Member Functions

 DiagTensor ()
 Construct null. More...
 
 DiagTensor (const Foam::zero)
 Construct initialized to zero. More...
 
template<class Cmpt2 >
 DiagTensor (const VectorSpace< DiagTensor< Cmpt2 >, Cmpt2, 3 > &)
 Construct given VectorSpace. More...
 
 DiagTensor (const Cmpt &txx, const Cmpt &tyy, const Cmpt &tzz)
 Construct given three components. More...
 
 DiagTensor (Istream &)
 Construct from Istream. More...
 
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 ()
 Construct null. More...
 
 VectorSpace (const Foam::zero)
 Construct initialized to zero. More...
 
 VectorSpace (Istream &is)
 Construct from Istream. More...
 
 VectorSpace (const VectorSpace< DiagTensor< Cmpt >, Cmpt, Ncmpts > &vs)
 Copy construct. More...
 
 VectorSpace (const VectorSpace< Form2, Cmpt2, Ncmpts > &)
 Copy construct of a VectorSpace with the same size. 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 * cdata () const noexcept
 Return const pointer to the first data element. More...
 
Cmpt * data () noexcept
 Return pointer to the first data element. More...
 
const ConstBlock< SubVector, BStart > block () const
 
const Foam::VectorSpace< DiagTensor< Cmpt >, Cmpt, Ncmpts >::template ConstBlock< SubVector, BStart > block () const
 
const Cmpt & operator[] (const direction) const
 
Cmpt & operator[] (const direction)
 
void operator= (const VectorSpace< DiagTensor< Cmpt >, Cmpt, Ncmpts > &)
 
void operator= (const Foam::zero)
 
void operator+= (const VectorSpace< DiagTensor< Cmpt >, Cmpt, Ncmpts > &)
 
void operator-= (const VectorSpace< DiagTensor< Cmpt >, Cmpt, Ncmpts > &)
 
void operator*= (const scalar)
 
void operator/= (const scalar)
 
iterator begin ()
 Return an iterator to begin of VectorSpace. More...
 
const_iterator begin () const
 Return const_iterator to begin of VectorSpace. More...
 
iterator end ()
 Return an iterator to end of VectorSpace. More...
 
const_iterator end () const
 Return const_iterator to end of VectorSpace. More...
 
const_iterator cbegin () const
 Return const_iterator to begin of VectorSpace. More...
 
const_iterator cend () const
 Return const_iterator to end of VectorSpace. More...
 

Static Public Attributes

static constexpr direction rank = 2
 Rank of DiagTensor is 2. More...
 
- Static Public Attributes inherited from VectorSpace< DiagTensor< Cmpt >, Cmpt, 3 >
static constexpr direction dim
 Dimensionality of space. More...
 
static constexpr direction nComponents
 Number of components in this vector space. More...
 
static constexpr direction mRows
 
static constexpr direction nCols
 
static const char *const typeName
 
static const char *const componentNames []
 
static const DiagTensor< Cmpt > zero
 
static const DiagTensor< Cmpt > one
 
static const DiagTensor< Cmpt > max
 
static const DiagTensor< Cmpt > min
 
static const DiagTensor< Cmpt > rootMax
 
static const DiagTensor< Cmpt > rootMin
 

Additional Inherited Members

- Static Public Member Functions inherited from VectorSpace< DiagTensor< Cmpt >, Cmpt, 3 >
static constexpr direction size ()
 Return the number of elements in the VectorSpace = Ncmpts. More...
 
static DiagTensor< Cmpt > uniform (const Cmpt &s)
 Return a VectorSpace with all elements = s. More...
 
- Public Attributes inherited from VectorSpace< DiagTensor< Cmpt >, Cmpt, 3 >
const typedef Cmpt * const_iterator
 Random access iterator for traversing VectorSpace. More...
 
Cmpt v_ [Ncmpts]
 The components of this vector space. More...
 

Detailed Description

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

Templated 3D DiagTensor derived from VectorSpace.

Adding construction from 3 components, element access using xx(), yy() and zz() member functions and the inner-product (dot-product) and outer-product operators.

Source files

Definition at line 56 of file DiagTensor.H.

Member Typedef Documentation

◆ labelType

Equivalent type of labels used for valid component indexing.

Definition at line 64 of file DiagTensor.H.

Member Enumeration Documentation

◆ components

enum components

Component labeling enumeration.

Enumerator
XX 
YY 
ZZ 

Definition at line 74 of file DiagTensor.H.

Constructor & Destructor Documentation

◆ DiagTensor() [1/5]

DiagTensor ( )
inline

Construct null.

Definition at line 34 of file DiagTensorI.H.

◆ DiagTensor() [2/5]

DiagTensor ( const Foam::zero  )
inline

Construct initialized to zero.

Definition at line 39 of file DiagTensorI.H.

◆ DiagTensor() [3/5]

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

Construct given VectorSpace.

Definition at line 48 of file DiagTensorI.H.

◆ DiagTensor() [4/5]

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

Construct given three components.

Definition at line 58 of file DiagTensorI.H.

◆ DiagTensor() [5/5]

DiagTensor ( Istream is)
inline

Construct from Istream.

Definition at line 71 of file DiagTensorI.H.

Member Function Documentation

◆ xx() [1/2]

const Cmpt & xx ( ) const
inline

Definition at line 80 of file DiagTensorI.H.

Referenced by Foam::det(), Foam::inv(), Foam::operator&(), Foam::operator+(), Foam::operator-(), Foam::operator/(), wedgeFaPatchField< Type >::snGradTransformDiag(), wedgeFvPatchField< Type >::snGradTransformDiag(), and Foam::tr().

Here is the caller graph for this function:

◆ yy() [1/2]

const Cmpt & yy ( ) const
inline

Definition at line 86 of file DiagTensorI.H.

Referenced by molecule::constantProperties::constantProperties(), Foam::det(), Foam::inv(), Foam::operator&(), Foam::operator+(), Foam::operator-(), Foam::operator/(), wedgeFaPatchField< Type >::snGradTransformDiag(), wedgeFvPatchField< Type >::snGradTransformDiag(), and Foam::tr().

Here is the caller graph for this function:

◆ zz() [1/2]

const Cmpt & zz ( ) const
inline

Definition at line 92 of file DiagTensorI.H.

Referenced by molecule::constantProperties::constantProperties(), Foam::det(), Foam::inv(), Foam::operator&(), Foam::operator+(), Foam::operator-(), Foam::operator/(), wedgeFaPatchField< Type >::snGradTransformDiag(), wedgeFvPatchField< Type >::snGradTransformDiag(), and Foam::tr().

Here is the caller graph for this function:

◆ xx() [2/2]

Cmpt & xx ( )
inline

Definition at line 99 of file DiagTensorI.H.

◆ yy() [2/2]

Cmpt & yy ( )
inline

Definition at line 105 of file DiagTensorI.H.

◆ zz() [2/2]

Cmpt & zz ( )
inline

Definition at line 111 of file DiagTensorI.H.

Member Data Documentation

◆ rank

constexpr direction rank = 2
staticconstexpr

Rank of DiagTensor is 2.

Definition at line 70 of file DiagTensor.H.


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