basix.polynomials

Functions for working with polynomials.

Functions

dim(ptype, celltype, degree)

Dimension of a polynomial space.

reshape_coefficients(poly_type, cell_type, ...)

Reshape the coefficients.

restriction(ptype, cell, restriction_cell)

Get the polyset type that represents the restrictions of a type on a subentity.

string_to_polyset_type(pname)

Convert a string to a Basix PolysetType.

superset(cell, type1, type2)

Get the polyset type that is a superset of two types on the given cell.

tabulate_polynomial_set(celltype, ptype, ...)

Tabulate a polynomial set.

tabulate_polynomials(ptype, celltype, ...)

Tabulate a set of polynomials on a reference cell.

Classes

PolynomialType(value[, names, module, ...])

Polynomial type.

PolysetType(value[, names, module, ...])

Polyset type.

basix.polynomials.dim(ptype: PolynomialType, celltype: CellType, degree: int) int

Dimension of a polynomial space.

Parameters:
  • ptype – The polynomial type

  • celltype – The cell type

  • degree – The polynomial degree

Returns:

The dimension of the polynomial space

basix.polynomials.reshape_coefficients(poly_type: PolynomialType, cell_type: CellType, coefficients: ndarray[Any, dtype[float64]], value_size: int, input_degree: int, output_degree: int) ndarray[Any, dtype[float64]]

Reshape the coefficients.

Parameters:
  • poly_type – The polynomial type.

  • cell_type – The cell type

  • coefficients – The coefficients

  • value_size – The value size of the polynomials associated with the coefficients.

  • input_degree – The maximum degree of polynomials associated with the input coefficients.

  • output_degree – The maximum degree of polynomials associated with the output coefficients.

Returns:

Coefficients representing the same coefficients as the input in the set of polynomials of the output degree.

basix.polynomials.tabulate_polynomial_set(celltype: CellType, ptype: PolysetType, degree: int, nderiv: int, pts: ndarray[Any, dtype[_ScalarType_co]]) ndarray[Any, dtype[_ScalarType_co]]

Tabulate a polynomial set.

Parameters:
  • celltype – The cell type

  • ptype – The polyset type

  • degree – The polynomial degree

  • nderiv – The number of derivatives

  • pts – The points to tabulat at

Returns:

Tabulated polynomial set