Skip to content

Commit

Permalink
remove irreducible int
Browse files Browse the repository at this point in the history
  • Loading branch information
mscroggs committed Sep 20, 2023
1 parent dbf4a73 commit f5373d3
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions python/basix/ufl.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
import numpy.typing as _npt
import ufl as _ufl
# TODO: remove gdim arguments once UFL handles cells better
# TODO: remove IrreducibleInt once UFL handles element degrees better
from ufl.algorithms.estimate_degrees import IrreducibleInt as _IrreducibleInt
from ufl.finiteelement import FiniteElementBase as _FiniteElementBase

import basix as _basix
Expand Down Expand Up @@ -51,7 +49,7 @@ class _ElementBase(_FiniteElementBase):
"""

def __init__(self, repr: str, name: str, cellname: str, value_shape: _typing.Tuple[int, ...],
degree: _typing.Union[int, _IrreducibleInt] = -1, mapname: _typing.Optional[str] = None,
degree: int = -1, mapname: _typing.Optional[str] = None,
gdim: _typing.Optional[int] = None):
"""Initialise the element."""
super().__init__(name, _ufl.cell.Cell(cellname, gdim), degree, None, value_shape, value_shape)
Expand Down Expand Up @@ -342,15 +340,9 @@ def __init__(self, element: _basix.finite_element.FiniteElement, gdim: _typing.O
repr = (f"Basix element ({element.family.name}, {element.cell_type.name}, {element.degree}, "
f"{element.lagrange_variant.name}, {element.dpc_variant.name}, {element.discontinuous})")

if element.cell_type.name in ["interval", "triangle", "tetrahedron"]:
super().__init__(
repr, element.family.name, element.cell_type.name, tuple(element.value_shape), element.degree,
_map_type_to_string(element.map_type), gdim=gdim)
else:
# TODO: remove IrreducibleInt once UFL handles element degrees better
super().__init__(
repr, element.family.name, element.cell_type.name, tuple(element.value_shape),
_IrreducibleInt(element.degree), _map_type_to_string(element.map_type), gdim=gdim)
super().__init__(
repr, element.family.name, element.cell_type.name, tuple(element.value_shape), element.degree,
_map_type_to_string(element.map_type), gdim=gdim)

self.element = element

Expand Down

0 comments on commit f5373d3

Please sign in to comment.