basix.numba_helpers

Helper functions for writing DOLFINx custom kernels using Numba.

Functions

T_apply(tdim, edge_count, face_count, ...)

Apply dof transformations to some data.

T_apply_hexahedron(entity_transformations, ...)

Pre-apply dof transformations to some data on a hexahedron.

T_apply_interval(entity_transformations, ...)

Apply dof transformations to some data on an interval.

T_apply_prism(entity_transformations, ...)

Apply dof transformations to some data on an prism.

T_apply_pyramid(entity_transformations, ...)

Apply dof transformations to some data on an prism.

T_apply_quadrilateral(...)

Apply dof transformations to some data on an quadrilateral.

T_apply_tetrahedron(entity_transformations, ...)

Apply dof transformations to some data on a tetrahedron.

T_apply_triangle(entity_transformations, ...)

Apply dof transformations to some data on a triangle.

Tt_apply_right(tdim, edge_count, face_count, ...)

Right(post)-apply dof transformations to some transposed data.

Tt_apply_right_hexahedron(...)

Right(post)-apply dof transformations to some transposed data on a hexahedron.

Tt_apply_right_interval(...)

Right(post)-apply dof transformations to some transposed data on an interval.

Tt_apply_right_prism(entity_transformations, ...)

Right(post)-apply dof transformations to some transposed data on an prism.

Tt_apply_right_pyramid(...)

Right(post)-apply dof transformations to some transposed data on an prism.

Tt_apply_right_quadrilateral(...)

Right(post)-apply dof transformations to some transposed data on an quadrilateral.

Tt_apply_right_tetrahedron(...)

Right(post)-apply dof transformations to some transposed data on a tetrahedron.

Tt_apply_right_triangle(...)

Right(post)-apply dof transformations to some transposed data on a triangle.

basix.numba_helpers.T_apply(tdim: int, edge_count: int, face_count: int, entity_transformations: dict[str, ndarray[Any, dtype[_ScalarType_co]]], entity_dofs: list[list[int]], data: ndarray[Any, dtype[_ScalarType_co]], cell_info: int, face_types: list[str])

Apply dof transformations to some data.

Parameters:
  • tdim – The topological dimension of the cell.

  • edge_count – The number of edges the cell has.

  • face_count – The number of faces the cell has.

  • entity_transformations – The DOF transformations for each entity.

  • entity_dofs – The number of DOFs on each entity.

  • data – The data. This will be changed by this function.

  • cell_info – An integer representing the orientations of the subentities of the cell.

  • face_types – A list of strings giving the shapes of the faces of the cell.

basix.numba_helpers.T_apply_hexahedron(entity_transformations: dict[str, ndarray[Any, dtype[float64]]], entity_dofs: dict[str, ndarray[Any, dtype[int32]]], data: ndarray[Any, dtype[_ScalarType_co]], cell_info: int)

Pre-apply dof transformations to some data on a hexahedron.

Parameters:
  • entity_transformations – The DOF transformations for each entity.

  • entity_dofs – The number of DOFs on each entity.

  • data – The data. This will be changed by this function.

  • cell_info – An integer representing the orientations of the subentities of the cell.

basix.numba_helpers.T_apply_interval(entity_transformations: dict[str, ndarray[Any, dtype[float64]]], entity_dofs: dict[str, ndarray[Any, dtype[int32]]], data: ndarray[Any, dtype[_ScalarType_co]], cell_info: int)

Apply dof transformations to some data on an interval.

Parameters:
  • entity_transformations – The DOF transformations for each entity.

  • entity_dofs – The number of DOFs on each entity.

  • data – The data. This will be changed by this function.

  • cell_info – An integer representing the orientations of the subentities of the cell.

basix.numba_helpers.T_apply_prism(entity_transformations: dict[str, ndarray[Any, dtype[float64]]], entity_dofs: dict[str, ndarray[Any, dtype[int32]]], data: ndarray[Any, dtype[_ScalarType_co]], cell_info: int)

Apply dof transformations to some data on an prism.

Parameters:
  • entity_transformations – The DOF transformations for each entity.

  • entity_dofs – The number of DOFs on each entity.

  • data – The data. This will be changed by this function.

  • cell_info – An integer representing the orientations of the subentities of the cell.

basix.numba_helpers.T_apply_pyramid(entity_transformations: dict[str, ndarray[Any, dtype[float64]]], entity_dofs: dict[str, ndarray[Any, dtype[int32]]], data: ndarray[Any, dtype[_ScalarType_co]], cell_info: int)

Apply dof transformations to some data on an prism.

Parameters:
  • entity_transformations – The DOF transformations for each entity.

  • entity_dofs – The number of DOFs on each entity.

  • data – The data. This will be changed by this function.

  • cell_info – An integer representing the orientations of the subentities of the cell.

basix.numba_helpers.T_apply_quadrilateral(entity_transformations: dict[str, ndarray[Any, dtype[float64]]], entity_dofs: dict[str, ndarray[Any, dtype[int32]]], data: ndarray[Any, dtype[_ScalarType_co]], cell_info: int)

Apply dof transformations to some data on an quadrilateral.

Parameters:
  • entity_transformations – The DOF transformations for each entity.

  • entity_dofs – The number of DOFs on each entity.

  • data – The data. This will be changed by this function.

  • cell_info – An integer representing the orientations of the sub-entities of the cell.

basix.numba_helpers.T_apply_tetrahedron(entity_transformations: dict[str, ndarray[Any, dtype[float64]]], entity_dofs: dict[str, ndarray[Any, dtype[int32]]], data: ndarray[Any, dtype[_ScalarType_co]], cell_info: int)

Apply dof transformations to some data on a tetrahedron.

Parameters:
  • entity_transformations – The DOF transformations for each entity.

  • entity_dofs – The number of DOFs on each entity.

  • data – The data. This will be changed by this function.

  • cell_info – An integer representing the orientations of the subentities of the cell.

basix.numba_helpers.T_apply_triangle(entity_transformations: dict[str, ndarray[Any, dtype[float64]]], entity_dofs: dict[str, ndarray[Any, dtype[int32]]], data: ndarray[Any, dtype[_ScalarType_co]], cell_info: int)

Apply dof transformations to some data on a triangle.

Parameters:
  • entity_transformations – The DOF transformations for each entity.

  • entity_dofs – The number of DOFs on each entity.

  • data – The data. This will be changed by this function.

  • cell_info – An integer representing the orientations of the sub-entities of the cell.

basix.numba_helpers.Tt_apply_right(tdim: int, edge_count: int, face_count: int, entity_transformations: list[int], entity_dofs: list[int], data: ndarray[Any, dtype[_ScalarType_co]], cell_info: int, face_types: list[str])

Right(post)-apply dof transformations to some transposed data.

Parameters:
  • tdim – The topological dimension of the cell.

  • edge_count – The number of edges the cell has.

  • face_count – The number of faces the cell has.

  • entity_transformations – The DOF transformations for each entity.

  • entity_dofs – The number of DOFs on each entity.

  • data – The data. This will be changed by this function.

  • cell_info – An integer representing the orientations of the subentities of the cell.

  • face_types – A list of strings giving the shapes of the faces of the cell.

basix.numba_helpers.Tt_apply_right_hexahedron(entity_transformations: dict[str, ndarray[Any, dtype[float64]]], entity_dofs: dict[str, ndarray[Any, dtype[int32]]], data: ndarray[Any, dtype[_ScalarType_co]], cell_info: int)

Right(post)-apply dof transformations to some transposed data on a hexahedron.

Parameters:
  • entity_transformations – The DOF transformations for each entity.

  • entity_dofs – The number of DOFs on each entity.

  • data – The data. This will be changed by this function.

  • cell_info – An integer representing the orientations of the subentities of the cell.

basix.numba_helpers.Tt_apply_right_interval(entity_transformations: dict[str, ndarray[Any, dtype[float64]]], entity_dofs: dict[str, ndarray[Any, dtype[int32]]], data: ndarray[Any, dtype[_ScalarType_co]], cell_info: int)

Right(post)-apply dof transformations to some transposed data on an interval.

Parameters:
  • entity_transformations – The DOF transformations for each entity.

  • entity_dofs – The number of DOFs on each entity.

  • data – The data. This will be changed by this function.

  • cell_info – An integer representing the orientations of the subentities of the cell.

basix.numba_helpers.Tt_apply_right_prism(entity_transformations: dict[str, ndarray[Any, dtype[float64]]], entity_dofs: dict[str, ndarray[Any, dtype[int32]]], data: ndarray[Any, dtype[_ScalarType_co]], cell_info: int)

Right(post)-apply dof transformations to some transposed data on an prism.

Parameters:
  • entity_transformations – The DOF transformations for each entity.

  • entity_dofs – The number of DOFs on each entity.

  • data – The data. This will be changed by this function.

  • cell_info – An integer representing the orientations of the subentities of the cell.

basix.numba_helpers.Tt_apply_right_pyramid(entity_transformations: dict[str, ndarray[Any, dtype[float64]]], entity_dofs: dict[str, ndarray[Any, dtype[int32]]], data: ndarray[Any, dtype[_ScalarType_co]], cell_info: int)

Right(post)-apply dof transformations to some transposed data on an prism.

Parameters:
  • entity_transformations – The DOF transformations for each entity.

  • entity_dofs – The number of DOFs on each entity.

  • data – The data. This will be changed by this function.

  • cell_info – An integer representing the orientations of the subentities of the cell.

basix.numba_helpers.Tt_apply_right_quadrilateral(entity_transformations: dict[str, ndarray[Any, dtype[float64]]], entity_dofs: dict[str, ndarray[Any, dtype[int32]]], data: ndarray[Any, dtype[_ScalarType_co]], cell_info: int)

Right(post)-apply dof transformations to some transposed data on an quadrilateral.

Parameters:
  • entity_transformations – The DOF transformations for each entity.

  • entity_dofs – The number of DOFs on each entity.

  • data – The data. This will be changed by this function.

  • cell_info – An integer representing the orientations of the subentities of the cell.

basix.numba_helpers.Tt_apply_right_tetrahedron(entity_transformations: dict[str, ndarray[Any, dtype[float64]]], entity_dofs: dict[str, ndarray[Any, dtype[int32]]], data: ndarray[Any, dtype[_ScalarType_co]], cell_info: int)

Right(post)-apply dof transformations to some transposed data on a tetrahedron.

Parameters:
  • entity_transformations – The DOF transformations for each entity.

  • entity_dofs – The number of DOFs on each entity.

  • data – The data. This will be changed by this function.

  • cell_info – An integer representing the orientations of the

  • cell. (subentities of the)

basix.numba_helpers.Tt_apply_right_triangle(entity_transformations: dict[str, ndarray[Any, dtype[float64]]], entity_dofs: dict[str, ndarray[Any, dtype[int32]]], data: ndarray[Any, dtype[_ScalarType_co]], cell_info: int)

Right(post)-apply dof transformations to some transposed data on a triangle.

Parameters:
  • entity_transformations – The DOF transformations for each entity.

  • entity_dofs – The number of DOFs on each entity.

  • data – The data. This will be changed by this function.

  • cell_info – An integer representing the orientations of the subentities of the cell.