Skip to content

Commit

Permalink
TensorProductCell: fix reconstruct
Browse files Browse the repository at this point in the history
  • Loading branch information
ksagiyam committed Jul 14, 2023
1 parent 0290a01 commit cc8c32a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions test/test_cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,9 @@ def test_cells_2d(cell):
assert cell.num_peaks() == cell.num_vertices()


def test_tensorproductcell():
orig = ufl.TensorProductCell(ufl.interval, ufl.interval)
cell = orig.reconstruct()
assert cell.sub_cells() == orig.sub_cells()
assert cell.topological_dimension() == orig.topological_dimension()
assert cell.geometric_dimension() == orig.geometric_dimension()
2 changes: 1 addition & 1 deletion ufl/cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def reconstruct(self, **kwargs: typing.Any) -> Cell:
gdim = value
else:
raise TypeError(f"reconstruct() got unexpected keyword argument '{key}'")
return TensorProductCell(self._cellname, geometric_dimension=gdim)
return TensorProductCell(*self._cells, geometric_dimension=gdim)


def simplex(topological_dimension: int, geometric_dimension: typing.Optional[int] = None):
Expand Down

0 comments on commit cc8c32a

Please sign in to comment.