SPH
Public Member Functions | Static Public Member Functions | Friends | List of all members
Tensor Class Reference

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

#include <Tensor.h>

Public Member Functions

 Tensor ()=default
 
 Tensor (const Float value)
 
 Tensor (const Vector &v1, const Vector &v2, const Vector &v3)
 Construct the matrix from vectors as rows. More...
 
INLINE Floatoperator() (const Size i, const Size j)
 
INLINE Float operator() (const Size i, const Size j) const
 
INLINE Vector column (const Size idx) const
 
INLINE Vector row (const Size idx) const
 
INLINE Tensor transpose () const
 
INLINE Tensor operator+ (const Tensor &other) const
 
INLINE Tensor operator- (const Tensor &other) const
 
INLINE Tensor operator* (const Tensor &other) const
 Matrix multiplication. More...
 
INLINE Vector operator* (const Vector &u) const
 
INLINE Tensoroperator+= (const Tensor &other)
 
INLINE Tensoroperator-= (const Tensor &other)
 
INLINE Tensoroperator*= (const Float value)
 
INLINE Tensoroperator/= (const Float value)
 
INLINE bool operator== (const Tensor &other) const
 
INLINE bool operator!= (const Tensor &other) const
 

Static Public Member Functions

static Tensor null ()
 
static Tensor identity ()
 

Friends

INLINE friend Tensor operator* (const Tensor &t, const Float v)
 
INLINE friend Tensor operator* (const Float v, const Tensor &t)
 
std::ostream & operator<< (std::ostream &stream, const Tensor &t)
 

Detailed Description

Generic 2nd-order tensor with 9 independent components.

Definition at line 13 of file Tensor.h.

Constructor & Destructor Documentation

◆ Tensor() [1/3]

Tensor::Tensor ( )
default

◆ Tensor() [2/3]

Tensor::Tensor ( const Float  value)
inline

Definition at line 20 of file Tensor.h.

◆ Tensor() [3/3]

Tensor::Tensor ( const Vector v1,
const Vector v2,
const Vector v3 
)
inline

Construct the matrix from vectors as rows.

Definition at line 24 of file Tensor.h.

Member Function Documentation

◆ column()

INLINE Vector Tensor::column ( const Size  idx) const
inline

Definition at line 39 of file Tensor.h.

◆ identity()

static Tensor Tensor::identity ( )
inlinestatic

Definition at line 81 of file Tensor.h.

◆ null()

static Tensor Tensor::null ( )
inlinestatic

Definition at line 77 of file Tensor.h.

◆ operator!=()

INLINE bool Tensor::operator!= ( const Tensor other) const
inline

Definition at line 151 of file Tensor.h.

◆ operator()() [1/2]

INLINE Float& Tensor::operator() ( const Size  i,
const Size  j 
)
inline
Parameters
iRow index
jColumn index

Definition at line 29 of file Tensor.h.

◆ operator()() [2/2]

INLINE Float Tensor::operator() ( const Size  i,
const Size  j 
) const
inline

Definition at line 34 of file Tensor.h.

◆ operator*() [1/2]

INLINE Tensor Tensor::operator* ( const Tensor other) const
inline

Matrix multiplication.

Definition at line 95 of file Tensor.h.

◆ operator*() [2/2]

INLINE Vector Tensor::operator* ( const Vector u) const
inline

Definition at line 105 of file Tensor.h.

◆ operator*=()

INLINE Tensor& Tensor::operator*= ( const Float  value)
inline
Todo:
test

Definition at line 132 of file Tensor.h.

◆ operator+()

INLINE Tensor Tensor::operator+ ( const Tensor other) const
inline

Definition at line 86 of file Tensor.h.

◆ operator+=()

INLINE Tensor& Tensor::operator+= ( const Tensor other)
inline

Definition at line 117 of file Tensor.h.

◆ operator-()

INLINE Tensor Tensor::operator- ( const Tensor other) const
inline

Definition at line 90 of file Tensor.h.

◆ operator-=()

INLINE Tensor& Tensor::operator-= ( const Tensor other)
inline

Definition at line 124 of file Tensor.h.

◆ operator/=()

INLINE Tensor& Tensor::operator/= ( const Float  value)
inline

Definition at line 139 of file Tensor.h.

◆ operator==()

INLINE bool Tensor::operator== ( const Tensor other) const
inline

Definition at line 147 of file Tensor.h.

◆ row()

INLINE Vector Tensor::row ( const Size  idx) const
inline

Definition at line 44 of file Tensor.h.

◆ transpose()

INLINE Tensor Tensor::transpose ( ) const
inline

Definition at line 49 of file Tensor.h.

Friends And Related Function Documentation

◆ operator* [1/2]

INLINE friend Tensor operator* ( const Float  v,
const Tensor t 
)
friend

Definition at line 113 of file Tensor.h.

◆ operator* [2/2]

INLINE friend Tensor operator* ( const Tensor t,
const Float  v 
)
friend

Definition at line 109 of file Tensor.h.

◆ operator<<

std::ostream& operator<< ( std::ostream &  stream,
const Tensor t 
)
friend

Definition at line 155 of file Tensor.h.


The documentation for this class was generated from the following file: