`tensor4`

d-dimensional physical fourth-order tensor

# Description

The `tensor4` class defines a `d^4` array with floating coefficients. This class is suitable for defining fourth-order tensors, i.e. `field` with `d^4` matrix values at each physical position.

It is represented as a fourth-dimensional array of coordinates. The coordinate indexes start at zero and finishes at `d-1`, e.g. `a(0,0,0,0)`, `a(0,0,0,1)`, ..., `a(2,2,2,2)`.

The default constructor set all components to zero:

        tensor4 a;

The standard linear algebra is supported.

# Implementation

This documentation has been generated from file fem/geo_element/tensor4.h

The `tensor4` class is simply an alias to the `tensor4_basic` class

typedef tensor4_basic<Float> tensor4;

The `tensor4_basic` class is a template class with the floating type as parameter:

template<class T>
class tensor4_basic {
public:
typedef size_t size_type;
typedef T element_type;
typedef T float_type;
// allocators:
tensor4_basic ();
explicit tensor4_basic (const T& init_val);
tensor4_basic (const tensor4_basic<T>& a);
static tensor4_basic<T> eye (size_type d = 3);
tensor4_basic (const std::initializer_list<std::initializer_list<
std::initializer_list<std::initializer_list<T> > > >& il);
// affectation:
tensor4_basic<T>& operator= (const tensor4_basic<T>& a);
tensor4_basic<T>& operator= (const T& val);
// accessors:
T& operator()(size_type i, size_type j, size_type k, size_type l);
const T& operator()(size_type i, size_type j, size_type k, size_type l) const;
tensor_basic<T>& operator()(size_type i, size_type j);
const tensor_basic<T>& operator()(size_type i, size_type j) const;
// algebra:
tensor4_basic<T> operator* (const T& k) const;
tensor4_basic<T> operator/ (const T& k) const;
tensor4_basic<T> operator+ (const tensor4_basic<T>& b) const;
tensor4_basic<T> operator- (const tensor4_basic<T>& b) const;
tensor4_basic<T>& operator+= (const tensor4_basic<T>&);
tensor4_basic<T>& operator-= (const tensor4_basic<T>&);
tensor4_basic<T>& operator*= (const T& k);
tensor4_basic<T>& operator/= (const T& k) { return operator*= (1./k); }
// io:
std::ostream& put (std::ostream& out, size_type d=3) const;
};

The norm and contracted product with a second-order tensor is provided, together with the `dexp` fuinction, that represents the derivative of the tensor matrix function.

template <class T>
T norm (const tensor4_basic<T>& a) { return sqrt(norm2(a)); }
template <class T>
T norm2 (const tensor4_basic<T>&);
template <class T>
tensor_basic<T> ddot (const tensor4_basic<T>&, const tensor_basic<T>&);
template <class T>
tensor_basic<T> ddot (const tensor_basic<T>&, const tensor4_basic<T>&);
template <class T>
tensor4_basic<T> dexp (const tensor_basic<T>& a, size_t d = 3);
rheolef::tensor4_basic::tensor4_basic
tensor4_basic()
Definition: tensor4.h:160
rheolef::io::out
@ out
Definition: rheostream.h:167
rheolef::tensor4
tensor4_basic< Float > tensor4
Definition: tensor4.h:133
rheolef::tensor4_basic::operator()
T & operator()(size_type i, size_type j, size_type k, size_type l)
Definition: tensor4.h:194
rheolef::tensor4_basic::element_type
T element_type
Definition: tensor4.h:84
rheolef::tensor4_basic::operator*=
tensor4_basic< T > & operator*=(const T &k)
Definition: tensor4.cc:173
rheolef::norm
T norm(const vec< T, M > &x)
norm(x): see the expression page for the full documentation
Definition: vec.h:387
rheolef::norm2
T norm2(const vec< T, M > &x)
norm2(x): see the expression page for the full documentation
Definition: vec.h:379
rheolef::tensor4_basic::put
std::ostream & put(std::ostream &out, size_type d=3) const
Definition: tensor4.cc:198
rheolef::tensor4_basic::operator-
tensor4_basic< T > operator-(const tensor4_basic< T > &b) const
Definition: tensor4.cc:138
rheolef::tensor4_basic::operator-=
tensor4_basic< T > & operator-=(const tensor4_basic< T > &)
Definition: tensor4.cc:162
rheolef::dexp
tensor4_basic< T > dexp(const tensor_basic< T > &chi, size_t dim)
Definition: tensor4-dexp.cc:37
rheolef::ddot
T ddot(const tensor_basic< T > &a, const tensor_basic< T > &b)
ddot(x,y): see the expression page for the full documentation
Definition: tensor.cc:278
a
Definition: diffusion_isotropic.h:25
rheolef::tensor4_basic::operator=
tensor4_basic< T > & operator=(const tensor4_basic< T > &a)
Definition: tensor4.cc:114
rheolef::tensor4_basic::operator+
tensor4_basic< T > operator+(const tensor4_basic< T > &b) const
Definition: tensor4.cc:125
mkgeo_ball.d
d
Definition: mkgeo_ball.sh:154
rheolef::tensor4_basic::eye
static tensor4_basic< T > eye(size_type d=3)
Definition: tensor4.cc:29
rheolef::tensor4_basic::operator+=
tensor4_basic< T > & operator+=(const tensor4_basic< T > &)
Definition: tensor4.cc:151
mkgeo_ball.b
b
Definition: mkgeo_ball.sh:152
rheolef::tensor4_basic::float_type
T float_type
Definition: tensor4.h:85
size_type
field::size_type size_type
Definition: branch.cc:425
rheolef::tensor4_basic::operator/=
tensor4_basic< T > & operator/=(const T &k)
Definition: tensor4.h:119
rheolef::tensor4_basic::size_type
size_t size_type
Definition: tensor4.h:83
rheolef::tensor4_basic::operator*
tensor4_basic< T > operator*(const T &k) const
Definition: tensor4.h:208
T
Expr1::float_type T
Definition: field_expr.h:218
rheolef::tensor4_basic::operator/
tensor4_basic< T > operator/(const T &k) const
Definition: tensor4.h:228