Note: this is documentation for an old release. View the latest documentation at docs.fenicsproject.org/basix/v0.9.0/cpp/namespacebasix_1_1polyset.html
Home Installation C++ docs Python docs
Functions
basix::polyset Namespace Reference

Functions

xt::xtensor< double, 3 > tabulate (cell::type celltype, int d, int n, const xt::xarray< double > &x)
 
int dim (cell::type cell, int d)
 

Detailed Description

Orthonormal polynomial basis on reference cell

These are the underlying "expansion sets" for all finite elements, which when multiplied by a set of "coefficients" give the FE basis functions.

The polynomials (and their derivatives) can be tabulated on unit interval, triangle, tetrahedron, quadrilateral, hexahedron, prism and pyramids.

Function Documentation

◆ dim()

int basix::polyset::dim ( cell::type  cell,
int  d 
)

Dimension of a polynomial space

Parameters
[in]cellThe cell type
[in]dThe polynomial degree
Returns
The number terms in the basis spanning a space of polynomial degree d

◆ tabulate()

xt::xtensor< double, 3 > basix::polyset::tabulate ( cell::type  celltype,
int  d,
int  n,
const xt::xarray< double > &  x 
)

Tabulate the orthonormal polynomial basis, and derivatives, at points on the reference cell.

All derivatives up to the given order are computed. If derivatives are not required, use n = 0. For example, order n = 2 for a 2D cell, will compute the basis \(\psi, d\psi/dx, d\psi/dy, d^2 \psi/dx^2, d^2\psi/dxdy, d^2\psi/dy^2\) in that order (0, 0), (1, 0), (0, 1), (2, 0), (1, 1), (0 ,2).

For an interval cell there are nderiv + 1 derivatives, for a 2D cell, there are (nderiv + 1)(nderiv + 2)/2 derivatives, and in 3D, there are (nderiv + 1)(nderiv + 2)(nderiv + 3)/6. The ordering is 'triangular' with the lower derivatives appearing first.

Parameters
[in]celltypeCell type
[in]dPolynomial degree
[in]nMaximum derivative order. Use n = 0 for the basis only.
[in]xPoints at which to evaluate the basis. The shape is (number of points, geometric dimension).
Returns
Polynomial sets, for each derivative, tabulated at points. The shape is (number of derivatives computed, number of points, basis index).
  • The first index is the derivative. The first entry is the basis itself. Derivatives are stored in triangular (2D) or tetrahedral (3D) ordering, e.g. if (p, q) denotes p order dervative with repsect to x and q order derivative with respect to y, [0] -> (0, 0), [1] -> (1, 0), [2] -> (0, 1), [3] -> (2, 0), [4] -> (1, 1), [5] -> (0, 2), [6] -> (3, 0),... The function basix::idx maps tuples (p, q, r) to the array index.
  • The second index is the point, with index i correspondign to the point in row i of x.
  • The third index is the basis function index.
    Todo:
    Does the order for the third index need to be documented?