A templated (2 x 2) tensor of objects of <T> derived from VectorSpace. More...
Public Types | |
enum | components { XX, XY, YX, YY } |
Component labeling enumeration. More... | |
typedef Tensor2D< label > | labelType |
Equivalent type of labels used for valid component indexing. More... | |
Public Types inherited from VectorSpace< Tensor2D< Cmpt >, Cmpt, 4 > | |
typedef VectorSpace< Tensor2D< 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 | |
Tensor2D ()=default | |
Default construct. More... | |
Tensor2D (const Tensor2D &)=default | |
Copy construct. More... | |
Tensor2D & | operator= (const Tensor2D &)=default |
Copy assignment. More... | |
Tensor2D (const Foam::zero) | |
Construct initialized to zero. More... | |
Tensor2D (const VectorSpace< Tensor2D< Cmpt >, Cmpt, 4 > &vs) | |
Construct given VectorSpace. More... | |
Tensor2D (const SymmTensor2D< Cmpt > &st) | |
Construct given SymmTensor2D. More... | |
Tensor2D (const SphericalTensor2D< Cmpt > &st) | |
Construct given SphericalTensor2D. More... | |
Tensor2D (const Vector2D< Cmpt > &x, const Vector2D< Cmpt > &y) | |
Construct given the two row vectors. More... | |
Tensor2D (const Cmpt txx, const Cmpt txy, const Cmpt tyx, const Cmpt tyy) | |
Construct given the four components. More... | |
Tensor2D (Istream &is) | |
Construct from Istream. More... | |
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 > | cx () const |
Extract vector for column 0. More... | |
Vector2D< Cmpt > | cy () const |
Extract vector for column 1. More... | |
template<direction Idx> | |
Vector2D< Cmpt > | col () const |
Extract vector for given column: compile-time check of index. More... | |
Vector2D< Cmpt > | col (const direction c) const |
Extract vector for given column (0,1): runtime check of index. More... | |
template<direction Idx> | |
void | col (const Vector2D< Cmpt > &v) |
Set values of given column: compile-time check of index. More... | |
void | col (const direction c, const Vector2D< Cmpt > &v) |
Set values of given column (0,1): runtime check of index. More... | |
void | cols (const Vector2D< Cmpt > &x, const Vector2D< Cmpt > &y) |
Set column values. More... | |
Vector2D< Cmpt > | x () const |
Extract vector for row 0. More... | |
Vector2D< Cmpt > | y () const |
Extract vector for row 1. More... | |
template<direction Idx> | |
Vector2D< Cmpt > | row () const |
Extract vector for given row: compile-time check of index. More... | |
Vector2D< Cmpt > | row (const direction r) const |
Extract vector for given row (0,1): runtime check of index. More... | |
template<direction Idx> | |
void | row (const Vector2D< Cmpt > &v) |
Set values of given row: compile-time check of index. More... | |
void | row (const direction r, const Vector2D< Cmpt > &v) |
Set values of given row (0,1): compile-time check of index. More... | |
void | rows (const Vector2D< Cmpt > &x, const Vector2D< Cmpt > &y) |
Set row values. More... | |
Vector2D< Cmpt > | diag () const |
Extract the diagonal as a vector. More... | |
void | diag (const Vector2D< Cmpt > &v) |
Set values of the diagonal. More... | |
scalar | diagSqr () const |
The L2-norm squared of the diagonal. More... | |
Tensor2D< Cmpt > | T () const |
Return non-Hermitian transpose. More... | |
Cmpt | det () const |
The determinate. More... | |
Tensor2D< Cmpt > | adjunct () const |
Return adjunct matrix (transpose of cofactor matrix) More... | |
Tensor2D< Cmpt > | cof () const |
Return cofactor matrix (transpose of adjunct matrix) More... | |
Tensor2D< Cmpt > | inv () const |
Return inverse. More... | |
Tensor2D< Cmpt > | inner (const Tensor2D< Cmpt > &t2) const |
Inner-product of this with another Tensor2D. More... | |
Tensor2D< Cmpt > | schur (const Tensor2D< Cmpt > &t2) const |
Schur-product of this with another Tensor2D. More... | |
void | operator= (const SymmTensor2D< Cmpt > &) |
Copy assign from SymmTensor2D. More... | |
void | operator= (const SphericalTensor2D< Cmpt > &) |
Copy assign from SphericalTensor2D. More... | |
Vector2D< Cmpt > | vectorComponent (const direction cmpt) const |
Deprecated(2018-12) Return vector for given row (0,1) More... | |
template<Foam::direction Idx> | |
Foam::Vector2D< Cmpt > | col () const |
template<Foam::direction Idx> | |
Foam::Vector2D< Cmpt > | row () const |
Public Member Functions inherited from VectorSpace< Tensor2D< Cmpt >, Cmpt, 4 > | |
VectorSpace ()=default | |
Default construct. More... | |
VectorSpace (const Foam::zero) | |
Construct initialized to zero. More... | |
VectorSpace (const VectorSpace< Tensor2D< 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< Tensor2D< Cmpt >, Cmpt, Ncmpts >::template ConstBlock< SubVector, BStart > | block () const |
const Cmpt & | operator[] (const direction) const |
Cmpt & | operator[] (const direction) |
void | operator= (const VectorSpace< Tensor2D< Cmpt >, Cmpt, Ncmpts > &) |
void | operator= (const Foam::zero) |
void | operator+= (const VectorSpace< Tensor2D< Cmpt >, Cmpt, Ncmpts > &) |
void | operator-= (const VectorSpace< Tensor2D< 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 Tensor2D is 2. More... | |
static const Tensor2D | I |
Static Public Attributes inherited from VectorSpace< Tensor2D< Cmpt >, Cmpt, 4 > | |
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 Tensor2D< Cmpt > | zero |
static const Tensor2D< Cmpt > | one |
static const Tensor2D< Cmpt > | max |
static const Tensor2D< Cmpt > | min |
static const Tensor2D< Cmpt > | rootMax |
static const Tensor2D< Cmpt > | rootMin |
Additional Inherited Members | |
Static Public Member Functions inherited from VectorSpace< Tensor2D< Cmpt >, Cmpt, 4 > | |
static constexpr direction | size () noexcept |
The number of elements in the VectorSpace = Ncmpts. More... | |
static Tensor2D< Cmpt > | uniform (const Cmpt &s) |
Return a VectorSpace with all elements = s. More... | |
Public Attributes inherited from VectorSpace< Tensor2D< Cmpt >, Cmpt, 4 > | |
Cmpt | v_ [Ncmpts] |
The components of this vector space. More... | |
A templated (2 x 2) tensor of objects of <T> derived from VectorSpace.
Definition at line 52 of file Tensor2D.H.
Equivalent type of labels used for valid component indexing.
Definition at line 63 of file Tensor2D.H.
enum components |
|
default |
Default construct.
|
inline |
Construct initialized to zero.
Definition at line 25 of file Tensor2DI.H.
|
inline |
Construct given VectorSpace.
Definition at line 33 of file Tensor2DI.H.
|
inline |
Construct given SymmTensor2D.
Definition at line 42 of file Tensor2DI.H.
References SymmTensor2D< Cmpt >::xx(), SymmTensor2D< Cmpt >::xy(), and SymmTensor2D< Cmpt >::yy().
|
inline |
Construct given SphericalTensor2D.
Definition at line 50 of file Tensor2DI.H.
References SphericalTensor2D< Cmpt >::ii(), and Foam::Zero.
Construct given the two row vectors.
Definition at line 59 of file Tensor2DI.H.
|
inline |
Construct given the four components.
Definition at line 71 of file Tensor2DI.H.
Construct from Istream.
Definition at line 82 of file Tensor2DI.H.
|
inlinenoexcept |
Definition at line 153 of file Tensor2D.H.
References VectorSpace< Tensor2D< Cmpt >, Cmpt, 4 >::v_, and Tensor2D< Cmpt >::XX.
Referenced by Tensor2D< Cmpt >::inner(), Foam::operator &(), Foam::operator &&(), Foam::operator+(), Foam::operator-(), Foam::operator/(), Tensor2D< Cmpt >::schur(), Foam::symm(), Foam::tr(), and Foam::twoSymm().
|
inlinenoexcept |
Definition at line 154 of file Tensor2D.H.
References VectorSpace< Tensor2D< Cmpt >, Cmpt, 4 >::v_, and Tensor2D< Cmpt >::XY.
Referenced by Tensor2D< Cmpt >::inner(), Foam::operator &(), Foam::operator &&(), Foam::operator+(), Foam::operator-(), Foam::operator/(), Tensor2D< Cmpt >::schur(), Foam::skew(), Foam::symm(), and Foam::twoSymm().
|
inlinenoexcept |
Definition at line 155 of file Tensor2D.H.
References VectorSpace< Tensor2D< Cmpt >, Cmpt, 4 >::v_, and Tensor2D< Cmpt >::YX.
Referenced by Tensor2D< Cmpt >::inner(), Foam::operator &(), Foam::operator &&(), Foam::operator+(), Foam::operator-(), Foam::operator/(), Tensor2D< Cmpt >::schur(), Foam::skew(), Foam::symm(), and Foam::twoSymm().
|
inlinenoexcept |
Definition at line 156 of file Tensor2D.H.
References VectorSpace< Tensor2D< Cmpt >, Cmpt, 4 >::v_, and Tensor2D< Cmpt >::YY.
Referenced by Tensor2D< Cmpt >::inner(), Foam::operator &(), Foam::operator &&(), Foam::operator+(), Foam::operator-(), Foam::operator/(), Tensor2D< Cmpt >::schur(), Foam::symm(), Foam::tr(), and Foam::twoSymm().
|
inlinenoexcept |
Definition at line 158 of file Tensor2D.H.
References VectorSpace< Tensor2D< Cmpt >, Cmpt, 4 >::v_, and Tensor2D< Cmpt >::XX.
|
inlinenoexcept |
Definition at line 159 of file Tensor2D.H.
References VectorSpace< Tensor2D< Cmpt >, Cmpt, 4 >::v_, and Tensor2D< Cmpt >::XY.
|
inlinenoexcept |
Definition at line 160 of file Tensor2D.H.
References VectorSpace< Tensor2D< Cmpt >, Cmpt, 4 >::v_, and Tensor2D< Cmpt >::YX.
|
inlinenoexcept |
Definition at line 161 of file Tensor2D.H.
References VectorSpace< Tensor2D< Cmpt >, Cmpt, 4 >::v_, and Tensor2D< Cmpt >::YY.
|
inline |
Extract vector for column 0.
Definition at line 104 of file Tensor2DI.H.
|
inline |
Extract vector for column 1.
Definition at line 110 of file Tensor2DI.H.
|
inline |
Extract vector for given column: compile-time check of index.
|
inline |
Extract vector for given column (0,1): runtime check of index.
Definition at line 129 of file Tensor2DI.H.
References Foam::abort(), Foam::constant::universal::c, Foam::FatalError, FatalErrorInFunction, and Foam::Zero.
|
inline |
Set values of given column: compile-time check of index.
Definition at line 174 of file Tensor2DI.H.
References Vector2D< Cmpt >::x(), and Vector2D< Cmpt >::y().
Set values of given column (0,1): runtime check of index.
Definition at line 234 of file Tensor2DI.H.
References Foam::abort(), Foam::constant::universal::c, Foam::FatalError, and FatalErrorInFunction.
|
inline |
Extract vector for row 0.
Definition at line 91 of file Tensor2DI.H.
Referenced by triSurfaceTools::curvatures().
|
inline |
Extract vector for row 1.
Definition at line 97 of file Tensor2DI.H.
Referenced by triSurfaceTools::curvatures().
|
inline |
Extract vector for given row: compile-time check of index.
Referenced by Tensor2D< Cmpt >::vectorComponent().
|
inline |
Extract vector for given row (0,1): runtime check of index.
Definition at line 157 of file Tensor2DI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, x, y, and Foam::Zero.
|
inline |
Set values of given row: compile-time check of index.
Definition at line 193 of file Tensor2DI.H.
References Vector2D< Cmpt >::x(), and Vector2D< Cmpt >::y().
Set values of given row (0,1): compile-time check of index.
Definition at line 252 of file Tensor2DI.H.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
|
inline |
Extract the diagonal as a vector.
Definition at line 269 of file Tensor2DI.H.
|
inline |
Set values of the diagonal.
Definition at line 276 of file Tensor2DI.H.
References Vector2D< Cmpt >::x(), and Vector2D< Cmpt >::y().
|
inline |
The L2-norm squared of the diagonal.
Definition at line 283 of file Tensor2DI.H.
References Foam::magSqr().
|
inline |
Return non-Hermitian transpose.
Definition at line 296 of file Tensor2DI.H.
|
inline |
The determinate.
Definition at line 307 of file Tensor2DI.H.
Referenced by Foam::det().
|
inline |
Return adjunct matrix (transpose of cofactor matrix)
Definition at line 314 of file Tensor2DI.H.
Referenced by Foam::inv().
|
inline |
Return cofactor matrix (transpose of adjunct matrix)
Definition at line 325 of file Tensor2DI.H.
Referenced by Foam::cof().
|
inline |
Return inverse.
Definition at line 364 of file Tensor2DI.H.
References Foam::abort(), Foam::det(), Foam::FatalError, FatalErrorInFunction, Foam::mag(), and Foam::nl.
Referenced by Foam::inv().
|
inline |
Inner-product of this with another Tensor2D.
Definition at line 333 of file Tensor2DI.H.
References Tensor2D< Cmpt >::xx(), Tensor2D< Cmpt >::xy(), Tensor2D< Cmpt >::yx(), and Tensor2D< Cmpt >::yy().
Referenced by Foam::operator &().
|
inline |
Schur-product of this with another Tensor2D.
Definition at line 350 of file Tensor2DI.H.
References Tensor2D< Cmpt >::xx(), Tensor2D< Cmpt >::xy(), Tensor2D< Cmpt >::yx(), and Tensor2D< Cmpt >::yy().
|
inline |
Copy assign from SymmTensor2D.
Definition at line 385 of file Tensor2DI.H.
References SymmTensor2D< Cmpt >::xx(), SymmTensor2D< Cmpt >::xy(), and SymmTensor2D< Cmpt >::yy().
|
inline |
Copy assign from SphericalTensor2D.
Definition at line 393 of file Tensor2DI.H.
References SphericalTensor2D< Cmpt >::ii(), and Foam::Zero.
Deprecated(2018-12) Return vector for given row (0,1)
Definition at line 320 of file Tensor2D.H.
References Tensor2D< Cmpt >::row().
|
inline |
Definition at line 118 of file Tensor2DI.H.
References Foam::Zero.
|
inline |
Definition at line 146 of file Tensor2DI.H.
References x, y, and Foam::Zero.
|
static |
Rank of Tensor2D is 2.
Definition at line 71 of file Tensor2D.H.
|
static |
Definition at line 76 of file Tensor2D.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.