tensor4(2rheolef)

πŸ“¦
version 7.2 Β· 4 versions
, in debian trixie, ubuntu noble, ubuntu questing

✨ NAME ✨

tensor4 β€” d-dimensional physical fourth-order tensor (rheolef-7.2)

okay so bestie, this page lives in section 2rheolef and it's the whole lore on the tensor4 class. buckle up πŸ’–


πŸ¦‹ DESCRIPTION πŸ¦‹

The tensor4 class defines a d^4 array with floating coefficients. So basically it's the moment when you need a fourth-order tensor in your life β€” like, it's a field(2) with d^4 matrix values chilling at every single physical position. no cap πŸ’…

It's represented as a fourth-dimensional array of coordinates. The coordinate indexes start at zero and finish at d-1, e.g. a(0,0,0,0), a(0,0,0,1), ..., a(2,2,2,2). iconic indexing behaviour fr fr.

The default constructor sets all components to zero:

tensor4 a;

The standard linear algebra is supported. periodt ✨


🌸 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 function, 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);

πŸ‘‘ AUTHOR πŸ‘‘

Pierre Saramito <Pierre.Saramito@imag.fr>


Copyright (C) 2000-2018 Pierre Saramito <Pierre.Saramito@imag.fr>

GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.

This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

bestie this part is not a vibe, it's a contract β€” free software, yes, but NO WARRANTY, fr fr. πŸ™ˆ

that's the whole page, and this little sign-off comes to you from rheolef, Version 7.2, dated like the page itself, section tensor4(2rheolef). slay, go build some fourth-order tensors πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from