tensor3(2rheolef)

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

πŸ’– tensor3 β€” bestie edition πŸ’–

okay so we're in the rheolef manual, section 2, and the page is literally called tensor3. hi bestie. come sit, this one's actually kinda iconic πŸ¦‹


✨ NAME ✨

tensor3 β€” a d-dimensional physical third-order tensor, brought to you by rheolef-7.2 πŸ’…


🌸 DESCRIPTION 🌸

so the tensor3 class is giving us a d*d*d array full of floating coefficients. no cap. and it's exactly the right fit for defining third-order tensors, aka a field(2) where every single physical position is holding a d*d*d matrix worth of values. the way that it's just... a whole grid of numbers per point 😭 iconic

it's represented as a tridimensional array of coordinates, and listen β€” the coordinate indexes start at zero and finish at d-1. so like:

a(0,0,0), a(0,0,1), ..., a(2,2,2)

and the default constructor? she sets all the components to zero. queen behavior:

tensor3 a;

also the linear algebra with scalars and tensor(2) is supported, so you can do math with it, periodt πŸ”₯


πŸŽ€ IMPLEMENTATION πŸŽ€

lowkey important: this documentation has been generated from the file fem/geo_element/tensor3.h πŸ“

so the tensor3 class is simply an alias to the tensor3_basic class. that's it, that's the whole thing:

typedef tensor3_basic<Float> tensor3;

and tensor3_basic is a template class with the floating type as its parameter. here's the whole vibe, verbatim, no edits from me bestie πŸ’œ

template<class T>
class tensor3_basic {
public:

  typedef size_t size_type;
  typedef T      element_type;
  typedef T      float_type;

// allocators:

  tensor3_basic (const T& init_val = 0);
  tensor3_basic (const tensor3_basic<T>& a);

// affectation:

  tensor3_basic<T>& operator= (const tensor3_basic<T>& a);
  tensor3_basic<T>& operator= (const T& val);

// accessors:

  T&       operator()(size_type i, size_type j, size_type k);
  const T& operator()(size_type i, size_type j, size_type k) const;

// algebra
  tensor3_basic<T>  operator*  (const T& k) const;
  tensor3_basic<T>  operator/  (const T& k) const;
  tensor_basic<T>   operator*  (const point_basic<T>& v) const;
  tensor3_basic<T>  operator*  (const tensor_basic<T>& b) const;
  tensor3_basic<T>  operator+  (const tensor3_basic<T>& b) const;
  tensor3_basic<T>  operator-  (const tensor3_basic<T>& b) const;
  tensor3_basic<T>& operator+= (const tensor3_basic<T>&);
  tensor3_basic<T>& operator-= (const tensor3_basic<T>&);
  tensor3_basic<T>& operator*= (const T& k);
  tensor3_basic<T>& operator/= (const T& k) { return operator*= (1./k); }

// inputs/outputs:

  std::ostream& put (std::ostream& s, size_type d = 3) const;
  std::istream& get (std::istream&);

};

like, allocators, affectation, accessors, algebra, inputs/outputs β€” the whole friend group is here 🫢


πŸ‘‘ AUTHOR πŸ‘‘

Pierre Saramito <Pierre.Saramito@imag.fr> β€” we stan 🌟


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. 🫣 seriously bestie, none, zero, nada.

okay that's the whole page!! this was tensor3, section 2 of the rheolef manual, and it's Version 7.2 babes 🌈✨ go forth and index your tridimensional arrays from zero πŸ’–πŸ§šβ€β™€οΈπŸ“

πŸ“¦ where this page comes from