SPH
|
Symmetric tensor of 2nd order. More...
#include <SymmetricTensor.h>
Public Member Functions | |
SymmetricTensor ()=default | |
INLINE | SymmetricTensor (const SymmetricTensor &other) |
INLINE | SymmetricTensor (const Vector &diag, const Vector &off) |
Construct tensor given its diagonal vector and a vector of off-diagonal elements (sorted top-bottom and left-right). More... | |
INLINE | SymmetricTensor (const Float value) |
Initialize all components of the tensor to given value. More... | |
INLINE | SymmetricTensor (const Vector &v0, const Vector &v1, const Vector &v2) |
Construct tensor given three vectors as rows. More... | |
INLINE SymmetricTensor & | operator= (const SymmetricTensor &other) |
INLINE Vector | row (const Size idx) const |
Returns a row of the matrix. More... | |
INLINE Float & | operator() (const Size rowIdx, const Size colIdx) |
Returns a given element of the matrix. More... | |
INLINE Float | operator() (const Size rowIdx, const Size colIdx) const |
Returns a given element of the matrix, const version. More... | |
INLINE const Vector & | diagonal () const |
Returns the diagonal part of the tensor. More... | |
INLINE const Vector & | offDiagonal () const |
Returns the off-diagonal elements of the tensor. More... | |
INLINE Vector | operator* (const Vector &v) const |
Applies the tensor on given vector. More... | |
INLINE SymmetricTensor & | operator+= (const SymmetricTensor &other) |
INLINE SymmetricTensor & | operator-= (const SymmetricTensor &other) |
INLINE SymmetricTensor & | operator*= (const Float value) |
INLINE SymmetricTensor & | operator/= (const Float value) |
INLINE SymmetricTensor | operator- () const |
INLINE bool | operator== (const SymmetricTensor &other) const |
INLINE bool | operator!= (const SymmetricTensor &other) const |
INLINE Float | determinant () const |
Returns the determinant of the tensor. More... | |
INLINE Float | trace () const |
Return the trace of the tensor. More... | |
template<int n> | |
INLINE Float | invariant () const |
Returns n-th invariant of the tensor (1<=n<=3) More... | |
INLINE SymmetricTensor | inverse () const |
SymmetricTensor | pseudoInverse (const Float eps) const |
Static Public Member Functions | |
static INLINE SymmetricTensor | identity () |
Returns an identity tensor. More... | |
static INLINE SymmetricTensor | null () |
Returns a tensor with all zeros. More... | |
Friends | |
INLINE friend SymmetricTensor | operator* (const SymmetricTensor &t, const Float v) |
Multiplies a tensor by a scalar. More... | |
INLINE friend SymmetricTensor | operator* (const Float v, const SymmetricTensor &t) |
INLINE friend SymmetricTensor | operator* (const SymmetricTensor &t1, const SymmetricTensor &t2) |
Multiplies a tensor by another tensor, element-wise. Not a matrix multiplication! More... | |
INLINE friend SymmetricTensor | operator/ (const SymmetricTensor &t, const Float v) |
Divides a tensor by a scalar. More... | |
INLINE friend SymmetricTensor | operator/ (const SymmetricTensor &t1, const SymmetricTensor &t2) |
Divides a tensor by another tensor, element-wise. More... | |
INLINE friend SymmetricTensor | operator+ (const SymmetricTensor &t1, const SymmetricTensor &t2) |
Sums up two tensors. More... | |
INLINE friend SymmetricTensor | operator- (const SymmetricTensor &t1, const SymmetricTensor &t2) |
std::ostream & | operator<< (std::ostream &stream, const SymmetricTensor &t) |
Symmetric tensor of 2nd order.
Internally, data are stored in two vectors, representing the diagonal and the off-diagonal components.
Definition at line 18 of file SymmetricTensor.h.
|
default |
|
inline |
Definition at line 26 of file SymmetricTensor.h.
Construct tensor given its diagonal vector and a vector of off-diagonal elements (sorted top-bottom and left-right).
Definition at line 32 of file SymmetricTensor.h.
Initialize all components of the tensor to given value.
Definition at line 37 of file SymmetricTensor.h.
|
inline |
Construct tensor given three vectors as rows.
Matrix represented by the vectors MUST be symmetric, checked by assert.
Definition at line 44 of file SymmetricTensor.h.
Returns the determinant of the tensor.
Definition at line 193 of file SymmetricTensor.h.
Returns the diagonal part of the tensor.
Definition at line 92 of file SymmetricTensor.h.
|
inlinestatic |
Returns an identity tensor.
Definition at line 183 of file SymmetricTensor.h.
Returns n-th invariant of the tensor (1<=n<=3)
Definition at line 205 of file SymmetricTensor.h.
|
inline |
Definition at line 219 of file SymmetricTensor.h.
|
inlinestatic |
Returns a tensor with all zeros.
Definition at line 188 of file SymmetricTensor.h.
Returns the off-diagonal elements of the tensor.
Definition at line 97 of file SymmetricTensor.h.
|
inline |
Definition at line 178 of file SymmetricTensor.h.
Returns a given element of the matrix.
Definition at line 74 of file SymmetricTensor.h.
Returns a given element of the matrix, const version.
Definition at line 83 of file SymmetricTensor.h.
Applies the tensor on given vector.
Definition at line 102 of file SymmetricTensor.h.
|
inline |
Definition at line 154 of file SymmetricTensor.h.
|
inline |
Definition at line 142 of file SymmetricTensor.h.
|
inline |
Definition at line 166 of file SymmetricTensor.h.
|
inline |
Definition at line 148 of file SymmetricTensor.h.
|
inline |
Definition at line 160 of file SymmetricTensor.h.
|
inline |
Definition at line 52 of file SymmetricTensor.h.
|
inline |
Definition at line 174 of file SymmetricTensor.h.
NAMESPACE_SPH_BEGIN SymmetricTensor SymmetricTensor::pseudoInverse | ( | const Float | eps | ) | const |
Definition at line 6 of file SymmetricTensor.cpp.
Returns a row of the matrix.
Definition at line 59 of file SymmetricTensor.h.
Return the trace of the tensor.
Definition at line 199 of file SymmetricTensor.h.
|
friend |
Definition at line 114 of file SymmetricTensor.h.
|
friend |
Multiplies a tensor by a scalar.
Definition at line 110 of file SymmetricTensor.h.
|
friend |
Multiplies a tensor by another tensor, element-wise. Not a matrix multiplication!
Definition at line 119 of file SymmetricTensor.h.
|
friend |
Sums up two tensors.
Definition at line 134 of file SymmetricTensor.h.
|
friend |
Definition at line 138 of file SymmetricTensor.h.
|
friend |
Divides a tensor by a scalar.
Definition at line 124 of file SymmetricTensor.h.
|
friend |
Divides a tensor by another tensor, element-wise.
Definition at line 129 of file SymmetricTensor.h.
|
friend |
Definition at line 236 of file SymmetricTensor.h.