space(2rheolef)
π space(2rheolef) π
okay bestie, so this is space from the rheolef manuals, section 2rheolef β yes the manual name is literally 2rheolef, iconic, we love a quirky section number. it's the piecewise polynomial finite element space, and ngl it's kind of a big deal. let's get into it β¨
πΈ NAME πΈ
space β piecewise polynomial finite element space (rheolef-7.2) π
π¦ DESCRIPTION π¦
so the space class is holding the numbering of the degrees of freedoms. and what even are degrees of freedoms? they're the coefficients in the basis of the vectorial space of piecewise polynomial finite element functions. periodt. π
the whole set of degrees of freedom coefficients gets split into two subsets:
- the unknowns β main character energy
- the blocked degrees of freedoms β these ones are tied to Dirichlet boundary conditions, where the values of the function (and therefore the coefficients) are prescribed. they're on lock π
the unknown degrees of freedom are literally all the others. and after all that, the space class is mainly just a table of renumbering for these coefficients. it's giving spreadsheet, but make it math π
a space is characterized by two entities:
by default, the space is scalar valued. it extends to vector and tensor valued functions. slay π
β¨ EXAMPLE β¨
here's the vibe in code, no cap:
space Q (omega, 'P1');
space V (omega, 'P2', 'vector');
space T (omega, 'P1d', 'tensor');
π PRODUCT OF SPACES π
you can multiply spaces together, fr fr:
space X = T*V*Q;
space Q2 = pow(Q,2);
π SPACE OF REALS π
the space::real() function returns the space of reals, and you can use it inside a product of spaces like this:
space IR = space::real();
space Yh = Xh*IR;
this convention is useful e.g. when a Lagrange multiplier is a real, not a field. it extends to IR^n for any size_t n as:
space IRn = pow(IR,n);
π₯ IMPLEMENTATION π₯
this documentation has been generated from file main/lib/space.h
the space class is simply an alias to the space_basic class
typedef space_basic<Float> space;
the space_basic class provides an interface to a data container:
template <class T>
class space_basic<T,sequential> : public smart_pointer<space_rep<T,sequential> > {
public:
// typedefs:
typedef space_rep<T,sequential> rep;
typedef smart_pointer<rep> base;
typedef typename rep::size_type size_type;
typedef typename rep::valued_type valued_type;
// allocators:
space_basic (const geo_basic<T,sequential>& omega = (geo_basic<T,sequential>()),
std::string approx = "",
std::string prod_valued = "scalar");
space_basic (const geo_basic<T,sequential>& omega,
const basis_basic<T>& b);
space_basic (const space_mult_list<T,sequential>& expr);
space_basic (const space_constitution<T,sequential>& constit);
static space_basic<T,sequential> real();
// accessors:
void block (std::string dom_name);
void unblock(std::string dom_name);
void block (const domain_indirect_basic<sequential>& dom);
void unblock(const domain_indirect_basic<sequential>& dom);
void block_n (std::string dom_name);
void unblock_n(std::string dom_name);
void block_n (const domain_indirect_basic<sequential>& dom);
void unblock_n(const domain_indirect_basic<sequential>& dom);
const distributor& ownership() const;
const communicator& comm() const;
size_type ndof() const;
size_type dis_ndof() const;
const geo_basic<T,sequential>& get_geo() const;
const basis_basic<T>& get_basis() const;
size_type size() const;
valued_type valued_tag() const;
const std::string& valued() const;
space_component<T,sequential> operator[] (size_type i_comp);
space_component_const<T,sequential> operator[] (size_type i_comp) const;
const space_constitution<T,sequential>& get_constitution() const;
size_type degree() const;
std::string get_approx() const;
std::string name() const;
void dis_idof (const geo_element& K, std::vector<size_type>& dis_idof) const;
const distributor& iu_ownership() const;
const distributor& ib_ownership() const;
bool is_blocked (size_type idof) const;
size_type dis_iub (size_type idof) const;
bool dis_is_blocked (size_type dis_idof) const;
size_type dis_idof2dis_iub (size_type dis_idof) const;
const distributor& ios_ownership() const;
size_type idof2ios_dis_idof (size_type idof) const;
size_type ios_idof2dis_idof (size_type ios_idof) const;
const point_basic<T>& xdof (size_type idof) const;
const disarray<point_basic<T>,sequential>& get_xdofs() const;
template <class Function>
T momentum (const Function& f, size_type idof) const;
template <class Function>
point_basic<T> vector_momentum (const Function& f, size_type idof) const;
template <class Function>
tensor_basic<T> tensor_momentum (const Function& f, size_type idof) const;
disarray<size_type, sequential> build_dom_dis_idof2bgd_dis_idof (
const space_basic<T,sequential>& Wh, const std::string& dom_name) const;
disarray<size_type, sequential> build_dom_dis_idof2bgd_dis_idof (
const space_basic<T,sequential>& Wh, const geo_basic<T,sequential>& bgd_gamma) const;
const std::set<size_type>& ext_iu_set() const { return base::data().ext_iu_set(); }
const std::set<size_type>& ext_ib_set() const { return base::data().ext_ib_set(); }
// comparator:
bool operator== (const space_basic<T,sequential>& V2) const { return base::data().operator==(V2.data()); }
bool operator!= (const space_basic<T,sequential>& V2) const { return ! operator== (V2); }
friend bool are_compatible (const space_basic<T,sequential>& V1, const space_basic<T,sequential>& V2) {
return are_compatible (V1.data(), V2.data()); }
// for lazy (un-assembled) on geo_domains:
template <class Set>
void get_parent_subgeo_owner_dis_indexes (Set& ext_dis_idofs) const
{ base::data().get_parent_subgeo_owner_dis_indexes (ext_dis_idofs); }
size_type get_parent_subgeo_owner (size_type dis_idof) const
{ return base::data().get_parent_subgeo_owner (dis_idof); }
};
π«Ά AUTHOR π«Ά
Pierre Saramito <Pierre.Saramito@imag.fr> π
π 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. π (bestie this one is legally binding, don't skip it)
and that's the whole page, babes π this one came from rheolef, Version 7.2, and it lives at space(2rheolef) β go forth and block those degrees of freedom π
β¨π¦
π¦ 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