basix.numba_helpers

Helper functions for writing DOLFINx custom kernels using Numba.

Functions

apply_dof_transformation(tdim, edge_count, ...)

Apply dof transformations to some data.

apply_dof_transformation_hexahedron(...)

Apply dof transformations to some data on a hexahedron.

apply_dof_transformation_interval(...)

Apply dof transformations to some data on an interval.

apply_dof_transformation_prism(...)

Apply dof transformations to some data on an prism.

apply_dof_transformation_pyramid(...)

Apply dof transformations to some data on an prism.

apply_dof_transformation_quadrilateral(...)

Apply dof transformations to some data on an quadrilateral.

apply_dof_transformation_tetrahedron(...)

Apply dof transformations to some data on a tetrahedron.

apply_dof_transformation_to_transpose(tdim, ...)

Apply dof transformations to some transposed data.

apply_dof_transformation_to_transpose_hexahedron(...)

Apply dof transformations to some transposed data on a hexahedron.

apply_dof_transformation_to_transpose_interval(...)

Apply dof transformations to some transposed data on an interval.

apply_dof_transformation_to_transpose_prism(...)

Apply dof transformations to some transposed data on an prism.

apply_dof_transformation_to_transpose_pyramid(...)

Apply dof transformations to some transposed data on an prism.

apply_dof_transformation_to_transpose_quadrilateral(...)

Apply dof transformations to some transposed data on an quadrilateral.

apply_dof_transformation_to_transpose_tetrahedron(...)

Apply dof transformations to some transposed data on a tetrahedron.

apply_dof_transformation_to_transpose_triangle(...)

Apply dof transformations to some transposed data on a triangle.

apply_dof_transformation_triangle(...)

Apply dof transformations to some data on a triangle.

basix.numba_helpers.apply_dof_transformation(tdim: int, edge_count: int, face_count: int, entity_transformations: List[int], entity_dofs: List[int], data: numpy.array, 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.apply_dof_transformation_hexahedron(entity_transformations: Dict[str, numpy.ndarray[Any, numpy.dtype[numpy.float64]]], entity_dofs: Dict[str, numpy.ndarray[Any, numpy.dtype[numpy.int32]]], data: numpy.array, cell_info: int)

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.apply_dof_transformation_interval(entity_transformations: Dict[str, numpy.ndarray[Any, numpy.dtype[numpy.float64]]], entity_dofs: Dict[str, numpy.ndarray[Any, numpy.dtype[numpy.int32]]], data: numpy.array, 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.apply_dof_transformation_prism(entity_transformations: Dict[str, numpy.ndarray[Any, numpy.dtype[numpy.float64]]], entity_dofs: Dict[str, numpy.ndarray[Any, numpy.dtype[numpy.int32]]], data: numpy.array, 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.apply_dof_transformation_pyramid(entity_transformations: Dict[str, numpy.ndarray[Any, numpy.dtype[numpy.float64]]], entity_dofs: Dict[str, numpy.ndarray[Any, numpy.dtype[numpy.int32]]], data: numpy.array, 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.apply_dof_transformation_quadrilateral(entity_transformations: Dict[str, numpy.ndarray[Any, numpy.dtype[numpy.float64]]], entity_dofs: Dict[str, numpy.ndarray[Any, numpy.dtype[numpy.int32]]], data: numpy.array, 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 subentities of the cell.

basix.numba_helpers.apply_dof_transformation_tetrahedron(entity_transformations: Dict[str, numpy.ndarray[Any, numpy.dtype[numpy.float64]]], entity_dofs: Dict[str, numpy.ndarray[Any, numpy.dtype[numpy.int32]]], data: numpy.array, 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.apply_dof_transformation_to_transpose(tdim: int, edge_count: int, face_count: int, entity_transformations: List[int], entity_dofs: List[int], data: numpy.array, cell_info: int, face_types: List[str])

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.apply_dof_transformation_to_transpose_hexahedron(entity_transformations: Dict[str, numpy.ndarray[Any, numpy.dtype[numpy.float64]]], entity_dofs: Dict[str, numpy.ndarray[Any, numpy.dtype[numpy.int32]]], data: numpy.array, cell_info: int)

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.apply_dof_transformation_to_transpose_interval(entity_transformations: Dict[str, numpy.ndarray[Any, numpy.dtype[numpy.float64]]], entity_dofs: Dict[str, numpy.ndarray[Any, numpy.dtype[numpy.int32]]], data: numpy.array, cell_info: int)

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.apply_dof_transformation_to_transpose_prism(entity_transformations: Dict[str, numpy.ndarray[Any, numpy.dtype[numpy.float64]]], entity_dofs: Dict[str, numpy.ndarray[Any, numpy.dtype[numpy.int32]]], data: numpy.array, cell_info: int)

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.apply_dof_transformation_to_transpose_pyramid(entity_transformations: Dict[str, numpy.ndarray[Any, numpy.dtype[numpy.float64]]], entity_dofs: Dict[str, numpy.ndarray[Any, numpy.dtype[numpy.int32]]], data: numpy.array, cell_info: int)

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.apply_dof_transformation_to_transpose_quadrilateral(entity_transformations: Dict[str, numpy.ndarray[Any, numpy.dtype[numpy.float64]]], entity_dofs: Dict[str, numpy.ndarray[Any, numpy.dtype[numpy.int32]]], data: numpy.array, cell_info: int)

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.apply_dof_transformation_to_transpose_tetrahedron(entity_transformations: Dict[str, numpy.ndarray[Any, numpy.dtype[numpy.float64]]], entity_dofs: Dict[str, numpy.ndarray[Any, numpy.dtype[numpy.int32]]], data: numpy.array, cell_info: int)

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 subentities of the cell.

basix.numba_helpers.apply_dof_transformation_to_transpose_triangle(entity_transformations: Dict[str, numpy.ndarray[Any, numpy.dtype[numpy.float64]]], entity_dofs: Dict[str, numpy.ndarray[Any, numpy.dtype[numpy.int32]]], data: numpy.array, cell_info: int)

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.apply_dof_transformation_triangle(entity_transformations: Dict[str, numpy.ndarray[Any, numpy.dtype[numpy.float64]]], entity_dofs: Dict[str, numpy.ndarray[Any, numpy.dtype[numpy.int32]]], data: numpy.array, 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 subentities of the cell.