SPH
|
Symmetric traceless 2nd order tensor. More...
#include <TracelessTensor.h>
Public Member Functions | |
INLINE | TracelessTensor ()=default |
INLINE | TracelessTensor (const TracelessTensor &other)=default |
INLINE | TracelessTensor (const SymmetricTensor &other) |
Construct traceless tensor using other tensor (not traceless in general). More... | |
INLINE | TracelessTensor (const Float value) |
Initialize all components of the tensor to given value, excluding last element of the diagonal, which is computed to keep the trace zero. More... | |
INLINE | TracelessTensor (const Float xx, const Float yy, const Float xy, const Float xz, const Float yz) |
Initialize tensor given 5 independent components. More... | |
INLINE | TracelessTensor (const Vector &v0, const Vector &v1, const Vector &v2) |
Construct tensor given three vectors as rows. More... | |
INLINE TracelessTensor & | operator= (const TracelessTensor &other) |
INLINE TracelessTensor & | operator= (const SymmetricTensor &other) |
INLINE | operator SymmetricTensor () const |
Conversion to ordinary SymmetricTensor. More... | |
INLINE Vector | row (const int idx) const |
Returns a row of the matrix. More... | |
INLINE Vector | diagonal () const |
Returns diagonal of the matrix. More... | |
INLINE Vector | offDiagonal () const |
Returns off-diagonal elements of the matrix. More... | |
INLINE Float | operator() (const int rowIdx, const int colIdx) const |
Returns a given element of the matrix. More... | |
INLINE Vector | operator* (const Vector &v) const |
Applies the tensor on given vector. More... | |
INLINE TracelessTensor & | operator+= (const TracelessTensor &other) |
INLINE TracelessTensor & | operator-= (const TracelessTensor &other) |
INLINE TracelessTensor & | operator*= (const Float value) |
INLINE TracelessTensor & | operator/= (const Float value) |
INLINE TracelessTensor | operator- () const |
INLINE bool | operator== (const TracelessTensor &other) const |
INLINE bool | operator!= (const TracelessTensor &other) const |
Static Public Member Functions | |
static INLINE TracelessTensor | null () |
Returns a tensor with all zeros. More... | |
Friends | |
template<typename T > | |
Float | minElement (const T &t) |
Returns minimum element, simply the value iself by default. More... | |
template<typename T > | |
Float | maxElement (const T &t) |
Returns maximum element, simply the value iself by default. More... | |
template<typename T > | |
auto | abs (const T &t) |
template<typename T > | |
T | sqrtInv (const T &t) |
template<typename T > | |
constexpr friend T | min (const T &t1, const T &t2) |
Minimum & Maximum value. More... | |
template<typename T > | |
constexpr friend T | max (const T &t1, const T &t2) |
template<typename T > | |
T | clamp (const T &t, const Interval &range) |
template<typename T > | |
constexpr friend auto | less (const T &t1, const T &t2) |
Compares two objects of the same time component-wise. More... | |
INLINE friend TracelessTensor | operator* (const TracelessTensor &t, const Float v) |
Multiplies the tensor by a scalar. More... | |
INLINE friend TracelessTensor | operator* (const Float v, const TracelessTensor &t) |
INLINE friend TracelessTensor | operator/ (const TracelessTensor &t, const Float v) |
Divides a tensor by a scalar. More... | |
INLINE friend TracelessTensor | operator+ (const TracelessTensor &t1, const TracelessTensor &t2) |
INLINE friend TracelessTensor | operator- (const TracelessTensor &t1, const TracelessTensor &t2) |
INLINE friend bool | operator== (const TracelessTensor &t1, const SymmetricTensor &t2) |
INLINE friend bool | operator== (const SymmetricTensor &t1, const TracelessTensor &t2) |
INLINE friend bool | operator!= (const TracelessTensor &t1, const SymmetricTensor &t2) |
INLINE friend bool | operator!= (const SymmetricTensor &t1, const TracelessTensor &t2) |
std::ostream & | operator<< (std::ostream &stream, const TracelessTensor &t) |
Symmetric traceless 2nd order tensor.
Only the independenct components of the tensor are stored, the other components are computed on the fly, thus ensuring the tensor will always be symmetric and traceless.
Definition at line 16 of file TracelessTensor.h.
|
default |
|
default |
|
inlineexplicit |
Construct traceless tensor using other tensor (not traceless in general).
"Tracelessness" of the tensor is checked by assert.
Definition at line 59 of file TracelessTensor.h.
Initialize all components of the tensor to given value, excluding last element of the diagonal, which is computed to keep the trace zero.
This constructor is mainly used to create null tensor; for non-zero values should be used sparingly.
Definition at line 73 of file TracelessTensor.h.
|
inline |
Initialize tensor given 5 independent components.
Definition at line 78 of file TracelessTensor.h.
|
inline |
Construct tensor given three vectors as rows.
Matrix represented by the vectors MUST be symmetric and traceless, checked by assert.
Definition at line 85 of file TracelessTensor.h.
Returns diagonal of the matrix.
Definition at line 126 of file TracelessTensor.h.
|
inlinestatic |
Returns a tensor with all zeros.
Definition at line 243 of file TracelessTensor.h.
Returns off-diagonal elements of the matrix.
Definition at line 131 of file TracelessTensor.h.
|
inlineexplicit |
Conversion to ordinary SymmetricTensor.
Definition at line 106 of file TracelessTensor.h.
|
inline |
Definition at line 230 of file TracelessTensor.h.
Returns a given element of the matrix.
Does NOT returns a reference last element of diagonal is always computed from others and is not stored in the object.
Definition at line 139 of file TracelessTensor.h.
Applies the tensor on given vector.
Definition at line 159 of file TracelessTensor.h.
|
inline |
Definition at line 202 of file TracelessTensor.h.
|
inline |
Definition at line 190 of file TracelessTensor.h.
|
inline |
Definition at line 214 of file TracelessTensor.h.
|
inline |
Definition at line 196 of file TracelessTensor.h.
|
inline |
Definition at line 208 of file TracelessTensor.h.
|
inline |
Definition at line 100 of file TracelessTensor.h.
|
inline |
Definition at line 94 of file TracelessTensor.h.
|
inline |
Definition at line 218 of file TracelessTensor.h.
Returns a row of the matrix.
Definition at line 111 of file TracelessTensor.h.
|
friend |
Computes absolute value.
Definition at line 276 of file MathUtils.h.
|
friend |
Overload of clamp method using range instead of lower and upper bound as values. Can be used by other Floats by specializing the method
Definition at line 120 of file Interval.h.
|
friend |
Compares two objects of the same time component-wise.
Returns object containing components 0 or 1, depending whether components of the first objects are smaller than components of the second object.
|
friend |
Definition at line 20 of file MathBasic.h.
|
friend |
|
friend |
Minimum & Maximum value.
Definition at line 15 of file MathBasic.h.
|
friend |
|
friend |
Definition at line 238 of file TracelessTensor.h.
|
friend |
Definition at line 234 of file TracelessTensor.h.
|
friend |
Definition at line 170 of file TracelessTensor.h.
|
friend |
Multiplies the tensor by a scalar.
Definition at line 166 of file TracelessTensor.h.
|
friend |
Definition at line 182 of file TracelessTensor.h.
|
friend |
Definition at line 186 of file TracelessTensor.h.
|
friend |
Divides a tensor by a scalar.
Definition at line 175 of file TracelessTensor.h.
|
friend |
Definition at line 247 of file TracelessTensor.h.
|
friend |
Definition at line 226 of file TracelessTensor.h.
|
friend |
Definition at line 222 of file TracelessTensor.h.
|
friend |
Returns an approximate value of inverse square root.
Iters | Number of iterations of the algorithm. Higher value = more accurate result. |
Definition at line 44 of file MathUtils.h.