39#ifndef Foam_SymmTensor_H
40#define Foam_SymmTensor_H
100 template<
class Cmpt2>
112 const bool transposed =
false
118 const Cmpt txx,
const Cmpt txy,
const Cmpt txz,
119 const Cmpt tyy,
const Cmpt tyz,
164 template<direction Idx>
197 template<direction Row>
204 template<direction Idx>
240 inline bool is_identity(
const scalar tol = ROOTVSMALL)
const;
249 inline Cmpt
det()
const;
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A templated (3 x 3) diagonal tensor of objects of <T>, effectively containing 1 element,...
A templated (3 x 3) symmetric tensor of objects of <T>, effectively containing 6 elements,...
void diag(const Vector< Cmpt > &v)
Set values of the diagonal.
scalar diagSqr() const
The L2-norm squared of the diagonal.
void row(const Vector< Cmpt > &v)
Set values of given row: compile-time check of index.
bool is_identity(const scalar tol=ROOTVSMALL) const
Is identity tensor?
SymmTensor(Foam::zero)
Construct initialized to zero.
SymmTensor< Cmpt > adjunct() const
Return adjunct matrix (transpose of cofactor matrix).
SymmTensor< Cmpt > inv2D(const direction excludeCmpt) const
Return inverse of 2D tensor (by excluding given direction).
const Cmpt & yy() const noexcept
const SymmTensor< Cmpt > & T() const noexcept
Return non-Hermitian transpose.
void addDiag(const Vector< Cmpt > &v)
Add to the diagonal.
void rows(const Vector< Cmpt > &x, const Vector< Cmpt > &y, const Vector< Cmpt > &z)
Set row values.
components
Component labeling enumeration.
SymmTensor(const SymmTensor &)=default
Copy construct.
Cmpt det2D(const direction excludeCmpt) const
The 2D determinant by excluding given direction.
void row(const direction r, const Vector< Cmpt > &v)
Set values of given row (0,1,2): runtime check of row.
Vector< Cmpt > row() const
Extract vector for given row: compile-time check of index.
void subtractDiag(const Vector< Cmpt > &v)
Subtract from the diagonal.
SymmTensor< Cmpt > cof() const
Return cofactor matrix (transpose of adjunct matrix).
Vector< scalar > z() const
static constexpr direction rank
const Cmpt & zy() const noexcept
const Cmpt & yx() const noexcept
void col(const direction c, const Vector< Cmpt > &v)
Set values of given column (0,1,2): runtime check of index.
Vector< Cmpt > cy() const
Extract vector for column 1.
SymmTensor(Istream &is)
Construct from Istream.
Vector< Cmpt > cz() const
Extract vector for column 2.
SymmTensor< Cmpt > adjunct2D(const direction excludeCmpt) const
Return 2D adjunct matrix by excluding given direction.
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(const SphericalTensor< Cmpt > &)
Construct given SphericalTensor.
Cmpt det() const
The determinate.
Vector< Cmpt > cx() const
Extract vector for column 0.
Vector< Cmpt > col(const direction c) const
Extract vector for given column (0,1,2): runtime check of index.
Vector< Cmpt > row(const direction r) const
Extract vector for given row (0,1,2): runtime check of index.
SymmTensor(const VectorSpace< SymmTensor< Cmpt2 >, Cmpt2, 6 > &)
Construct given VectorSpace of the same rank.
void cols(const Vector< Cmpt > &x, const Vector< Cmpt > &y, const Vector< Cmpt > &z)
Set column values.
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.
Vector< scalar > y() const
const Cmpt & xx() const noexcept
SymmTensor< Cmpt > safeInv() const
Return inverse, with (ad hoc) failsafe handling of 2D tensors.
Vector< Cmpt > col() const
Extract vector for given column: compile-time check of index.
static const SymmTensor I
const Cmpt & yz() const noexcept
void operator=(const SphericalTensor< Cmpt > &)
Assign to given SphericalTensor.
Vector< Cmpt > diag() const
Extract the diagonal as a vector.
SymmTensor< Cmpt > inv() const
Return inverse.
const Cmpt & zz() const noexcept
const Cmpt & xy() const noexcept
SymmTensor & operator=(const SymmTensor &)=default
Copy assignment.
SymmTensor()=default
Default construct.
SymmTensor< label > labelType
const Cmpt & xz() const noexcept
const Cmpt & zx() const noexcept
Vector< scalar > x() const
Cmpt v_[Ncmpts]
The components of this vector space.
friend Ostream & operator(Ostream &, const VectorSpace< Form, Cmpt, Ncmpts > &)
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
SymmTensor< solveScalar > type
The extended precision type (solveScalar for float).
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
A template class to specify if a data type is composed solely of Foam::label elements.
A template class to specify if a data type is composed solely of Foam::scalar elements.
A template class to specify that a data type can be considered as being contiguous in memory.