SphericalTensor< Cmpt > Class Template Reference

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

Inheritance diagram for SphericalTensor< Cmpt >:
Collaboration diagram for SphericalTensor< Cmpt >:

Public Types

enum  components { II }
 Component labeling enumeration. More...
 
typedef SphericalTensor< label > labelType
 Equivalent type of labels used for valid component indexing. More...
 
- Public Types inherited from VectorSpace< SphericalTensor< Cmpt >, Cmpt, 1 >
typedef VectorSpace< SphericalTensor< 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...
 
typedef const Cmpt * const_iterator
 Random access iterator for traversing VectorSpace. More...
 

Public Member Functions

 SphericalTensor ()=default
 Default construct. More...
 
 SphericalTensor (const SphericalTensor &)=default
 Copy construct. More...
 
SphericalTensoroperator= (const SphericalTensor &)=default
 Copy assignment. More...
 
 SphericalTensor (const Foam::zero)
 Construct initialized to zero. More...
 
template<class Cmpt2 >
 SphericalTensor (const VectorSpace< SphericalTensor< Cmpt2 >, Cmpt2, 1 > &)
 Construct given VectorSpace. More...
 
 SphericalTensor (const Cmpt &tii)
 Construct given the component. More...
 
 SphericalTensor (Istream &is)
 Construct from Istream. More...
 
const Cmpt & ii () const noexcept
 
Cmpt & ii () noexcept
 
scalar diagSqr () const
 The L2-norm squared of the diagonal. More...
 
const SphericalTensor< Cmpt > & T () const noexcept
 Return non-Hermitian transpose (no-op) More...
 
- Public Member Functions inherited from VectorSpace< SphericalTensor< Cmpt >, Cmpt, 1 >
 VectorSpace ()=default
 Default construct. More...
 
 VectorSpace (const Foam::zero)
 Construct initialized to zero. More...
 
 VectorSpace (const VectorSpace< SphericalTensor< Cmpt >, Cmpt, Ncmpts > &vs)
 Copy construct. More...
 
 VectorSpace (const VectorSpace< Form2, Cmpt2, Ncmpts > &)
 Copy construct of a VectorSpace with the same size. More...
 
 VectorSpace (Istream &is)
 Construct from Istream. 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< SphericalTensor< Cmpt >, Cmpt, Ncmpts >::template ConstBlock< SubVector, BStart > block () const
 
const Cmpt & operator[] (const direction) const
 
Cmpt & operator[] (const direction)
 
void operator= (const VectorSpace< SphericalTensor< Cmpt >, Cmpt, Ncmpts > &)
 
void operator= (const Foam::zero)
 
void operator+= (const VectorSpace< SphericalTensor< Cmpt >, Cmpt, Ncmpts > &)
 
void operator-= (const VectorSpace< SphericalTensor< Cmpt >, Cmpt, Ncmpts > &)
 
void operator*= (const scalar)
 
void operator/= (const scalar)
 
iterator begin () noexcept
 Return an iterator to begin of VectorSpace. More...
 
const_iterator begin () const noexcept
 Return const_iterator to begin of VectorSpace. More...
 
iterator end () noexcept
 Return an iterator to end of VectorSpace. More...
 
const_iterator end () const noexcept
 Return const_iterator to end of VectorSpace. More...
 
const_iterator cbegin () const noexcept
 Return const_iterator to begin of VectorSpace. More...
 
const_iterator cend () const noexcept
 Return const_iterator to end of VectorSpace. More...
 

Static Public Attributes

static constexpr direction rank = 2
 Rank of SphericalTensor is 2. More...
 
static const SphericalTensor I
 
static const SphericalTensor oneThirdI
 
static const SphericalTensor twoThirdsI
 
- Static Public Attributes inherited from VectorSpace< SphericalTensor< Cmpt >, Cmpt, 1 >
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 SphericalTensor< Cmpt > zero
 
static const SphericalTensor< Cmpt > one
 
static const SphericalTensor< Cmpt > max
 
static const SphericalTensor< Cmpt > min
 
static const SphericalTensor< Cmpt > rootMax
 
static const SphericalTensor< Cmpt > rootMin
 

Additional Inherited Members

- Static Public Member Functions inherited from VectorSpace< SphericalTensor< Cmpt >, Cmpt, 1 >
static constexpr direction size () noexcept
 The number of elements in the VectorSpace = Ncmpts. More...
 
static SphericalTensor< Cmpt > uniform (const Cmpt &s)
 Return a VectorSpace with all elements = s. More...
 
- Public Attributes inherited from VectorSpace< SphericalTensor< Cmpt >, Cmpt, 1 >
Cmpt v_ [Ncmpts]
 The components of this vector space. More...
 

Detailed Description

template<class Cmpt>
class Foam::SphericalTensor< Cmpt >

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

See also
Test-SphericalTensor.C
Source files

Definition at line 53 of file SphericalTensor.H.

Member Typedef Documentation

◆ labelType

typedef SphericalTensor<label> labelType

Equivalent type of labels used for valid component indexing.

Definition at line 64 of file SphericalTensor.H.

Member Enumeration Documentation

◆ components

enum components

Component labeling enumeration.

Enumerator
II 

Definition at line 85 of file SphericalTensor.H.

Constructor & Destructor Documentation

◆ SphericalTensor() [1/6]

SphericalTensor ( )
default

Default construct.

◆ SphericalTensor() [2/6]

SphericalTensor ( const SphericalTensor< Cmpt > &  )
default

Copy construct.

◆ SphericalTensor() [3/6]

SphericalTensor ( const Foam::zero  )
inline

Construct initialized to zero.

Definition at line 27 of file SphericalTensorI.H.

◆ SphericalTensor() [4/6]

SphericalTensor ( const VectorSpace< SphericalTensor< Cmpt2 >, Cmpt2, 1 > &  vs)
inline

Construct given VectorSpace.

Definition at line 36 of file SphericalTensorI.H.

◆ SphericalTensor() [5/6]

SphericalTensor ( const Cmpt &  tii)
inlineexplicit

Construct given the component.

Definition at line 45 of file SphericalTensorI.H.

◆ SphericalTensor() [6/6]

SphericalTensor ( Istream is)
inlineexplicit

Construct from Istream.

Definition at line 52 of file SphericalTensorI.H.

Member Function Documentation

◆ operator=()

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

Copy assignment.

◆ ii() [1/2]

◆ ii() [2/2]

Cmpt& ii ( )
inlinenoexcept

Definition at line 139 of file SphericalTensor.H.

◆ diagSqr()

Foam::scalar diagSqr ( ) const
inline

The L2-norm squared of the diagonal.

Definition at line 61 of file SphericalTensorI.H.

Referenced by Foam::magSqr().

Here is the caller graph for this function:

◆ T()

const SphericalTensor<Cmpt>& T ( ) const
inlinenoexcept

Return non-Hermitian transpose (no-op)

Definition at line 155 of file SphericalTensor.H.

Member Data Documentation

◆ rank

constexpr direction rank = 2
static

Rank of SphericalTensor is 2.

Definition at line 72 of file SphericalTensor.H.

◆ I

Definition at line 77 of file SphericalTensor.H.

◆ oneThirdI

const SphericalTensor oneThirdI
static

Definition at line 78 of file SphericalTensor.H.

◆ twoThirdsI

const SphericalTensor twoThirdsI
static

Definition at line 79 of file SphericalTensor.H.


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