A templated (3 x 3) symmetric tensor of objects of <T>, effectively containing 6 elements, derived from VectorSpace. More...
#include <SymmTensor.H>


Public Types | |
| enum | components { XX , XY , XZ , YY , YZ , ZZ } |
| Component labeling enumeration. More... | |
| typedef SymmTensor< label > | labelType |
| Equivalent type of labels used for valid component indexing. | |
| Public Types inherited from VectorSpace< SymmTensor< Cmpt >, Cmpt, 6 > | |
| typedef VectorSpace< SymmTensor< 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 | |
| SymmTensor ()=default | |
| Default construct. | |
| SymmTensor (const SymmTensor &)=default | |
| Copy construct. | |
| SymmTensor & | operator= (const SymmTensor &)=default |
| Copy assignment. | |
| SymmTensor (Foam::zero) | |
| Construct initialized to zero. | |
| template<class Cmpt2> | |
| SymmTensor (const VectorSpace< SymmTensor< Cmpt2 >, Cmpt2, 6 > &) | |
| Construct given VectorSpace of the same rank. | |
| SymmTensor (const SphericalTensor< Cmpt > &) | |
| Construct given SphericalTensor. | |
| SymmTensor (const Vector< Cmpt > &x, const Vector< Cmpt > &y, const Vector< Cmpt > &z, const bool transposed=false) | |
| Construct given the three row (or column) vectors. | |
| SymmTensor (const Cmpt txx, const Cmpt txy, const Cmpt txz, const Cmpt tyy, const Cmpt tyz, const Cmpt tzz) | |
| Construct given the six components. | |
| SymmTensor (Istream &is) | |
| Construct from Istream. | |
| const Cmpt & | xx () const noexcept |
| const Cmpt & | xy () const noexcept |
| const Cmpt & | xz () const noexcept |
| const Cmpt & | yx () const noexcept |
| const Cmpt & | yy () const noexcept |
| const Cmpt & | yz () const noexcept |
| const Cmpt & | zx () const noexcept |
| const Cmpt & | zy () const noexcept |
| const Cmpt & | zz () const noexcept |
| Cmpt & | xx () noexcept |
| Cmpt & | xy () noexcept |
| Cmpt & | xz () noexcept |
| Cmpt & | yx () noexcept |
| Cmpt & | yy () noexcept |
| Cmpt & | yz () noexcept |
| Cmpt & | zx () noexcept |
| Cmpt & | zy () noexcept |
| Cmpt & | zz () noexcept |
| Vector< Cmpt > | cx () const |
| Extract vector for column 0. | |
| Vector< Cmpt > | cy () const |
| Extract vector for column 1. | |
| Vector< Cmpt > | cz () const |
| Extract vector for column 2. | |
| template<direction Idx> | |
| Vector< Cmpt > | col () const |
| Extract vector for given column: compile-time check of index. | |
| Vector< Cmpt > | col (const direction c) const |
| Extract vector for given column (0,1,2): runtime check of index. | |
| void | col (const direction c, const Vector< Cmpt > &v) |
| Set values of given column (0,1,2): runtime check of index. | |
| void | cols (const Vector< Cmpt > &x, const Vector< Cmpt > &y, const Vector< Cmpt > &z) |
| Set column values. | |
| Vector< Cmpt > | x () const |
| Extract vector for row 0. | |
| Vector< Cmpt > | y () const |
| Extract vector for row 1. | |
| Vector< Cmpt > | z () const |
| Extract vector for row 2. | |
| template<direction Row> | |
| Vector< Cmpt > | row () const |
| Extract vector for given row: compile-time check of index. | |
| Vector< Cmpt > | row (const direction r) const |
| Extract vector for given row (0,1,2): runtime check of index. | |
| template<direction Idx> | |
| void | row (const Vector< Cmpt > &v) |
| Set values of given row: compile-time check of index. | |
| void | row (const direction r, const Vector< Cmpt > &v) |
| Set values of given row (0,1,2): runtime check of row. | |
| void | rows (const Vector< Cmpt > &x, const Vector< Cmpt > &y, const Vector< Cmpt > &z) |
| Set row values. | |
| Vector< Cmpt > | diag () const |
| Extract the diagonal as a vector. | |
| void | diag (const Vector< Cmpt > &v) |
| Set values of the diagonal. | |
| void | addDiag (const Vector< Cmpt > &v) |
| Add to the diagonal. | |
| void | subtractDiag (const Vector< Cmpt > &v) |
| Subtract from the diagonal. | |
| scalar | diagSqr () const |
| The L2-norm squared of the diagonal. | |
| bool | is_identity (const scalar tol=ROOTVSMALL) const |
| Is identity tensor? | |
| const SymmTensor< Cmpt > & | T () const noexcept |
| Return non-Hermitian transpose. | |
| Cmpt | det () const |
| The determinate. | |
| Cmpt | det2D (const direction excludeCmpt) const |
| The 2D determinant by excluding given direction. | |
| SymmTensor< Cmpt > | adjunct () const |
| Return adjunct matrix (transpose of cofactor matrix). | |
| SymmTensor< Cmpt > | cof () const |
| Return cofactor matrix (transpose of adjunct matrix). | |
| SymmTensor< Cmpt > | adjunct2D (const direction excludeCmpt) const |
| Return 2D adjunct matrix by excluding given direction. | |
| SymmTensor< Cmpt > | inv () const |
| Return inverse. | |
| SymmTensor< Cmpt > | safeInv () const |
| Return inverse, with (ad hoc) failsafe handling of 2D tensors. | |
| SymmTensor< Cmpt > | inv2D (const direction excludeCmpt) const |
| Return inverse of 2D tensor (by excluding given direction). | |
| void | operator= (const SphericalTensor< Cmpt > &) |
| Assign to given SphericalTensor. | |
| template<Foam::direction Idx> | |
| Foam::Vector< Cmpt > | row () const |
| Public Member Functions inherited from VectorSpace< SymmTensor< Cmpt >, Cmpt, 6 > | |
| const Foam::VectorSpace< SymmTensor< 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< SymmTensor< Cmpt >, Cmpt, Ncmpts > &) |
| void | operator+= (const VectorSpace< SymmTensor< Cmpt >, Cmpt, Ncmpts > &) |
| void | operator-= (const VectorSpace< SymmTensor< 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 SymmTensor is 2. | |
| static const SymmTensor | I |
| Static Public Attributes inherited from VectorSpace< SymmTensor< Cmpt >, Cmpt, 6 > | |
| 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 SymmTensor< Cmpt > | zero |
| static const SymmTensor< Cmpt > | one |
| static const SymmTensor< Cmpt > | max |
| static const SymmTensor< Cmpt > | min |
| static const SymmTensor< Cmpt > | rootMax |
| static const SymmTensor< Cmpt > | rootMin |
Additional Inherited Members | |
| Static Public Member Functions inherited from VectorSpace< SymmTensor< Cmpt >, Cmpt, 6 > | |
| static constexpr direction | size () noexcept |
| The number of elements in the VectorSpace = Ncmpts. | |
| static SymmTensor< Cmpt > | uniform (const Cmpt &s) |
| Return a VectorSpace with all elements = s. | |
| Public Attributes inherited from VectorSpace< SymmTensor< Cmpt >, Cmpt, 6 > | |
| Cmpt | v_ [Ncmpts] |
| The components of this vector space. | |
A templated (3 x 3) symmetric tensor of objects of <T>, effectively containing 6 elements, derived from VectorSpace.
Definition at line 50 of file SymmTensor.H.
| typedef SymmTensor<label> labelType |
Equivalent type of labels used for valid component indexing.
Definition at line 61 of file SymmTensor.H.
| enum components |
Component labeling enumeration.
| Enumerator | |
|---|---|
| XX | |
| XY | |
| XZ | |
| YY | |
| YZ | |
| ZZ | |
Definition at line 80 of file SymmTensor.H.
|
default |
Default construct.
Referenced by adjunct(), adjunct2D(), safeInv(), SymmTensor(), SymmTensor(), and SymmTensor().

|
default |
Copy construct.
|
inline |
Construct initialized to zero.
Definition at line 27 of file SymmTensorI.H.
References SymmTensor(), and VectorSpace< SymmTensor< Cmpt >, Cmpt, 6 >::zero.

|
inline |
Construct given VectorSpace of the same rank.
Definition at line 35 of file SymmTensorI.H.
References SymmTensor(), and VectorSpace< SymmTensor< Cmpt >, Cmpt, 6 >::VectorSpace().

|
inline |
Construct given SphericalTensor.
Definition at line 45 of file SymmTensorI.H.
References SphericalTensor< Cmpt >::ii(), VectorSpace< SymmTensor< Cmpt >, Cmpt, 6 >::v_, XX, XY, XZ, YY, YZ, Foam::Zero, and ZZ.

|
inline |
Construct given the six components.
Definition at line 67 of file SymmTensorI.H.
References VectorSpace< SymmTensor< Cmpt >, Cmpt, 6 >::v_, XX, XY, XZ, YY, YZ, and ZZ.
|
inlineexplicit |
Construct from Istream.
Definition at line 81 of file SymmTensorI.H.
References SymmTensor().

|
default |
Copy assignment.
|
inlinenoexcept |
Definition at line 150 of file SymmTensor.H.
Referenced by adjunct(), adjunct2D(), primitiveMeshTools::cellDeterminant(), turbulentDFSEMInletFvPatchVectorField::checkStresses(), molecule::constantProperties::constantProperties(), det(), det2D(), Foam::diag(), diagSqr(), Foam::innerSqr(), Foam::invariantII(), Foam::invTransform(), is_identity(), Foam::lerp(), Foam::magSqr(), Foam::operator&(), Foam::operator&(), Foam::operator&(), Foam::operator&(), Foam::operator&(), Foam::operator&(), Foam::operator&(), Foam::operator&&(), Foam::operator&&(), Foam::operator&&(), Foam::operator&&(), Foam::operator&&(), Foam::operator+(), Foam::operator+(), Foam::operator+(), Foam::operator+(), Foam::operator-(), Foam::operator-(), Foam::operator-(), Foam::operator-(), Foam::operator/(), Tensor< Cmpt >::operator=(), safeInv(), Tensor< Cmpt >::Tensor(), Foam::tr(), Foam::transform(), Foam::transform(), and Foam::transform().

|
inlinenoexcept |
Definition at line 151 of file SymmTensor.H.
Referenced by adjunct(), adjunct2D(), turbulentDFSEMInletFvPatchVectorField::checkStresses(), det(), det2D(), Foam::innerSqr(), Foam::invariantII(), Foam::invTransform(), is_identity(), Foam::lerp(), Foam::magSqr(), Foam::operator&(), Foam::operator&(), Foam::operator&(), Foam::operator&(), Foam::operator&(), Foam::operator&(), Foam::operator&(), Foam::operator&&(), Foam::operator&&(), Foam::operator&&(), Foam::operator*(), Foam::operator+(), Foam::operator+(), Foam::operator+(), Foam::operator+(), Foam::operator-(), Foam::operator-(), Foam::operator-(), Foam::operator-(), Foam::operator/(), Tensor< Cmpt >::operator=(), Tensor< Cmpt >::Tensor(), Foam::transform(), Foam::transform(), and Foam::transform().

|
inlinenoexcept |
Definition at line 152 of file SymmTensor.H.
Referenced by adjunct(), adjunct2D(), det(), det2D(), Foam::innerSqr(), Foam::invariantII(), Foam::invTransform(), is_identity(), Foam::lerp(), Foam::magSqr(), Foam::operator&(), Foam::operator&(), Foam::operator&(), Foam::operator&(), Foam::operator&(), Foam::operator&(), Foam::operator&(), Foam::operator&&(), Foam::operator&&(), Foam::operator&&(), Foam::operator*(), Foam::operator+(), Foam::operator+(), Foam::operator+(), Foam::operator+(), Foam::operator-(), Foam::operator-(), Foam::operator-(), Foam::operator-(), Foam::operator/(), Tensor< Cmpt >::operator=(), Tensor< Cmpt >::Tensor(), Foam::transform(), Foam::transform(), and Foam::transform().

|
inlinenoexcept |
Definition at line 153 of file SymmTensor.H.
|
inlinenoexcept |
Definition at line 154 of file SymmTensor.H.
Referenced by adjunct(), adjunct2D(), primitiveMeshTools::cellDeterminant(), turbulentDFSEMInletFvPatchVectorField::checkStresses(), molecule::constantProperties::constantProperties(), det(), det2D(), Foam::diag(), diagSqr(), Foam::innerSqr(), Foam::invariantII(), Foam::invTransform(), is_identity(), Foam::lerp(), Foam::magSqr(), Foam::operator&(), Foam::operator&(), Foam::operator&(), Foam::operator&(), Foam::operator&(), Foam::operator&(), Foam::operator&(), Foam::operator&&(), Foam::operator&&(), Foam::operator&&(), Foam::operator&&(), Foam::operator&&(), Foam::operator+(), Foam::operator+(), Foam::operator+(), Foam::operator+(), Foam::operator-(), Foam::operator-(), Foam::operator-(), Foam::operator-(), Foam::operator/(), Tensor< Cmpt >::operator=(), safeInv(), Tensor< Cmpt >::Tensor(), Foam::tr(), Foam::transform(), Foam::transform(), and Foam::transform().

|
inlinenoexcept |
Definition at line 155 of file SymmTensor.H.
Referenced by adjunct(), adjunct2D(), det(), det2D(), Foam::innerSqr(), Foam::invariantII(), Foam::invTransform(), is_identity(), Foam::lerp(), Foam::magSqr(), Foam::operator&(), Foam::operator&(), Foam::operator&(), Foam::operator&(), Foam::operator&(), Foam::operator&(), Foam::operator&(), Foam::operator&&(), Foam::operator&&(), Foam::operator&&(), Foam::operator*(), Foam::operator+(), Foam::operator+(), Foam::operator+(), Foam::operator+(), Foam::operator-(), Foam::operator-(), Foam::operator-(), Foam::operator-(), Foam::operator/(), Tensor< Cmpt >::operator=(), Tensor< Cmpt >::Tensor(), Foam::transform(), Foam::transform(), and Foam::transform().

|
inlinenoexcept |
Definition at line 156 of file SymmTensor.H.
|
inlinenoexcept |
Definition at line 157 of file SymmTensor.H.
|
inlinenoexcept |
Definition at line 158 of file SymmTensor.H.
Referenced by adjunct(), adjunct2D(), primitiveMeshTools::cellDeterminant(), molecule::constantProperties::constantProperties(), det(), det2D(), Foam::diag(), diagSqr(), Foam::innerSqr(), Foam::invariantII(), Foam::invTransform(), is_identity(), Foam::lerp(), Foam::magSqr(), Foam::operator&(), Foam::operator&(), Foam::operator&(), Foam::operator&(), Foam::operator&(), Foam::operator&(), Foam::operator&(), Foam::operator&&(), Foam::operator&&(), Foam::operator&&(), Foam::operator&&(), Foam::operator&&(), Foam::operator+(), Foam::operator+(), Foam::operator+(), Foam::operator+(), Foam::operator-(), Foam::operator-(), Foam::operator-(), Foam::operator-(), Foam::operator/(), Tensor< Cmpt >::operator=(), safeInv(), Tensor< Cmpt >::Tensor(), Foam::tr(), Foam::transform(), Foam::transform(), and Foam::transform().

|
inlinenoexcept |
Definition at line 160 of file SymmTensor.H.
|
inlinenoexcept |
Definition at line 161 of file SymmTensor.H.
|
inlinenoexcept |
Definition at line 162 of file SymmTensor.H.
|
inlinenoexcept |
Definition at line 163 of file SymmTensor.H.
|
inlinenoexcept |
Definition at line 164 of file SymmTensor.H.
|
inlinenoexcept |
Definition at line 165 of file SymmTensor.H.
|
inlinenoexcept |
Definition at line 166 of file SymmTensor.H.
|
inlinenoexcept |
Definition at line 167 of file SymmTensor.H.
|
inlinenoexcept |
Definition at line 168 of file SymmTensor.H.
|
inline |
Extract vector for column 0.
Definition at line 176 of file SymmTensor.H.
|
inline |
Extract vector for column 1.
Definition at line 181 of file SymmTensor.H.
|
inline |
Extract vector for column 2.
Definition at line 186 of file SymmTensor.H.
Extract vector for given column: compile-time check of index.
Definition at line 192 of file SymmTensor.H.
Extract vector for given column (0,1,2): runtime check of index.
Definition at line 197 of file SymmTensor.H.
Set values of given column (0,1,2): runtime check of index.
Definition at line 202 of file SymmTensor.H.
|
inline |
Set column values.
Definition at line 207 of file SymmTensor.H.
|
inline |
Extract vector for row 0.
Definition at line 90 of file SymmTensorI.H.
References VectorSpace< SymmTensor< Cmpt >, Cmpt, 6 >::v_, XX, XY, and XZ.
Referenced by SymmTensor< scalar >::cx(), rows(), and SymmTensor().

|
inline |
Extract vector for row 1.
Definition at line 97 of file SymmTensorI.H.
References VectorSpace< SymmTensor< Cmpt >, Cmpt, 6 >::v_, XY, YY, and YZ.
Referenced by SymmTensor< scalar >::cy(), rows(), and SymmTensor().

|
inline |
Extract vector for row 2.
Definition at line 104 of file SymmTensorI.H.
References VectorSpace< SymmTensor< Cmpt >, Cmpt, 6 >::v_, XZ, YZ, and ZZ.
Referenced by SymmTensor< scalar >::cz(), row(), rows(), and SymmTensor().

Extract vector for given row: compile-time check of index.
Referenced by SymmTensor< scalar >::col(), SymmTensor< scalar >::col(), SymmTensor< scalar >::col(), and row().

|
inline |
Extract vector for given row (0,1,2): runtime check of index.
Definition at line 124 of file SymmTensorI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, x, y, z(), and Foam::Zero.

Set values of given row: compile-time check of index.
Definition at line 142 of file SymmTensorI.H.
References VectorSpace< SymmTensor< Cmpt >, Cmpt, 6 >::v_, Vector< Cmpt >::x(), XX, XY, XZ, Vector< Cmpt >::y(), YY, YZ, Vector< Cmpt >::z(), and ZZ.

Set values of given row (0,1,2): runtime check of row.
Definition at line 176 of file SymmTensorI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and row().

|
inline |
Set row values.
Definition at line 162 of file SymmTensorI.H.
References VectorSpace< SymmTensor< Cmpt >, Cmpt, 6 >::v_, x(), XX, XY, XZ, y(), YY, YZ, z(), and ZZ.
Referenced by SymmTensor< scalar >::cols(), and SymmTensor().


|
inline |
Extract the diagonal as a vector.
Definition at line 195 of file SymmTensorI.H.
References VectorSpace< SymmTensor< Cmpt >, Cmpt, 6 >::v_, XX, YY, and ZZ.
|
inline |
Set values of the diagonal.
Definition at line 202 of file SymmTensorI.H.
References VectorSpace< SymmTensor< Cmpt >, Cmpt, 6 >::v_, Vector< Cmpt >::x(), XX, Vector< Cmpt >::y(), YY, Vector< Cmpt >::z(), and ZZ.

|
inline |
Add to the diagonal.
Definition at line 209 of file SymmTensorI.H.
References VectorSpace< SymmTensor< Cmpt >, Cmpt, 6 >::v_, Vector< Cmpt >::x(), XX, Vector< Cmpt >::y(), YY, Vector< Cmpt >::z(), and ZZ.

|
inline |
Subtract from the diagonal.
Definition at line 216 of file SymmTensorI.H.
References VectorSpace< SymmTensor< Cmpt >, Cmpt, 6 >::v_, Vector< Cmpt >::x(), XX, Vector< Cmpt >::y(), YY, Vector< Cmpt >::z(), and ZZ.

|
inline |
The L2-norm squared of the diagonal.
Definition at line 223 of file SymmTensorI.H.
References Foam::magSqr(), xx(), yy(), and zz().

|
inline |
Is identity tensor?
Definition at line 235 of file SymmTensorI.H.
References Foam::mag(), xx(), xy(), xz(), yy(), yz(), and zz().

|
inlinenoexcept |
Return non-Hermitian transpose.
Definition at line 309 of file SymmTensor.H.
|
inline |
The determinate.
Definition at line 250 of file SymmTensorI.H.
References xx(), xy(), xz(), yy(), yz(), and zz().
Referenced by Foam::det(), and safeInv().


|
inline |
|
inline |
Return adjunct matrix (transpose of cofactor matrix).
Definition at line 283 of file SymmTensorI.H.
References SymmTensor(), xx(), xy(), xz(), yy(), yz(), and zz().
Referenced by cof(), Foam::inv(), inv(), and safeInv().


|
inline |
Return cofactor matrix (transpose of adjunct matrix).
Definition at line 296 of file SymmTensorI.H.
References adjunct().
Referenced by Foam::cof().


|
inline |
Return 2D adjunct matrix by excluding given direction.
Definition at line 304 of file SymmTensorI.H.
References SymmTensor(), xx(), xy(), xz(), yy(), yz(), Foam::Zero, and zz().
Referenced by inv2D().


|
inline |
Return inverse.
Definition at line 356 of file SymmTensorI.H.
References Foam::abort(), adjunct(), Foam::det(), Foam::FatalError, FatalErrorInFunction, Foam::mag(), and Foam::nl.
Referenced by Foam::inv().


|
inline |
Return inverse, with (ad hoc) failsafe handling of 2D tensors.
Definition at line 376 of file SymmTensorI.H.
References adjunct(), Foam::det(), det(), Foam::mag(), Foam::magSqr(), SymmTensor(), xx(), yy(), Foam::Zero, and zz().

|
inline |
Return inverse of 2D tensor (by excluding given direction).
Definition at line 343 of file SymmTensorI.H.
References adjunct2D(), and det2D().

|
inline |
Assign to given SphericalTensor.
Definition at line 434 of file SymmTensorI.H.
References SphericalTensor< Cmpt >::ii(), VectorSpace< SymmTensor< Cmpt >, Cmpt, 6 >::v_, XX, XY, XZ, YY, YZ, Foam::Zero, and ZZ.

Definition at line 112 of file SymmTensorI.H.
|
staticconstexpr |
Rank of SymmTensor is 2.
Definition at line 69 of file SymmTensor.H.
|
static |
Definition at line 74 of file SymmTensor.H.