SPH
Classes | Functions
Tensor.h File Reference

Generic tensor of the 2nd order. More...

#include "objects/geometry/SymmetricTensor.h"

Go to the source code of this file.

Classes

class  Tensor
 Generic 2nd-order tensor with 9 independent components. More...
 

Functions

template<>
INLINE AffineMatrix convert (const Tensor &t)
 
template<>
INLINE Tensor convert (const AffineMatrix &t)
 
template<>
INLINE Tensor convert (const SymmetricTensor &t)
 
INLINE SymmetricTensor symmetrize (const Tensor &t)
 Computes a symmetrized tensor 1/2*(t + t^T) More...
 
INLINE Tensor outer (const Vector &r1, const Vector &r2)
 Outer product. More...
 
INLINE bool almostEqual (const Tensor &t1, const Tensor &t2, const Float eps=EPS)
 Checks if two tensors are equal to some given accuracy. More...
 
template<>
INLINE Float norm (const Tensor &t)
 
template<>
INLINE Float normSqr (const Tensor &t)
 Arbitrary squared norm of the tensor. More...
 
template<>
INLINE auto abs (const Tensor &t)
 Returns the tensor of absolute values. More...
 
template<>
INLINE Float minElement (const Tensor &t)
 Returns the minimal element of the tensor. More...
 
template<>
INLINE Float maxElement (const Tensor &t)
 Returns the maximal element of the tensor. More...
 
template<>
INLINE Tensor min (const Tensor &t1, const Tensor &t2)
 Component-wise minimum of two tensors. More...
 
template<>
INLINE Tensor max (const Tensor &t1, const Tensor &t2)
 Component-wise maximum of two tensors. More...
 
template<>
INLINE Tensor clamp (const Tensor &t, const Interval &range)
 Clamping all components by range. More...
 
template<>
INLINE bool isReal (const Tensor &t)
 
template<>
INLINE StaticArray< Float, 6 > getComponents (const Tensor &)
 

Detailed Description

Generic tensor of the 2nd order.

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

Definition in file Tensor.h.

Function Documentation

◆ abs()

template<>
INLINE auto abs ( const Tensor t)

Returns the tensor of absolute values.

Definition at line 211 of file Tensor.h.

◆ almostEqual()

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

Checks if two tensors are equal to some given accuracy.

Definition at line 188 of file Tensor.h.

◆ clamp()

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

Clamping all components by range.

Definition at line 241 of file Tensor.h.

◆ convert() [1/3]

template<>
INLINE Tensor convert ( const AffineMatrix t)

Definition at line 167 of file Tensor.h.

◆ convert() [2/3]

template<>
INLINE Tensor convert ( const SymmetricTensor t)

Definition at line 172 of file Tensor.h.

◆ convert() [3/3]

template<>
INLINE AffineMatrix convert ( const Tensor t)

Definition at line 162 of file Tensor.h.

◆ getComponents()

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

Definition at line 251 of file Tensor.h.

◆ isReal()

template<>
INLINE bool isReal ( const Tensor t)

Definition at line 246 of file Tensor.h.

◆ max()

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

Component-wise maximum of two tensors.

Definition at line 235 of file Tensor.h.

◆ maxElement()

template<>
INLINE Float maxElement ( const Tensor t)

Returns the maximal element of the tensor.

Definition at line 223 of file Tensor.h.

◆ min()

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

Component-wise minimum of two tensors.

Definition at line 229 of file Tensor.h.

◆ minElement()

template<>
INLINE Float minElement ( const Tensor t)

Returns the minimal element of the tensor.

Definition at line 217 of file Tensor.h.

◆ norm()

template<>
INLINE Float norm ( const Tensor t)

Arbitrary norm of the tensor.

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

Definition at line 196 of file Tensor.h.

◆ normSqr()

template<>
INLINE Float normSqr ( const Tensor t)

Arbitrary squared norm of the tensor.

Definition at line 204 of file Tensor.h.

◆ outer()

INLINE Tensor outer ( const Vector r1,
const Vector r2 
)

Outer product.

Definition at line 183 of file Tensor.h.

◆ symmetrize()

INLINE SymmetricTensor symmetrize ( const Tensor t)

Computes a symmetrized tensor 1/2*(t + t^T)

Definition at line 177 of file Tensor.h.