SPH
Classes | Functions
TracelessTensor.h File Reference

Symmetric traceless 2nd order tensor. More...

#include "objects/geometry/SymmetricTensor.h"

Go to the source code of this file.

Classes

class  TracelessTensor
 Symmetric traceless 2nd order tensor. More...
 

Functions

template<>
INLINE TracelessTensor convert (const AffineMatrix &m)
 
template<>
INLINE AffineMatrix convert (const TracelessTensor &t)
 
INLINE bool almostEqual (const TracelessTensor &t1, const TracelessTensor &t2, const Float eps=EPS)
 Checks if two tensors are equal to some given accuracy. More...
 
template<>
INLINE Float norm (const TracelessTensor &t)
 Arbitrary norm of the tensor. More...
 
template<>
INLINE Float normSqr (const TracelessTensor &t)
 Arbitrary squared norm of the tensor. More...
 
template<>
INLINE Float minElement (const TracelessTensor &t)
 Returns the minimal component of the traceless tensor. More...
 
template<>
INLINE Float maxElement (const TracelessTensor &t)
 Returns the maximal component of the traceless tensor. More...
 
template<>
INLINE auto abs (const TracelessTensor &t)
 Returns the tensor of absolute values form traceless tensor elements. More...
 
template<>
INLINE TracelessTensor sqrtInv (const TracelessTensor &)
 
template<>
INLINE TracelessTensor min (const TracelessTensor &t1, const TracelessTensor &t2)
 Component-wise minimum of two tensors. More...
 
template<>
INLINE TracelessTensor max (const TracelessTensor &t1, const TracelessTensor &t2)
 Component-wise maximum of two tensors. More...
 
template<>
INLINE auto less (const TracelessTensor &t1, const TracelessTensor &t2)
 
template<>
INLINE TracelessTensor clamp (const TracelessTensor &t, const Interval &range)
 Clamps components of the traceless tensor. More...
 
template<>
INLINE Pair< TracelessTensorclampWithDerivative (const TracelessTensor &v, const TracelessTensor &dv, const Interval &range)
 
template<>
INLINE bool isReal (const TracelessTensor &t)
 
INLINE Float ddot (const TracelessTensor &t1, const SymmetricTensor &t2)
 Double-dot product t1 : t2 = sum_ij t1_ij t2_ij. More...
 
INLINE Float ddot (const SymmetricTensor &t1, const TracelessTensor &t2)
 
INLINE Float ddot (const TracelessTensor &t1, const TracelessTensor &t2)
 
template<>
INLINE StaticArray< Float, 6 > getComponents (const TracelessTensor &t)
 

Detailed Description

Symmetric traceless 2nd order tensor.

Author
Pavel Sevecek (sevecek at sirrah.troja.mff.cuni.cz)
Date
2016-2021

Definition in file TracelessTensor.h.

Function Documentation

◆ abs()

template<>
INLINE auto abs ( const TracelessTensor t)

Returns the tensor of absolute values form traceless tensor elements.

This yields a tensor with nonzero trace (unless the tensor has zero diagonal elements).

Definition at line 320 of file TracelessTensor.h.

◆ almostEqual()

INLINE bool almostEqual ( const TracelessTensor t1,
const TracelessTensor t2,
const Float  eps = EPS 
)

Checks if two tensors are equal to some given accuracy.

Definition at line 272 of file TracelessTensor.h.

◆ clamp()

template<>
INLINE TracelessTensor clamp ( const TracelessTensor t,
const Interval range 
)

Clamps components of the traceless tensor.

To preserve the invariant (zero trace), the components are clamped and the trace of the clamped tensor is subtracted from the result. Diagonal components of the traceless tensor can therefore be changed even if they lie within the range. For exact clamping of tensor components, the traceless tensor must be explicitly casted to Tensor.

Definition at line 354 of file TracelessTensor.h.

◆ clampWithDerivative()

template<>
INLINE Pair<TracelessTensor> clampWithDerivative ( const TracelessTensor v,
const TracelessTensor dv,
const Interval range 
)
Todo:
optimize

Definition at line 360 of file TracelessTensor.h.

◆ convert() [1/2]

template<>
INLINE TracelessTensor convert ( const AffineMatrix m)

Definition at line 255 of file TracelessTensor.h.

◆ convert() [2/2]

template<>
INLINE AffineMatrix convert ( const TracelessTensor t)

Definition at line 263 of file TracelessTensor.h.

◆ ddot() [1/3]

INLINE Float ddot ( const SymmetricTensor t1,
const TracelessTensor t2 
)

Definition at line 379 of file TracelessTensor.h.

◆ ddot() [2/3]

INLINE Float ddot ( const TracelessTensor t1,
const SymmetricTensor t2 
)

Double-dot product t1 : t2 = sum_ij t1_ij t2_ij.

Definition at line 375 of file TracelessTensor.h.

◆ ddot() [3/3]

INLINE Float ddot ( const TracelessTensor t1,
const TracelessTensor t2 
)

Definition at line 383 of file TracelessTensor.h.

◆ getComponents()

template<>
INLINE StaticArray<Float, 6> getComponents ( const TracelessTensor t)

Definition at line 388 of file TracelessTensor.h.

◆ isReal()

template<>
INLINE bool isReal ( const TracelessTensor t)

Definition at line 370 of file TracelessTensor.h.

◆ less()

template<>
INLINE auto less ( const TracelessTensor t1,
const TracelessTensor t2 
)

Definition at line 343 of file TracelessTensor.h.

◆ max()

template<>
INLINE TracelessTensor max ( const TracelessTensor t1,
const TracelessTensor t2 
)

Component-wise maximum of two tensors.

Definition at line 337 of file TracelessTensor.h.

◆ maxElement()

template<>
INLINE Float maxElement ( const TracelessTensor t)

Returns the maximal component of the traceless tensor.

Todo:
optimize

Definition at line 307 of file TracelessTensor.h.

◆ min()

template<>
INLINE TracelessTensor min ( const TracelessTensor t1,
const TracelessTensor t2 
)

Component-wise minimum of two tensors.

Definition at line 331 of file TracelessTensor.h.

◆ minElement()

template<>
INLINE Float minElement ( const TracelessTensor t)

Returns the minimal component of the traceless tensor.

Todo:
optimize

Definition at line 297 of file TracelessTensor.h.

◆ norm()

template<>
INLINE Float norm ( const TracelessTensor t)

Arbitrary norm of the tensor.

Todo:
Use some well-defined norm instead? (spectral norm, L1 or L2 norm, ...)
Todo:
optimize

Definition at line 280 of file TracelessTensor.h.

◆ normSqr()

template<>
INLINE Float normSqr ( const TracelessTensor t)

Arbitrary squared norm of the tensor.

Definition at line 289 of file TracelessTensor.h.

◆ sqrtInv()

template<>
INLINE TracelessTensor sqrtInv ( const TracelessTensor )

Definition at line 325 of file TracelessTensor.h.