tensor3(2rheolef)
π 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 π
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
- debian trixie: librheolef-dev 7.2-4 Β· GPL-3.0-or-later
- ubuntu noble: librheolef-dev 7.2-3build5 Β· GPL-3.0-or-later
- ubuntu questing: librheolef-dev 7.2-4build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms