37 #ifndef AIMS_MATH_TENSOR_H 38 #define AIMS_MATH_TENSOR_H 56 : _trieder( trieder ), _eigenvalue( eigenvalue )
62 _eigenvalue( other._eigenvalue ),
64 _trace( other._trace )
77 const float&
trace()
const {
return _trace; }
78 float&
trace() {
return _trace; }
80 float diffusion(
const Point3df& dir )
const;
82 float meanDiffusivity()
const;
84 float dot(
const Tensor& other )
const;
103 return _coef.item(0) * dir.
item(0) * dir.
item(0) +
104 _coef.item(3) * dir.
item(1) * dir.
item(1) +
105 _coef.item(5) * dir.
item(2) * dir.
item(2) +
106 2.0 * _coef.item(1) * dir.
item(0) * dir.
item(1) +
107 2.0 * _coef.item(2) * dir.
item(0) * dir.
item(2) +
108 2.0 * _coef.item(4) * dir.
item(1) * dir.
item(2);
115 return coef().item(0) * other.
coef().
item(0) +
116 coef().item(3) * other.
coef().
item(3) +
117 coef().item(5) * other.
coef().
item(5) +
118 2.0 * coef().item(1) * other.
coef().
item(1) +
119 2.0 * coef().item(2) * other.
coef().
item(2) +
120 2.0 * coef().item(4) * other.
coef().
item(4) ;
127 return ( coef().item(0) + coef().item(3) + coef().item(5) ) / 3.0;
155 os <<
"{trieder=" << thing.
trieder()
157 <<
",coef=" << thing.
coef()
158 <<
",trace=" << thing.
trace();
AimsVector< float, 6 > _coef
float dot(const Tensor &other) const
Tensor(const Tensor &other)
float meanDiffusivity() const
Tensor(const AimsVector< float, 6 > &coef)
float diffusion(const Point3df &dir) const
const float & trace() const
Tensor(const Trieder &trieder, const Point3df &eigenvalue)
AimsVector< float, 6 > & coef()
const Point3df & eigenvalue() const
AIMSDATA_API float norm(const Tensor &thing)
const Trieder & trieder() const
const AimsVector< float, 6 > & coef() const
AIMSDATA_API std::ostream & operator<<(std::ostream &os, const Tensor &thing)
const T & item(int d) const
AIMSDATA_API int operator==(const Tensor &thing1, const Tensor &thing2)