basix.numba_helpers

Helper functions for writing DOLFINx custom kernels using Numba.

Functions

post_apply_transpose_dof_transformation(...)

Post-apply dof transformations to some transposed data.

post_apply_transpose_dof_transformation_hexahedron(...)

Post-apply dof transformations to some transposed data on a hexahedron.

post_apply_transpose_dof_transformation_interval(...)

Post-apply dof transformations to some transposed data on an interval.

post_apply_transpose_dof_transformation_prism(...)

Post-apply dof transformations to some transposed data on an prism.

post_apply_transpose_dof_transformation_pyramid(...)

Post-apply dof transformations to some transposed data on an prism.

post_apply_transpose_dof_transformation_quadrilateral(...)

Post-apply dof transformations to some transposed data on an quadrilateral.

post_apply_transpose_dof_transformation_tetrahedron(...)

Post-apply dof transformations to some transposed data on a tetrahedron.

post_apply_transpose_dof_transformation_triangle(...)

Post-apply dof transformations to some transposed data on a triangle.

pre_apply_dof_transformation(tdim, ...)

Pre-apply dof transformations to some data.

pre_apply_dof_transformation_hexahedron(...)

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

pre_apply_dof_transformation_interval(...)

Pre-apply dof transformations to some data on an interval.

pre_apply_dof_transformation_prism(...)

Pre-apply dof transformations to some data on an prism.

pre_apply_dof_transformation_pyramid(...)

Pre-apply dof transformations to some data on an prism.

pre_apply_dof_transformation_quadrilateral(...)

Pre-apply dof transformations to some data on an quadrilateral.

pre_apply_dof_transformation_tetrahedron(...)

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

pre_apply_dof_transformation_triangle(...)

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

basix.numba_helpers.post_apply_transpose_dof_transformation(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])

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.post_apply_transpose_dof_transformation_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)

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.post_apply_transpose_dof_transformation_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)

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.post_apply_transpose_dof_transformation_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)

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.post_apply_transpose_dof_transformation_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)

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.post_apply_transpose_dof_transformation_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)

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.post_apply_transpose_dof_transformation_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)

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.post_apply_transpose_dof_transformation_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)

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.

basix.numba_helpers.pre_apply_dof_transformation(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])

Pre-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.pre_apply_dof_transformation_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.pre_apply_dof_transformation_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)

Pre-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.pre_apply_dof_transformation_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)

Pre-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.pre_apply_dof_transformation_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)

Pre-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.pre_apply_dof_transformation_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)

Pre-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.pre_apply_dof_transformation_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)

Pre-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.pre_apply_dof_transformation_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)

Pre-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.