A templated (3 x 3) symmetric tensor of objects of <T>, effectively containing 6 elements, derived from VectorSpace. More...
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. More... | |
Public Types inherited from VectorSpace< SymmTensor< Cmpt >, Cmpt, 6 > | |
typedef VectorSpace< SymmTensor< 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 | |
SymmTensor ()=default | |
Default construct. More... | |
SymmTensor (const SymmTensor &)=default | |
Copy construct. More... | |
SymmTensor & | operator= (const SymmTensor &)=default |
Copy assignment. More... | |
SymmTensor (const Foam::zero) | |
Construct initialized to zero. More... | |
template<class Cmpt2 > | |
SymmTensor (const VectorSpace< SymmTensor< Cmpt2 >, Cmpt2, 6 > &) | |
Construct given VectorSpace of the same rank. More... | |
SymmTensor (const SphericalTensor< Cmpt > &) | |
Construct given SphericalTensor. More... | |
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. More... | |
SymmTensor (const Cmpt txx, const Cmpt txy, const Cmpt txz, const Cmpt tyy, const Cmpt tyz, const Cmpt tzz) | |
Construct given the six components. More... | |
SymmTensor (Istream &is) | |
Construct from Istream. More... | |
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. More... | |
Vector< Cmpt > | cy () const |
Extract vector for column 1. More... | |
Vector< Cmpt > | cz () const |
Extract vector for column 2. More... | |
template<direction Idx> | |
Vector< Cmpt > | col () const |
Extract vector for given column: compile-time check of index. More... | |
Vector< Cmpt > | col (const direction c) const |
Extract vector for given column (0,1,2): runtime check of index. More... | |
void | col (const direction c, const Vector< Cmpt > &v) |
Set values of given column (0,1,2): runtime check of index. More... | |
void | cols (const Vector< Cmpt > &x, const Vector< Cmpt > &y, const Vector< Cmpt > &z) |
Set column values. More... | |
Vector< Cmpt > | x () const |
Extract vector for row 0. More... | |
Vector< Cmpt > | y () const |
Extract vector for row 1. More... | |
Vector< Cmpt > | z () const |
Extract vector for row 2. More... | |
template<direction Row> | |
Vector< Cmpt > | row () const |
Extract vector for given row: compile-time check of index. More... | |
Vector< Cmpt > | row (const direction r) const |
Extract vector for given row (0,1,2): runtime check of index. More... | |
template<direction Idx> | |
void | row (const Vector< Cmpt > &v) |
Set values of given row: compile-time check of index. More... | |
void | row (const direction r, const Vector< Cmpt > &v) |
Set values of given row (0,1,2): runtime check of row. More... | |
void | rows (const Vector< Cmpt > &x, const Vector< Cmpt > &y, const Vector< Cmpt > &z) |
Set row values. More... | |
Vector< Cmpt > | diag () const |
Extract the diagonal as a vector. More... | |
void | diag (const Vector< Cmpt > &v) |
Set values of the diagonal. More... | |
void | addDiag (const Vector< Cmpt > &v) |
Add to the diagonal. More... | |
void | subtractDiag (const Vector< Cmpt > &v) |
Subtract from the diagonal. More... | |
scalar | diagSqr () const |
The L2-norm squared of the diagonal. More... | |
const SymmTensor< Cmpt > & | T () const noexcept |
Return non-Hermitian transpose. More... | |
Cmpt | det () const |
The determinate. More... | |
Cmpt | det2D (const direction excludeCmpt) const |
The 2D determinant by excluding given direction. More... | |
SymmTensor< Cmpt > | adjunct () const |
Return adjunct matrix (transpose of cofactor matrix) More... | |
SymmTensor< Cmpt > | cof () const |
Return cofactor matrix (transpose of adjunct matrix) More... | |
SymmTensor< Cmpt > | adjunct2D (const direction excludeCmpt) const |
Return 2D adjunct matrix by excluding given direction. More... | |
SymmTensor< Cmpt > | inv () const |
Return inverse. More... | |
SymmTensor< Cmpt > | safeInv () const |
Return inverse, with (ad hoc) failsafe handling of 2D tensors. More... | |
SymmTensor< Cmpt > | inv2D (const direction excludeCmpt) const |
Return inverse of 2D tensor (by excluding given direction) More... | |
void | operator= (const SphericalTensor< Cmpt > &) |
Assign to given SphericalTensor. More... | |
template<Foam::direction Idx> | |
Foam::Vector< Cmpt > | row () const |
Public Member Functions inherited from VectorSpace< SymmTensor< Cmpt >, Cmpt, 6 > | |
VectorSpace ()=default | |
Default construct. More... | |
VectorSpace (const Foam::zero) | |
Construct initialized to zero. More... | |
VectorSpace (const VectorSpace< SymmTensor< 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< SymmTensor< Cmpt >, Cmpt, Ncmpts >::template ConstBlock< SubVector, BStart > | block () const |
const Cmpt & | operator[] (const direction) const |
Cmpt & | operator[] (const direction) |
void | operator= (const VectorSpace< SymmTensor< Cmpt >, Cmpt, Ncmpts > &) |
void | operator= (const Foam::zero) |
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 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 SymmTensor is 2. More... | |
static const SymmTensor | I |
Static Public Attributes inherited from VectorSpace< SymmTensor< Cmpt >, Cmpt, 6 > | |
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 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. More... | |
static SymmTensor< Cmpt > | uniform (const Cmpt &s) |
Return a VectorSpace with all elements = s. More... | |
Public Attributes inherited from VectorSpace< SymmTensor< Cmpt >, Cmpt, 6 > | |
Cmpt | v_ [Ncmpts] |
The components of this vector space. More... | |
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.
|
default |
Copy construct.
|
inline |
Construct initialized to zero.
Definition at line 27 of file SymmTensorI.H.
|
inline |
Construct given VectorSpace of the same rank.
Definition at line 36 of file SymmTensorI.H.
|
inline |
Construct given SphericalTensor.
Definition at line 45 of file SymmTensorI.H.
|
inline |
Construct given the three row (or column) vectors.
Definition at line 55 of file SymmTensorI.H.
|
inline |
Construct given the six components.
Definition at line 68 of file SymmTensorI.H.
|
inlineexplicit |
Construct from Istream.
Definition at line 81 of file SymmTensorI.H.
|
default |
Copy assignment.
|
inlinenoexcept |
Definition at line 150 of file SymmTensor.H.
Referenced by primitiveMeshTools::cellDeterminant(), ReynoldsStress< RASModel< BasicTurbulenceModel > >::checkRealizabilityConditions(), turbulentDFSEMInletFvPatchVectorField::checkStresses(), molecule::constantProperties::constantProperties(), Foam::diag(), Foam::innerSqr(), Foam::invariantII(), Foam::invTransform(), Foam::lerp(), Foam::magSqr(), Foam::operator &(), Foam::operator &&(), Foam::operator+(), Foam::operator-(), Foam::operator/(), Tensor< scalar >::operator=(), Foam::pinv(), SymmTensor< scalar >::safeInv(), Tensor< scalar >::Tensor(), Foam::tr(), and Foam::transform().
|
inlinenoexcept |
Definition at line 151 of file SymmTensor.H.
Referenced by ReynoldsStress< RASModel< BasicTurbulenceModel > >::checkRealizabilityConditions(), turbulentDFSEMInletFvPatchVectorField::checkStresses(), Foam::innerSqr(), Foam::invariantII(), Foam::invTransform(), Foam::lerp(), Foam::magSqr(), Foam::operator &(), Foam::operator &&(), Foam::operator*(), Foam::operator+(), Foam::operator-(), Foam::operator/(), Tensor< scalar >::operator=(), Foam::pinv(), Tensor< scalar >::Tensor(), and Foam::transform().
|
inlinenoexcept |
Definition at line 152 of file SymmTensor.H.
Referenced by Foam::innerSqr(), Foam::invariantII(), Foam::invTransform(), Foam::lerp(), Foam::magSqr(), Foam::operator &(), Foam::operator &&(), Foam::operator*(), Foam::operator+(), Foam::operator-(), Foam::operator/(), Tensor< scalar >::operator=(), Foam::pinv(), Tensor< scalar >::Tensor(), and Foam::transform().
|
inlinenoexcept |
Definition at line 153 of file SymmTensor.H.
Referenced by Foam::pinv().
|
inlinenoexcept |
Definition at line 154 of file SymmTensor.H.
Referenced by primitiveMeshTools::cellDeterminant(), ReynoldsStress< RASModel< BasicTurbulenceModel > >::checkRealizabilityConditions(), turbulentDFSEMInletFvPatchVectorField::checkStresses(), molecule::constantProperties::constantProperties(), Foam::diag(), Foam::innerSqr(), Foam::invariantII(), Foam::invTransform(), Foam::lerp(), Foam::magSqr(), Foam::operator &(), Foam::operator &&(), Foam::operator+(), Foam::operator-(), Foam::operator/(), Tensor< scalar >::operator=(), Foam::pinv(), SymmTensor< scalar >::safeInv(), Tensor< scalar >::Tensor(), Foam::tr(), and Foam::transform().
|
inlinenoexcept |
Definition at line 155 of file SymmTensor.H.
Referenced by Foam::innerSqr(), Foam::invariantII(), Foam::invTransform(), Foam::lerp(), Foam::magSqr(), Foam::operator &(), Foam::operator &&(), Foam::operator*(), Foam::operator+(), Foam::operator-(), Foam::operator/(), Tensor< scalar >::operator=(), Foam::pinv(), Tensor< scalar >::Tensor(), and Foam::transform().
|
inlinenoexcept |
Definition at line 156 of file SymmTensor.H.
Referenced by Foam::pinv().
|
inlinenoexcept |
Definition at line 157 of file SymmTensor.H.
Referenced by Foam::pinv().
|
inlinenoexcept |
Definition at line 158 of file SymmTensor.H.
Referenced by primitiveMeshTools::cellDeterminant(), molecule::constantProperties::constantProperties(), Foam::diag(), Foam::innerSqr(), Foam::invariantII(), Foam::invTransform(), Foam::lerp(), Foam::magSqr(), Foam::operator &(), Foam::operator &&(), Foam::operator+(), Foam::operator-(), Foam::operator/(), Tensor< scalar >::operator=(), Foam::pinv(), SymmTensor< scalar >::safeInv(), Tensor< scalar >::Tensor(), Foam::tr(), 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.
|
inline |
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.
Set column values.
Definition at line 208 of file SymmTensor.H.
|
inline |
Extract vector for row 0.
Definition at line 90 of file SymmTensorI.H.
Referenced by SymmTensor< scalar >::cx().
|
inline |
Extract vector for row 1.
Definition at line 97 of file SymmTensorI.H.
Referenced by SymmTensor< scalar >::cols(), and SymmTensor< scalar >::cy().
|
inline |
Extract vector for row 2.
Definition at line 104 of file SymmTensorI.H.
Referenced by SymmTensor< scalar >::cols(), and SymmTensor< scalar >::cz().
|
inline |
Extract vector for given row: compile-time check of index.
Referenced by SymmTensor< scalar >::col().
|
inline |
Extract vector for given row (0,1,2): runtime check of index.
Definition at line 124 of file SymmTensorI.H.
|
inline |
Set values of given row: compile-time check of index.
Definition at line 142 of file SymmTensorI.H.
Set values of given row (0,1,2): runtime check of row.
Definition at line 177 of file SymmTensorI.H.
Set row values.
Definition at line 163 of file SymmTensorI.H.
Referenced by SymmTensor< scalar >::cols().
|
inline |
Extract the diagonal as a vector.
Definition at line 195 of file SymmTensorI.H.
|
inline |
Set values of the diagonal.
Definition at line 202 of file SymmTensorI.H.
|
inline |
Add to the diagonal.
Definition at line 209 of file SymmTensorI.H.
|
inline |
Subtract from the diagonal.
Definition at line 216 of file SymmTensorI.H.
|
inline |
The L2-norm squared of the diagonal.
Definition at line 223 of file SymmTensorI.H.
|
inlinenoexcept |
Return non-Hermitian transpose.
Definition at line 301 of file SymmTensor.H.
|
inline |
The determinate.
Definition at line 235 of file SymmTensorI.H.
Referenced by Foam::det(), Foam::pinv(), and SymmTensor< scalar >::safeInv().
|
inline |
The 2D determinant by excluding given direction.
Definition at line 247 of file SymmTensorI.H.
|
inline |
Return adjunct matrix (transpose of cofactor matrix)
Definition at line 268 of file SymmTensorI.H.
Referenced by Foam::inv(), and SymmTensor< scalar >::safeInv().
|
inline |
Return cofactor matrix (transpose of adjunct matrix)
Definition at line 281 of file SymmTensorI.H.
Referenced by Foam::cof().
|
inline |
Return 2D adjunct matrix by excluding given direction.
Definition at line 290 of file SymmTensorI.H.
|
inline |
Return inverse.
Definition at line 341 of file SymmTensorI.H.
Referenced by Foam::inv().
|
inline |
Return inverse, with (ad hoc) failsafe handling of 2D tensors.
Definition at line 361 of file SymmTensorI.H.
|
inline |
Return inverse of 2D tensor (by excluding given direction)
Definition at line 329 of file SymmTensorI.H.
|
inline |
Assign to given SphericalTensor.
Definition at line 419 of file SymmTensorI.H.
|
inline |
Definition at line 112 of file SymmTensorI.H.
|
static |
Rank of SymmTensor is 2.
Definition at line 69 of file SymmTensor.H.
|
static |
Definition at line 74 of file SymmTensor.H.