Functions for creating finite elements.
Functions
|
Get a Basix ElementFamily enum representing the family type on the given cell. |
Bases: pybind11_builtins.pybind11_object
Finite Element
Apply DOF transformations to some data
NOTE: This function is designed to be called at runtime, so its performance is critical.
data (numpy.ndarray[numpy.float64]) – The data
block_size (int) – The number of data points per DOF
cell_info (int) – The permutation info for the cell
data – The data
numpy.ndarray[numpy.float64]
Apply DOF transformations to some transposed data
NOTE: This function is designed to be called at runtime, so its performance is critical.
data (numpy.ndarray[numpy.float64]) – The data
block_size (int) – The number of data points per DOF
cell_info (int) – The permutation info for the cell
data – The data
numpy.ndarray[numpy.float64]
Apply inverse transpose DOF transformations to some data
NOTE: This function is designed to be called at runtime, so its performance is critical.
data (numpy.ndarray[numpy.float64]) – The data
block_size (int) – The number of data points per DOF
cell_info (int) – The permutation info for the cell
data – The data
numpy.ndarray[numpy.float64]
Get the base transformations The base transformations represent the effect of rotating or reflecting a subentity of the cell on the numbering and orientation of the DOFs. This returns a list of matrices with one matrix for each subentity permutation in the following order: Reversing edge 0, reversing edge 1, … Rotate face 0, reflect face 0, rotate face 1, reflect face 1, …
Example: Order 3 Lagrange on a triangle
This space has 10 dofs arranged like:
2
|\
6 4
| \
5 9 3
| \
0-7-8-1
For this element, the base transformations are: [Matrix swapping 3 and 4, Matrix swapping 5 and 6, Matrix swapping 7 and 8] The first row shows the effect of reversing the diagonal edge. The second row shows the effect of reversing the vertical edge. The third row shows the effect of reversing the horizontal edge.
Example: Order 1 Raviart-Thomas on a triangle
This space has 3 dofs arranged like:
|\
| \
| \
<-1 0
| / \
| L ^ \
| | \
---2---
These DOFs are integrals of normal components over the edges: DOFs 0 and 2 are oriented inward, DOF 1 is oriented outwards. For this element, the base transformation matrices are:
0: [[-1, 0, 0],
[ 0, 1, 0],
[ 0, 0, 1]]
1: [[1, 0, 0],
[0, -1, 0],
[0, 0, 1]]
2: [[1, 0, 0],
[0, 1, 0],
[0, 0, -1]]
The first matrix reverses DOF 0 (as this is on the first edge). The second matrix reverses DOF 1 (as this is on the second edge). The third matrix reverses DOF 2 (as this is on the third edge).
Example: DOFs on the face of Order 2 Nedelec first kind on a tetrahedron
On a face of this tetrahedron, this space has two face tangent DOFs:
|\ |\
| \ | \
| \ | ^\
| \ | | \
| 0->\ | 1 \
| \ | \
------ ------
For these DOFs, the subblocks of the base transformation matrices are:
rotation: [[-1, 1],
[ 1, 0]]
reflection: [[0, 1],
[1, 0]]
The base transformations for this element
numpy.ndarray[numpy.float64]
Return the entity dof transformation matrices
The base transformations for this element
dict
Get the tensor product representation of this element, or throw an error if no such factorisation exists.
The tensor product representation will be a vector of tuples. Each tuple contains a vector of finite elements, and a vector on integers. The vector of finite elements gives the elements on an interval that appear in the tensor product representation. The vector of integers gives the permutation between the numbering of the tensor product DOFs and the number of the DOFs of this Basix element.
Map function values from a physical cell to the reference
u (numpy.ndarray[numpy.float64]) – The function values on the cell
J (numpy.ndarray[numpy.float64]) – The Jacobian of the mapping
detJ (numpy.ndarray[numpy.float64]) – The determinant of the Jacobian of the mapping
K (numpy.ndarray[numpy.float64]) – The inverse of the Jacobian of the mapping
The function values on the reference
numpy.ndarray[numpy.float64]
Map function values from the reference to a physical cell. This function can perform the mapping for multiple points, grouped by points that share a common Jacobian.
U (numpy.ndarray[numpy.float64]) – The function values on the reference. The indices are [Jacobian index, point index, components].
J (numpy.ndarray[numpy.float64]) – The Jacobian of the mapping. The indices are [Jacobian index, J_i, J_j].
detJ (numpy.ndarray[numpy.float64]) – The determinant of the Jacobian of the mapping. It has length J.shape(0)
K (numpy.ndarray[numpy.float64]) – The inverse of the Jacobian of the mapping. The indices are [Jacobian index, K_i, K_j].
The function values on the cell. The indices are [Jacobian index, point index, components].
numpy.ndarray[numpy.float64]
Compute basis values and derivatives at set of points.
NOTE: The version of FiniteElement::tabulate with the basis data as an out argument should be preferred for repeated call where performance is critical
nd (int) – The order of derivatives, up to and including, to compute. Use 0 for the basis functions only.
x (numpy.ndarray[numpy.float64]) – The points at which to compute the basis functions. The shape of x is (number of points, geometric dimension).
The basis functions (and derivatives). The shape is (derivative, point, basis fn index, value index). - The first index is the derivative, with higher derivatives are stored in triangular (2D) or tetrahedral (3D) ordering, ie for the (x,y) derivatives in 2D: (0,0), (1,0), (0,1), (2,0), (1,1), (0,2), (3,0)… The function basix::indexing::idx can be used to find the appropriate derivative. - The second index is the point index - The third index is the basis function index - The fourth index is the basis function component. Its has size one for scalar basis functions.
numpy.ndarray[numpy.float64]
Get a Basix ElementFamily enum representing the family type on the given cell.
family (str) – The element family as a string.
cell (str) – The cell type as a string.
The element family.