Skip to content

Commit

Permalink
pt -> ptype
Browse files Browse the repository at this point in the history
  • Loading branch information
mscroggs committed Aug 7, 2023
1 parent cdef5ed commit ca29daa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions python/basix/ufl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1356,7 +1356,7 @@ def enriched_element(elements: _typing.List[_ElementBase],
set equal to the topological dimension of the cell.
"""
ct = elements[0].cell_type
pt = elements[0].polyset_type
ptype = elements[0].polyset_type
vshape = elements[0].value_shape()
vsize = elements[0].value_size
if map_type is None:
Expand All @@ -1374,7 +1374,7 @@ def enriched_element(elements: _typing.List[_ElementBase],
discontinuous = False
if e.cell_type != ct:
raise ValueError("Enriched elements on different cell types not supported.")
if e.polyset_type != pt:
if e.polyset_type != ptype:
raise ValueError("Enriched elements on different polyset types not supported.")
if e.value_shape() != vshape or e.value_size != vsize:
raise ValueError("Enriched elements on different value shapes not supported.")
Expand Down Expand Up @@ -1409,15 +1409,15 @@ def enriched_element(elements: _typing.List[_ElementBase],
row += e.dim

return custom_element(ct, list(vshape), wcoeffs, x, M, nderivs,
map_type, ss, discontinuous, hcd, hd, pt, gdim=gdim)
map_type, ss, discontinuous, hcd, hd, ptype, gdim=gdim)


def custom_element(cell_type: _basix.CellType, value_shape: _typing.Union[_typing.List[int], _typing.Tuple[int, ...]],
wcoeffs: _npt.NDArray[_np.float64], x: _typing.List[_typing.List[_npt.NDArray[_np.float64]]],
M: _typing.List[_typing.List[_npt.NDArray[_np.float64]]], interpolation_nderivs: int,
map_type: _basix.MapType, sobolev_space: _basix.SobolevSpace, discontinuous: bool,
highest_complete_degree: int, highest_degree: int,
poly_type: _basix.PolysetType = _basix.PolysetType.standard,
polyset_type: _basix.PolysetType = _basix.PolysetType.standard,
gdim: _typing.Optional[int] = None) -> _ElementBase:
"""Create a UFL compatible custom Basix element.
Expand All @@ -1442,7 +1442,7 @@ def custom_element(cell_type: _basix.CellType, value_shape: _typing.Union[_typin
"""
return _BasixElement(_basix.create_custom_element(
cell_type, list(value_shape), wcoeffs, x, M, interpolation_nderivs,
map_type, sobolev_space, discontinuous, highest_complete_degree, highest_degree, poly_type), gdim=gdim)
map_type, sobolev_space, discontinuous, highest_complete_degree, highest_degree, polyset_type), gdim=gdim)


def mixed_element(elements: _typing.List[_ElementBase], gdim: _typing.Optional[int] = None) -> _ElementBase:
Expand Down
6 changes: 3 additions & 3 deletions test/test_equality.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ def test_custom_element_equality():

p1_custom = basix.create_custom_element(
basix.CellType.triangle, [], wcoeffs,
x, M, 0, basix.MapType.identity, basix.SobolevSpace.H1, False, 1, 1)
x, M, 0, basix.MapType.identity, basix.SobolevSpace.H1, False, 1, 1, basix.PolysetType.standard)
p1_custom_again = basix.create_custom_element(
basix.CellType.triangle, [], wcoeffs,
x, M, 0, basix.MapType.identity, basix.SobolevSpace.H1, False, 1, 1)
x, M, 0, basix.MapType.identity, basix.SobolevSpace.H1, False, 1, 1, basix.PolysetType.standard)

wcoeffs = np.eye(3)
z = np.zeros((0, 2))
Expand All @@ -48,7 +48,7 @@ def test_custom_element_equality():

cr_custom = basix.create_custom_element(
basix.CellType.triangle, [], wcoeffs,
x, M, 0, basix.MapType.identity, basix.SobolevSpace.L2, False, 1, 1)
x, M, 0, basix.MapType.identity, basix.SobolevSpace.L2, False, 1, 1, basix.PolysetType.standard)

assert p1_custom == p1_custom_again
assert p1_custom != cr_custom
Expand Down

0 comments on commit ca29daa

Please sign in to comment.