Basix Python interface documentation¶
basix¶
Basix is a finite element definition and tabulation runtime library.
The core of the library is written in C++, but the majority of Basix’s functionality can be used via this Python interface.
- class basix.CellType(self: basix._basixcpp.CellType, value: int) None ¶
Bases:
pybind11_builtins.pybind11_object
Members:
point
interval
triangle
tetrahedron
quadrilateral
hexahedron
prism
pyramid
- hexahedron = <CellType.hexahedron: 5>¶
- interval = <CellType.interval: 1>¶
- property name¶
- point = <CellType.point: 0>¶
- prism = <CellType.prism: 6>¶
- pyramid = <CellType.pyramid: 7>¶
- quadrilateral = <CellType.quadrilateral: 4>¶
- tetrahedron = <CellType.tetrahedron: 3>¶
- triangle = <CellType.triangle: 2>¶
- property value¶
- class basix.ElementFamily(self: basix._basixcpp.ElementFamily, value: int) None ¶
Bases:
pybind11_builtins.pybind11_object
Members:
custom
P
DP
BDM
RT
N1E
N2E
Regge
Bubble
Serendipity
DPC
CR
- BDM = <ElementFamily.BDM: 4>¶
- Bubble = <ElementFamily.Bubble: 10>¶
- CR = <ElementFamily.CR: 6>¶
- DP = <ElementFamily.DP: 8>¶
- DPC = <ElementFamily.DPC: 9>¶
- N1E = <ElementFamily.N1E: 3>¶
- N2E = <ElementFamily.N2E: 5>¶
- P = <ElementFamily.P: 1>¶
- RT = <ElementFamily.RT: 2>¶
- Regge = <ElementFamily.Regge: 7>¶
- Serendipity = <ElementFamily.Serendipity: 11>¶
- custom = <ElementFamily.custom: 0>¶
- property name¶
- property value¶
- class basix.LatticeType(self: basix._basixcpp.LatticeType, value: int) None ¶
Bases:
pybind11_builtins.pybind11_object
Members:
equispaced
gll
- equispaced = <LatticeType.equispaced: 0>¶
- gll = <LatticeType.gll: 1>¶
- property name¶
- property value¶
- basix.compute_jacobi_deriv(arg0: float, arg1: int, arg2: int, arg3: numpy.ndarray[numpy.float64]) numpy.ndarray[numpy.float64] ¶
Compute jacobi polynomial and derivatives at points
- basix.create_element(*args, **kwargs)¶
Overloaded function.
create_element(arg0: basix._basixcpp.ElementFamily, arg1: basix._basixcpp.CellType, arg2: int) -> basix._basixcpp.FiniteElement
Create a FiniteElement of a given family, celltype and degree
create_element(arg0: basix._basixcpp.ElementFamily, arg1: basix._basixcpp.CellType, arg2: int, arg3: basix._basixcpp.LatticeType) -> basix._basixcpp.FiniteElement
Create a FiniteElement of a given family, celltype, degree and lattice type
- basix.create_lattice(arg0: basix::cell::type, arg1: int, arg2: basix._basixcpp.LatticeType, arg3: bool) numpy.ndarray[numpy.float64] ¶
Create a uniform lattice of points on a reference cell
- basix.geometry(arg0: basix::cell::type) numpy.ndarray[numpy.float64] ¶
Geometric points of a reference cell
- basix.index(*args, **kwargs)¶
Overloaded function.
index(arg0: int) -> int
Indexing for 1D arrays
index(arg0: int, arg1: int) -> int
Indexing for triangular arrays
index(arg0: int, arg1: int, arg2: int) -> int
Indexing for tetrahedral arrays
- basix.make_quadrature(arg0: str, arg1: basix._basixcpp.CellType, arg2: int) Tuple[numpy.ndarray[numpy.float64], numpy.ndarray[numpy.float64]] ¶
Compute quadrature points and weights on a reference cell
- basix.tabulate_polynomial_set(arg0: basix._basixcpp.CellType, arg1: int, arg2: int, arg3: numpy.ndarray[numpy.float64]) numpy.ndarray[numpy.float64] ¶
Tabulate orthonormal polynomial expansion set
- basix.topology(arg0: basix::cell::type) List[List[List[int]]] ¶
Topological description of a reference cell
basix.cell¶
Functions to get cell geometry information and manipulate cell types.
- basix.cell.facet_jacobians()¶
cell_facet_jacobians(arg0: basix._basixcpp.CellType) -> numpy.ndarray[numpy.float64]
Get the jacobians of the facets of a cell
- basix.cell.facet_normals()¶
cell_facet_normals(arg0: basix._basixcpp.CellType) -> numpy.ndarray[numpy.float64]
Get the normals to the facets of a cell
- basix.cell.facet_orientations()¶
cell_facet_orientations(arg0: basix._basixcpp.CellType) -> List[bool]
Get the orientations of the facets of a cell
- basix.cell.facet_outward_normals()¶
cell_facet_outward_normals(arg0: basix._basixcpp.CellType) -> numpy.ndarray[numpy.float64]
Get the outward normals to the facets of a cell
- basix.cell.facet_reference_volumes()¶
cell_facet_reference_volumes(arg0: basix._basixcpp.CellType) -> numpy.ndarray[numpy.float64]
Get the reference volumes of the facets of a cell
- basix.cell.string_to_type(cell: str)¶
Convert a string to a Basix CellType.
- basix.cell.sub_entity_connectivity(arg0: basix::cell::type) List[List[List[List[int]]]] ¶
Connectivity between subentities of a reference cell
- basix.cell.type_to_string(celltype: basix._basixcpp.CellType)¶
Convert a Basix CellType to a string.
- basix.cell.volume()¶
cell_volume(arg0: basix._basixcpp.CellType) -> float
Get the volume of a cell
basix.finite_element¶
Functions for creating finite elements.
- basix.finite_element.string_to_family(family: str, cell: str)¶
Get a Basix ElementFamily enum representing the family type on the given cell.
basix.lattice¶
Functions to create lattices and manipulate lattice types.
- basix.lattice.string_to_type(lattice: str)¶
Convert a string to a Basix LatticeType enum.
- basix.lattice.type_to_string(latticetype: basix._basixcpp.LatticeType)¶
Convert a Basix LatticeType enum to a string.