Loading...
Searching...
No Matches
SymmTensor2D< Cmpt > Class Template Reference

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

#include <SymmTensor2D.H>

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

Public Types

enum  components { XX , XY , YY }
 Component labeling enumeration. More...
typedef SymmTensor2D< label > labelType
 Equivalent type of labels used for valid component indexing.
Public Types inherited from VectorSpace< SymmTensor2D< Cmpt >, Cmpt, 3 >
typedef VectorSpace< SymmTensor2D< Cmpt >, Cmpt, Ncmpts > vsType
 VectorSpace type.
typedef Cmpt cmptType
 Component type.
typedef Cmpt magType
 Magnitude type.
typedef direction size_type
 The type to represent the size of a VectorSpace.
typedef Cmpt * iterator
 Random access iterator for traversing VectorSpace.
typedef const Cmpt * const_iterator
 Random access iterator for traversing VectorSpace.

Public Member Functions

 SymmTensor2D ()=default
 Default construct.
 SymmTensor2D (const SymmTensor2D &)=default
 Copy construct.
SymmTensor2Doperator= (const SymmTensor2D &)=default
 Copy assignment.
 SymmTensor2D (Foam::zero)
 Construct initialized to zero.
 SymmTensor2D (const VectorSpace< SymmTensor2D< Cmpt >, Cmpt, 3 > &)
 Construct given VectorSpace.
 SymmTensor2D (const SphericalTensor2D< Cmpt > &)
 Construct given SphericalTensor.
 SymmTensor2D (const Cmpt txx, const Cmpt txy, const Cmpt tyy)
 Construct given the three components.
 SymmTensor2D (Istream &is)
 Construct from Istream.
const Cmpt & xx () const noexcept
const Cmpt & xy () const noexcept
const Cmpt & yx () const noexcept
const Cmpt & yy () const noexcept
Cmpt & xx () noexcept
Cmpt & xy () noexcept
Cmpt & yx () noexcept
Cmpt & yy () noexcept
Vector2D< Cmpt > diag () const
 Extract the diagonal as a vector.
void diag (const Vector2D< Cmpt > &v)
 Set values of the diagonal.
scalar diagSqr () const
 The L2-norm squared of the diagonal.
const SymmTensor2D< Cmpt > & T () const noexcept
 Return non-Hermitian transpose.
Cmpt det () const
 The determinate.
SymmTensor2D< Cmpt > adjunct () const
 Return adjunct matrix (transpose of cofactor matrix).
SymmTensor2D< Cmpt > cof () const
 Return cofactor matrix (transpose of adjunct matrix).
SymmTensor2D< Cmpt > inv () const
 Return inverse.
void operator= (const SphericalTensor2D< Cmpt > &)
 Construct given SphericalTensor2D.
Public Member Functions inherited from VectorSpace< SymmTensor2D< Cmpt >, Cmpt, 3 >
const Foam::VectorSpace< SymmTensor2D< Cmpt >, Cmpt, Ncmpts >::template ConstBlock< SubVector, BStart > block () const
 VectorSpace ()=default
 Default construct.
const Cmpt & component (const direction) const
void replace (const direction, const Cmpt &)
const Cmpt * cdata () const noexcept
 Return const pointer to the first data element.
Cmpt * data () noexcept
 Return pointer to the first data element.
void fill (const Cmpt &s)
 Assign all components to given value.
const Cmpt & operator[] (const direction) const
void operator= (const VectorSpace< SymmTensor2D< Cmpt >, Cmpt, Ncmpts > &)
void operator+= (const VectorSpace< SymmTensor2D< Cmpt >, Cmpt, Ncmpts > &)
void operator-= (const VectorSpace< SymmTensor2D< Cmpt >, Cmpt, Ncmpts > &)
void operator*= (const scalar)
void operator/= (const scalar)
iterator begin () noexcept
 Return an iterator (pointer) to begin of VectorSpace.
const_iterator cbegin () const noexcept
 Return const_iterator (const pointer) to begin of VectorSpace.
iterator end () noexcept
 Return an iterator (pointer) to end of VectorSpace.
const_iterator cend () const noexcept
 Return const_iterator (const pointer) to end of VectorSpace.

Static Public Attributes

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

Additional Inherited Members

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

Detailed Description

template<class Cmpt>
class Foam::SymmTensor2D< Cmpt >

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

See also
Test-SymmTensor2D.C
Source files

Definition at line 54 of file SymmTensor2D.H.

Member Typedef Documentation

◆ labelType

template<class Cmpt>
typedef SymmTensor2D<label> labelType

Equivalent type of labels used for valid component indexing.

Definition at line 65 of file SymmTensor2D.H.

Member Enumeration Documentation

◆ components

template<class Cmpt>
enum components

Component labeling enumeration.

Enumerator
XX 
XY 
YY 

Definition at line 84 of file SymmTensor2D.H.

Constructor & Destructor Documentation

◆ SymmTensor2D() [1/7]

template<class Cmpt>
SymmTensor2D ( )
default

Default construct.

Referenced by adjunct(), SymmTensor2D(), SymmTensor2D(), and SymmTensor2D().

Here is the caller graph for this function:

◆ SymmTensor2D() [2/7]

template<class Cmpt>
SymmTensor2D ( const SymmTensor2D< Cmpt > & )
default

Copy construct.

◆ SymmTensor2D() [3/7]

template<class Cmpt>
SymmTensor2D ( Foam::zero )
inline

Construct initialized to zero.

Definition at line 27 of file SymmTensor2DI.H.

References SymmTensor2D(), and VectorSpace< SymmTensor2D< Cmpt >, Cmpt, 3 >::zero.

Here is the call graph for this function:

◆ SymmTensor2D() [4/7]

template<class Cmpt>
SymmTensor2D ( const VectorSpace< SymmTensor2D< Cmpt >, Cmpt, 3 > & vs)
inline

Construct given VectorSpace.

Definition at line 34 of file SymmTensor2DI.H.

References SymmTensor2D(), and VectorSpace< SymmTensor2D< Cmpt >, Cmpt, 3 >::VectorSpace().

Here is the call graph for this function:

◆ SymmTensor2D() [5/7]

template<class Cmpt>
SymmTensor2D ( const SphericalTensor2D< Cmpt > & st)
inline

Construct given SphericalTensor.

Definition at line 44 of file SymmTensor2DI.H.

References SphericalTensor2D< Cmpt >::ii(), VectorSpace< SymmTensor2D< Cmpt >, Cmpt, 3 >::v_, XX, XY, YY, and Foam::Zero.

Here is the call graph for this function:

◆ SymmTensor2D() [6/7]

template<class Cmpt>
SymmTensor2D ( const Cmpt txx,
const Cmpt txy,
const Cmpt tyy )
inline

Construct given the three components.

Definition at line 52 of file SymmTensor2DI.H.

References VectorSpace< SymmTensor2D< Cmpt >, Cmpt, 3 >::v_, XX, XY, and YY.

◆ SymmTensor2D() [7/7]

template<class Cmpt>
SymmTensor2D ( Istream & is)
inlineexplicit

Construct from Istream.

Definition at line 64 of file SymmTensor2DI.H.

References SymmTensor2D().

Here is the call graph for this function:

Member Function Documentation

◆ operator=() [1/2]

template<class Cmpt>
SymmTensor2D & operator= ( const SymmTensor2D< Cmpt > & )
default

Copy assignment.

◆ xx() [1/2]

◆ xy() [1/2]

◆ yx() [1/2]

template<class Cmpt>
const Cmpt & yx ( ) const
inlinenoexcept

Definition at line 143 of file SymmTensor2D.H.

◆ yy() [1/2]

◆ xx() [2/2]

template<class Cmpt>
Cmpt & xx ( )
inlinenoexcept

Definition at line 146 of file SymmTensor2D.H.

◆ xy() [2/2]

template<class Cmpt>
Cmpt & xy ( )
inlinenoexcept

Definition at line 147 of file SymmTensor2D.H.

◆ yx() [2/2]

template<class Cmpt>
Cmpt & yx ( )
inlinenoexcept

Definition at line 148 of file SymmTensor2D.H.

◆ yy() [2/2]

template<class Cmpt>
Cmpt & yy ( )
inlinenoexcept

Definition at line 149 of file SymmTensor2D.H.

◆ diag() [1/2]

template<class Cmpt>
Foam::Vector2D< Cmpt > diag ( ) const
inline

Extract the diagonal as a vector.

Definition at line 73 of file SymmTensor2DI.H.

References VectorSpace< SymmTensor2D< Cmpt >, Cmpt, 3 >::v_, XX, and YY.

◆ diag() [2/2]

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

Set values of the diagonal.

Definition at line 80 of file SymmTensor2DI.H.

References VectorSpace< SymmTensor2D< Cmpt >, Cmpt, 3 >::v_, Vector2D< Cmpt >::x(), XX, Vector2D< Cmpt >::y(), and YY.

Here is the call graph for this function:

◆ diagSqr()

template<class Cmpt>
Foam::scalar diagSqr ( ) const
inline

The L2-norm squared of the diagonal.

Definition at line 87 of file SymmTensor2DI.H.

References Foam::magSqr(), xx(), and yy().

Here is the call graph for this function:

◆ T()

template<class Cmpt>
const SymmTensor2D< Cmpt > & T ( ) const
inlinenoexcept

Return non-Hermitian transpose.

Definition at line 175 of file SymmTensor2D.H.

◆ det()

template<class Cmpt>
Cmpt det ( ) const
inline

The determinate.

Definition at line 98 of file SymmTensor2DI.H.

References xx(), xy(), and yy().

Referenced by Foam::det().

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

◆ adjunct()

template<class Cmpt>
Foam::SymmTensor2D< Cmpt > adjunct ( ) const
inline

Return adjunct matrix (transpose of cofactor matrix).

Definition at line 105 of file SymmTensor2DI.H.

References SymmTensor2D(), xx(), xy(), and yy().

Referenced by cof(), Foam::inv(), and inv().

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

◆ cof()

template<class Cmpt>
Foam::SymmTensor2D< Cmpt > cof ( ) const
inline

Return cofactor matrix (transpose of adjunct matrix).

Definition at line 117 of file SymmTensor2DI.H.

References adjunct().

Referenced by Foam::cof().

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

◆ inv()

template<class Cmpt>
Foam::SymmTensor2D< Cmpt > inv ( ) const
inline

Return inverse.

Definition at line 126 of file SymmTensor2DI.H.

References Foam::abort(), adjunct(), Foam::det(), Foam::FatalError, FatalErrorInFunction, Foam::mag(), and Foam::nl.

Referenced by Foam::inv().

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

◆ operator=() [2/2]

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

Construct given SphericalTensor2D.

Definition at line 147 of file SymmTensor2DI.H.

References VectorSpace< SymmTensor2D< Cmpt >, Cmpt, 3 >::operator, VectorSpace< SymmTensor2D< Cmpt >, Cmpt, 3 >::v_, XX, XY, YY, and Foam::Zero.

Here is the call graph for this function:

Member Data Documentation

◆ rank

template<class Cmpt>
direction rank = 2
staticconstexpr

Rank of SymmTensor2D is 2.

Definition at line 73 of file SymmTensor2D.H.

◆ I

template<class Cmpt>
const SymmTensor2D I
static

Definition at line 78 of file SymmTensor2D.H.


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