Scroll to navigation

basis(2rheolef) rheolef-7.0 basis(2rheolef)

NAME

basis - polynomial basis

SYNOPSIS

The basis class defines functions that evaluates a polynomial basis and its derivatives on a point. The polynomial basis is designated by a string, e.g. "P0", "P1", "P2", "bubble",... indicating the basis family and the polynomial degree. The basis depends also of the reference element: triangle, square, tetrahedron, etc (see reference_element(2)). For instance, on the square reference element, the "P1" string designates the common Q1 four-nodes basis on the reference square. The basis is evaluated by using the eval member function. The nodes associated to the Lagrange polynomial basis are also available by the member function hat_node. The Lagrange basis family is designated by Pk, where k is any polynomial order.

In addition to the usual nodal Lagrange family, two non-nodal basis are provided: the Bernstein family, designated by Bk and the spectral Dubiner family, designated by Sk (see Dubiner, 1991 J. Sci. Comput.). By contrast, these two non-nodal basis are called modal. For these modal basis, the nodes provided by the member function hat_node represent the nodes used by the interpolation operator onto this basis.

The vector-valued Raviart-Thomas family is designated by RTk.

OPTIONS

The Lagrange basis recognize some options, transmitted to the constructor of the basis class: see basis_option(2).

NOTES

The basis class is a smart_pointer(2) class on a basis_rep class that is a pure virtual base class for effective bases, e.g. Pk_lagrange, Pk_bernstein, RTk, etc.

LIMITATIONS

The Sk and RTk basis are still under development.

IMPLEMENTATION

template<class T>
class basis_basic : public smart_pointer_nocopy<basis_rep<T> > {
public:
// typedefs:
  typedef basis_rep<T>              rep;
  typedef smart_pointer_nocopy<rep> base;
  typedef typename rep::size_type   size_type;
  typedef typename rep::valued_type valued_type;
// allocators:
  basis_basic (std::string name = "");
  void reset (std::string& name);
// accessors:
  std::string family_name() const;
  size_type   degree() const;
  std::string name() const;
  size_type   size (reference_element hat_K) const;
  bool is_continuous() const;
  bool is_discontinuous() const;
  const basis_option& option() const;
  valued_type        valued_tag() const;
  const std::string& valued()     const;
  void get_local_idof_on_side (
        reference_element            hat_K,
        const side_information_type& sid,
        arma::Col<size_type>&        loc_idof) const;
// evaluate the basis:
  void eval(
    reference_element           hat_K,
    const point_basic<T>&       hat_x,
    arma::Col<T>&               value) const; // scalar-valued
  void eval(
    reference_element             hat_K,
    const point_basic<T>&         hat_x,
    std::vector<point_basic<T> >& value) const; // vector-valued
  // evaluate it on a node set:
  void eval(
    reference_element                    hat_K,
    const std::vector<point_basic<T> >&  nodes,
    arma::Mat<T>&                        values) const; // scalar-valued
  void eval(
    reference_element                    hat_K,
    const std::vector<point_basic<T> >&  nodes,
    ublas::matrix<point_basic<T> >&      values) const; // vector-valued
  // same, but matrix flatened in a linear arrow of size nrow*ncol
  void eval(
    reference_element                    hat_K,
    const std::vector<point_basic<T> >&  nodes,
    arma::Col<T>&                        values) const; // scalar-valued
// evaluate the gradient of the basis:
  void grad_eval(
    reference_element           hat_K,
    const point_basic<T>&       hat_x,
    std::vector<point_basic<T> >& value) const; // scalar-valued
  void grad_eval(
    reference_element           hat_K,
    const point_basic<T>&       hat_x,
    std::vector<tensor_basic<T> >& value) const; // vector-valued
  // evaluate it on a node set:
  void grad_eval(
    reference_element                    hat_K,
    const std::vector<point_basic<T> >&  nodes,
    ublas::matrix<point_basic<T> >&      values) const; // scalar-valued
  void grad_eval(
    reference_element                    hat_K,
    const std::vector<point_basic<T> >&  nodes,
    ublas::matrix<tensor_basic<T> >&     values) const; // vector-valued
  // same, but matrix flatened in a linear arrow of size nrow*ncol
  void grad_eval(
    reference_element                    hat_K,
    const std::vector<point_basic<T> >&  nodes,
    std::vector<point_basic<T> >&        values) const; // scalar-valued
// compute_dof:
  template <class Function>
  void compute_dof (
    reference_element           hat_K,
    const Function&             f,
    arma::Col<T>&               dofs) const;
  const arma::Mat<T>& vdm     (reference_element hat_K) const;
  const arma::Mat<T>& inv_vdm (reference_element hat_K) const;
// output:
  void put          (std::ostream& os, reference_element hat_K) const;
  void put_hat_node (std::ostream& os, reference_element hat_K) const;
  void put_hat_node_on_side (
    std::ostream&                os,
    reference_element            hat_K,
    const side_information_type& sid) const;
  const std::vector<point_basic<T> >& hat_node (reference_element hat_K) const;
protected:
// internals:
  void _clear() const;
};
typedef basis_basic<Float> basis;

SEE ALSO

reference_element(2), basis_option(2), smart_pointer(2)

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.
rheolef-7.0 rheolef-7.0