DOKK / manpages / debian 10 / librheolef-dev / basis_option.2rheolef.en
basis_option(2rheolef) rheolef-7.0 basis_option(2rheolef)

basis_option - options of the finite element space

The basis_option class is used to set options for the space constructor of the finite element space (see space(2)). These options are directly transmitted to the basis class when computing the polynomial basis (see basis(2) and basis(1)). There are two main options: Lagrange nodes and raw polynomial basis.

There are two possible node sets. The equispaced, refers to an equispaced set of Lagrange node during interpolation. The warburton one, refers to a non-equispaced optimized set of Lagrange nodes, suitable for high order polynomials (see Warburton, 2006, J. Eng. Math.). With this choice, the interpolation error is dramatically decreased for high order polynomials. The default is the equispaced node set, for backward compatibility purpose.

Some elements are possibly continuous. For instance, Pk elements family, with k >= 1, possibly have continuous interelements reconnections and thus, could define a piecewise polynomial and globaly continuous function. These basis families can be used both as continuous or discontinuous elements. Nevertheless, this choice should be done when building the basis: the information is transmitted during basis construction by sending the basis_option class and setting appropriately this feature with the set_continuous(c) member function.

The raw (or initial) basis is used for building the Lagrange basis, via the Vandermonde matrix and its inverse. Its choice do not change the definition of the FEM basis, but only the way it is builded. There are three possible raw basis. The monomial basis is the simplest choice, suitable for low order polynomials (less than five). For higher order polynomial, the Vandermonde matrix becomes ill-conditionned and its inverse leads to errors in double precision. The dubiner basis (see Dubiner, 1991 J. Sci. Comput.) leads to better condition number. The bernstein basis could also be used as an alternative raw basis. The default is the dubiner raw basis.

The is_option(string) and set(string) members leads to easy setting of combined options at run time. By this way, options can be specified, together with basis basename, on the command line or from a file.

The stamp() member returns an unique string. This string is used for specifying basis options, e.g. on command line or in files. This string is empty when all options are set to default values. Otherwise, it returns a comma separated list of options, enclosed by braces, specifying only non-default options. For instance, combining Warburton node set and Dubiner raw polynomials leads to "{warburton}". Also, combining Warburton node set and Bernstein raw polynomials leads to "{warburton,bernstein}".

Note that the continuous or discontinuous feature is not specified by the stamp() string: it will be specified into the basis basename, by appending a "d" letter, as in "P6d{warburton}".

There are two distinct kind of polynomial basis: the raw basis and the finite element one. (see basis(2) and basis(1)). When using the Pk Lagrange finite element basis, these options are used to transform from one raw (initial) polynomial basis to the Lagrange one, based on a node set. When using an alternative finite element basis, e.g. the spectral Sk or the Bernstein Bk, these options do not have any effect.

class basis_option {
public:
// typedefs:

typedef size_t size_type;
typedef enum {
equispaced = 0,
warburton = 1,
fekete = 2,
max_node = 3
} node_type; // update also node_name[]
typedef enum {
monomial = 0,
bernstein = 1,
dubiner = 2,
max_raw_polynomial = 3
} raw_polynomial_type; // update also raw_polynomial_name[]
static const node_type default_node = basis_option::equispaced;
static const raw_polynomial_type default_raw_polynomial = basis_option::dubiner; // allocators:
basis_option(
node_type nt = default_node,
raw_polynomial_type pt = default_raw_polynomial);
basis_option (const basis_option& sopt);
basis_option& operator= (const basis_option& sopt); // accessors & modifiers:
node_type get_node() const;
raw_polynomial_type get_raw_polynomial() const;
std::string get_node_name() const;
std::string get_raw_polynomial_name() const;
bool is_continuous() const;
bool is_discontinuous() const;
void set_node (node_type type);
void set_raw_polynomial (raw_polynomial_type type);
void set (std::string option_name);
void set_node (std::string node_name);
void set_raw_polynomial (std::string raw_polynomial_name);
void set_continuous (bool c = true);
void set_discontinuous (bool c = false);
bool is_node_name (std::string name) const;
bool is_raw_polynomial_name (std::string name) const;
bool is_option_name (std::string name) const;
std::string stamp() const; // data: protected:
node_type _node;
raw_polynomial_type _poly;
bool _is_continuous; };

space(2), basis(2), basis(1), basis(2), basis(1)

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.

rheolef-7.0 rheolef-7.0