basis(2rheolef)
π basis(2rheolef) β the finite element method glow-up π
okay bestie, so this is rheolef-7.2 and we're talking about the basis situation. pull up a chair, grab a strawberry π, because this one is genuinely iconic.
β¨ NAME β¨
basis β the finite element method, no cap π
πΈ DESCRIPTION πΈ
so the class constructor takes a string, right, and that string characterizes the finite element method. think 'P0', 'P1' or 'P2' β those vibes. the letters tell you the finite element family, and the number is the polynomial degree inside that family. it's giving very "first letter is the personality, number is the age".
and like, the finite element also depends on the reference element β triangle, square, tetrahedron, etc. go read reference_element(6) for the full tea, iykyk. for instance, on the square reference element, the 'P1' string designates the common Q1 four-nodes finite element. slay.
π AVAILABLE FINITE ELEMENTS π
Pk
the classical Lagrange finite element family, where k is any polynomial degree greater or equal to 1. the blueprint. the moment. β¨
Pkd
the discontinuous Galerkin finite element family, where k is any polynomial degree greater or equal to 0. and for convenience? P0d could also be written as P0. cute, right?
bubble
the product of barycentric coordinates. only simplicial elements are supported, bestie: edge(6), triangle(6) and tetrahedron(6). that's the whole guest list.
RTk / RTkd
the vector-valued Raviart-Thomas family, where k is any polynomial degree greater or equal to 0. now listen β the RTkd piecewise discontinuous version is fully implemented for the triangle(6). its RTk continuous counterpart is still under development, so don't come for it yet π.
Bk
the Bernstein finite element family, where k is any polynomial degree greater or equal to 1. this basis was initially introduced by Bernstein (Comm. Soc. Math. Kharkov, 2th series, 1912) and more recently used in the context of finite elements. this feature is still under development β it's in its flop era, be patient.
Sk
the spectral finite element family, as proposed by Sherwin and Karniadakis (Oxford University Press, 2nd ed., 2005). here, k is any polynomial degree greater or equal to 1. this feature is still under development too. we're rooting for it π«Ά.
π¦ CONTINUOUS FEATURE π¦
some finite element families could support either continuous or discontinuous junction at inter-element boundaries. it's giving dual citizenship.
for instance, the Pk Lagrange finite element family, with k >= 1, has a continuous interelements junction: it defines a piecewise polynomial and globally continuous finite element functional space(2).
conversely, the Pkd Lagrange finite element family, with k >= 0, has a discontinuous interelements junction: it defines a piecewise polynomial and globally discontinuous finite element functional space(2). opposite energy, same slay.
π OPTIONS π
the basis class supports some options associated to each finite element method. these options get appended to the string between square braces, and they're separated by a coma. for example:
'P5[feteke,bernstein]'
see basis(1) for some examples, bestie. go look, it's worth it.
π LAGRANGE NODES OPTION π
equispacedβ nodes are equispaced. this is the default, the safe choice, the vanilla that never misses.feketeβ nodes are non-equispaced. for high-order polynomial degree, e.g. greater or equal to3, their placement is fully optimized, as proposed by Taylor, Wingate and Vincent, 2000,SIAM J. Numer. Anal.. with this choice, the interpolation error is dramatically decreased for high order polynomials. but β and this is the catch β this feature is still restricted to thetrianglereference element and to polynomial degree lower or equal to19. otherwise, it fall back to the followingwarburtonnode set. so it's giving "amazing until it isn't".warburtonβ nodes are non-equispaced. for high-order polynomial degree, e.g. greater or equal to3, their placement is optimized thought an heuristic solution, as proposed by Warburton, 2006,J. Eng. Math.. with this choice, the interpolation error is dramatically decreased for high order polynomials. and this one applies to any reference element and polynomial degree. no restrictions, no gatekeeping, we love to see it.
π₯ RAW POLYNOMIAL BASIS π₯
the raw (or initial) polynomial basis is used for building the dual basis, associated to degrees of freedom, via the Vandermonde matrix and its inverse. and listen, changing the raw basis do not change the definition of the FEM basis β it only changes the way it is constructed. same girl, different getting-ready routine.
there are three possible raw basis:
monomialβ the monomial basis is the simplest choice. while it is suitable for low polynomial degree (less than five), for higher polynomial degree the Vandermonde matrix becomes ill-conditioned and its inverse leads to errors in double precision. so like, cute for the little ones, absolutely not for the big ones π.dubinerβ the Dubiner basis (see Dubiner,1991 J. Sci. Comput.) leads to much better condition number. this is the default. the main character. πbernsteinβ the Bernstein basis could also be an alternative raw basis. options, options.
π§ INTERNALS: EVALUATE AND INTERPOLATE π§
the basis class defines member functions that evaluates all the polynomial basis functions of a finite element and their derivatives at a point or a set of point. yes, derivatives too, she does it all.
the basis polynomial functions are evaluated by the evaluate member function. this member function is called during the assembly process of the integrate(3) function. so that's where she lives.
the interpolation nodes used by the interpolate(3) function are available by the member function hat_node. conversely, the member function compute_dofs compute the degrees of freedom. they're a duo, they're a package deal π«Ά.
β IMPLEMENTATION β
this documentation has been generated from file fem/lib/basis.h. ngl that's kind of a flex.
the basis class is simply an alias to the basis_basic class:
typedef basis_basic<Float> basis;
the basis_basic class provides an interface to a data container:
template<class T>
class basis_basic : public smart_pointer_nocopy<basis_rep<T> >,
public persistent_table<basis_basic<T> > {
public:
// typedefs:
typedef basis_rep<T> rep;
typedef smart_pointer_nocopy<rep> base;
typedef typename rep::size_type size_type;
typedef typename rep::value_type value_type;
typedef typename rep::valued_type valued_type;
// allocators:
basis_basic (std::string name = "");
void reset (std::string& name);
void reset_family_index (size_type k);
// accessors:
bool is_initialized() const { return base::operator->() != 0; }
size_type degree() const;
size_type family_index() const;
std::string family_name() const;
std::string name() const;
size_type ndof (reference_element hat_K) const;
size_type nnod (reference_element hat_K) const;
bool is_continuous() const;
bool is_discontinuous() const;
bool is_nodal() const;
bool have_continuous_feature() const;
bool have_compact_support_inside_element() const;
bool is_hierarchical() const;
size_type size() const;
const basis_basic<T>& operator[] (size_type i_comp) const;
bool have_index_parameter() const;
const basis_option& option() const;
valued_type valued_tag() const;
const std::string& valued() const;
const piola_fem<T>& get_piola_fem() const;
};
look at that API. she's thorough. she's organized. she's everything. π
π· 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. (yes, all caps, they mean it, respect it.)
okay that's the whole page, bestie. every flag, every family, every node set, every fallback. nothing skipped. periodt. π β¨
and that's a wrap on rheolef Version 7.2, basis(2rheolef) β mwah, go build something iconic ππ¦π
π¦ 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