`basis_option`

finite element method options

# Description

The `basis_option` class is used to manage options for the basis constructor of the finite element method. There are two main options: Lagrange nodes and raw polynomial basis.

# String representation

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]"`.

# Notes

There are two distinct kind of polynomial basis: the raw basis and the finite element one. (see `basis` and `basis`). 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.

# Implementation

This documentation has been generated from file fem/lib/basis_option.h

class basis_option {
public:
// typedefs:
typedef size_t size_type;
typedef space_constant::valued_type valued_type;
typedef space_constant::coordinate_type coordinate_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;
bool is_restricted_to_sides() const;
valued_type valued_tag() const;
const std::string& valued() const;
size_type dimension() const { return _dimension; }
coordinate_type coordinate_system() const { return _sys_coord; }
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 d = true);
void set_restricted_to_sides (bool r = true);
void set_valued_tag (valued_type v) { _valued_tag = v; }
void set_dimension (size_type d) { _dimension = d; }
void set_coordinate_system (coordinate_type sc) { _sys_coord = sc; }
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;
size_type
field::size_type size_type
Definition: branch.cc:425
rheolef::basis_option::is_continuous
bool is_continuous() const
Definition: basis_option.h:227
rheolef::basis_option::coordinate_type
space_constant::coordinate_type coordinate_type
Definition: basis_option.h:99
rheolef::basis_option::is_raw_polynomial_name
bool is_raw_polynomial_name(std::string name) const
Definition: basis_option.cc:75
rheolef::basis_option::coordinate_system
coordinate_type coordinate_system() const
Definition: basis_option.h:139
rheolef::basis_option::get_raw_polynomial_name
std::string get_raw_polynomial_name() const
Definition: basis_option.cc:104
rheolef::basis_option::default_node
static const node_type default_node
Definition: basis_option.h:115
rheolef::basis_option::_dimension
size_type _dimension
Definition: basis_option.h:167
rheolef::basis_option::is_restricted_to_sides
bool is_restricted_to_sides() const
Definition: basis_option.h:239
rheolef::basis_option::operator=
basis_option & operator=(const basis_option &sopt)
Definition: basis_option.h:202
rheolef::basis_option::size_type
size_t size_type
Definition: basis_option.h:97
rheolef::basis_option::set_coordinate_system
void set_coordinate_system(coordinate_type sc)
Definition: basis_option.h:151
rheolef::basis_option::is_discontinuous
bool is_discontinuous() const
Definition: basis_option.h:233
rheolef::basis_option::_sys_coord
coordinate_type _sys_coord
Definition: basis_option.h:168
rheolef::basis_option::node_type
node_type
Definition: basis_option.h:101
rheolef::basis_option::equispaced
@ equispaced
Definition: basis_option.h:102
rheolef::basis_option::fekete
@ fekete
Definition: basis_option.h:104
rheolef::basis_option::max_node
@ max_node
Definition: basis_option.h:105
rheolef::basis_option::warburton
@ warburton
Definition: basis_option.h:103
rheolef::basis_option::get_node_name
std::string get_node_name() const
Definition: basis_option.cc:97
rheolef::basis_option::default_raw_polynomial
static const raw_polynomial_type default_raw_polynomial
Definition: basis_option.h:116
rheolef::basis_option::is_option_name
bool is_option_name(std::string name) const
Definition: basis_option.cc:82
rheolef::basis_option::set_dimension
void set_dimension(size_type d)
Definition: basis_option.h:150
rheolef::basis_option::valued_type
space_constant::valued_type valued_type
Definition: basis_option.h:98
rheolef::basis_option::dimension
size_type dimension() const
Definition: basis_option.h:138
rheolef::basis_option::stamp
std::string stamp() const
Definition: basis_option.cc:124
rheolef::basis_option::valued_tag
valued_type valued_tag() const
Definition: basis_option.h:245
rheolef::basis_option::set
void set(std::string option_name)
Definition: basis_option.cc:111
rheolef::basis_option::set_continuous
void set_continuous(bool c=true)
Definition: basis_option.h:269
rheolef::basis_option::set_node
void set_node(node_type type)
Definition: basis_option.h:257
rheolef::basis_option::is_node_name
bool is_node_name(std::string name) const
Definition: basis_option.cc:68
rheolef::basis_option::set_restricted_to_sides
void set_restricted_to_sides(bool r=true)
Definition: basis_option.h:281
rheolef::basis_option::set_raw_polynomial
void set_raw_polynomial(raw_polynomial_type type)
Definition: basis_option.h:263
rheolef::basis_option::raw_polynomial_type
raw_polynomial_type
Definition: basis_option.h:108
rheolef::basis_option::bernstein
@ bernstein
Definition: basis_option.h:110
rheolef::basis_option::monomial
@ monomial
Definition: basis_option.h:109
rheolef::basis_option::max_raw_polynomial
@ max_raw_polynomial
Definition: basis_option.h:112
rheolef::basis_option::dubiner
@ dubiner
Definition: basis_option.h:111
rheolef::basis_option::set_discontinuous
void set_discontinuous(bool d=true)
Definition: basis_option.h:275
rheolef::basis_option::valued
const std::string & valued() const
Definition: basis_option.h:251
rheolef::basis_option::get_raw_polynomial
raw_polynomial_type get_raw_polynomial() const
Definition: basis_option.h:221
rheolef::basis_option::basis_option
basis_option(node_type nt=default_node, raw_polynomial_type pt=default_raw_polynomial)
Definition: basis_option.h:177
rheolef::basis_option::set_valued_tag
void set_valued_tag(valued_type v)
Definition: basis_option.h:149
rheolef::basis_option::_valued_tag
valued_type _valued_tag
Definition: basis_option.h:166
rheolef::basis_option::get_node
node_type get_node() const
Definition: basis_option.h:215
rheolef::type
rheolef::std type
mkgeo_ball.c
int c
Definition: mkgeo_ball.sh:153
mkgeo_ball.d
int d
Definition: mkgeo_ball.sh:154
mkgeo_contraction.name
string name
Definition: mkgeo_contraction.sh:133
rheolef::space_constant::valued_type
valued_type
Definition: space_constant.h:135
rheolef::space_constant::coordinate_type
coordinate_type
Definition: space_constant.h:121
};