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) |
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.
int basix::polyset::dim | ( | cell::type | cell, |
int | d | ||
) |
Dimension of a polynomial space
[in] | cell | The cell type |
[in] | d | The polynomial degree |
d
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.
[in] | celltype | Cell type |
[in] | d | Polynomial degree |
[in] | n | Maximum derivative order. Use n = 0 for the basis only. |
[in] | x | Points at which to evaluate the basis. The shape is (number of points, geometric dimension). |
(number of derivatives computed, number of points, basis index)
.(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.i
correspondign to the point in row i
of x
.