diff --git a/tests/tsfc/test_sum_factorisation.py b/tests/tsfc/test_sum_factorisation.py index 44c1d46dda..85d9729e81 100644 --- a/tests/tsfc/test_sum_factorisation.py +++ b/tests/tsfc/test_sum_factorisation.py @@ -3,7 +3,7 @@ from ufl import (Mesh, FunctionSpace, TestFunction, TrialFunction, TensorProductCell, dx, action, interval, triangle, - quadrilateral, curl, dot, div, grad) + quadrilateral, hexahedron, curl, dot, div, grad) from finat.ufl import (FiniteElement, VectorElement, EnrichedElement, TensorProductElement, HCurlElement, HDivElement) @@ -190,6 +190,19 @@ def test_vector_laplace_action(cell, order): assert (rates < order).all() +@pytest.mark.parametrize(('cell', 'equivalent_cell'), + [(quadrilateral, TensorProductCell(interval, interval)), + (hexahedron, TensorProductCell(quadrilateral, interval)), + (hexahedron, TensorProductCell(interval, interval, interval))]) +@pytest.mark.parametrize('degree', [3, 5]) +def test_equivalent_cells(cell, equivalent_cell, degree): + """A form is compiled the same way on cells that hold the same space.""" + a = helmholtz(cell, degree) + b = helmholtz(equivalent_cell, degree) + assert count_flops(a) == count_flops(b) + assert count_flops(action(a)) == count_flops(action(b)) + + if __name__ == "__main__": import os import sys