Skip to content

Commit

Permalink
Remove IrreducibleInt (#702)
Browse files Browse the repository at this point in the history
* remove irreducible int

* ufl branch

* update DOLFINx demo running

* CI fix

* main UFL

---------

Co-authored-by: Garth N. Wells <[email protected]>
  • Loading branch information
mscroggs and garth-wells authored Sep 21, 2023
1 parent dbf4a73 commit b172e62
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dolfin-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
- name: Build DOLFINx C++ unit tests
run: |
cmake -G Ninja -DCMAKE_BUILD_TYPE=Developer -B build/test/ -S build/test/
cmake -G Ninja -DCMAKE_BUILD_TYPE=Developer -B build/test/ -S dolfinx/cpp/test/
cmake --build build/test
- name: Run DOLFINx C++ unit tests
run: |
Expand Down
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 b172e62

Please sign in to comment.