diff --git a/.github/actions/install/action.yml b/.github/actions/install/action.yml index 471969ac89..3c63346a09 100644 --- a/.github/actions/install/action.yml +++ b/.github/actions/install/action.yml @@ -155,7 +155,7 @@ runs: --extra-index-url https://download.pytorch.org/whl/cpu \ "./firedrake-repo[${{ inputs.deps }}]" - pip install -v --no-deps --ignore-installed git+https://github.com/firedrakeproject/fiat.git@pbrubeck/zany-manifold + pip install -v --no-deps --ignore-installed git+https://github.com/firedrakeproject/fiat.git@pbrubeck/zany-tensorproduct firedrake-clean pip list diff --git a/tests/firedrake/extrusion/test_real_tensorproduct.py b/tests/firedrake/extrusion/test_real_tensorproduct.py index 9e658e43e3..0c4796745b 100644 --- a/tests/firedrake/extrusion/test_real_tensorproduct.py +++ b/tests/firedrake/extrusion/test_real_tensorproduct.py @@ -162,6 +162,26 @@ def test_helmholtz_convergence(extmesh, quadrilateral, testcase, convrate): assert (np.array([np.log2(l2err[i]/l2err[i+1]) for i in range(len(l2err)-1)]) > convrate).all() +def test_hermite_real_convergence() -> None: + """Test Hermite convergence for a depth-independent solution.""" + errors = [] + for refinement in (3, 4): + mesh = ExtrudedMesh(UnitIntervalMesh(2**refinement), layers=1) + V = FunctionSpace(mesh, "Hermite", 3, vfamily="Real", vdegree=0) + x = SpatialCoordinate(mesh) + exact = cos(2*pi*x[0]) + + u = TrialFunction(V) + v = TestFunction(V) + a = inner(grad(u), grad(v))*dx + u*v*dx + solution = Function(V) + solve(a == a(v, exact), solution, + solver_parameters={"ksp_type": "preonly", "pc_type": "lu"}) + errors.append(sqrt(assemble(a(solution-exact, solution-exact)))) + + assert np.log2(errors[0] / errors[1]) > 2.7 + + def test_real_tensorproduct_mixed(V): mesh = V.mesh() Q = FunctionSpace(mesh, "P", 2) diff --git a/tests/firedrake/regression/test_helmholtz_zany.py b/tests/firedrake/regression/test_helmholtz_zany.py index 32906353c0..c7f3196ca2 100644 --- a/tests/firedrake/regression/test_helmholtz_zany.py +++ b/tests/firedrake/regression/test_helmholtz_zany.py @@ -64,3 +64,25 @@ def test_firedrake_helmholtz_scalar_convergence(el, deg, convrate, perturb): diff = np.array([helmholtz(i, el, deg, perturb) for i in range(l, l+2)]) conv = np.log2(diff[:-1] / diff[1:]) assert (np.array(conv) > convrate - 0.3).all() + + +def test_bell_hermite_tensor_product_convergence() -> None: + """Test H1 convergence of Bell x Hermite on an extruded mesh.""" + errors = [] + for refinement in (1, 2): + n = 2**refinement + mesh = ExtrudedMesh(UnitSquareMesh(n, n), layers=n) + V = FunctionSpace(mesh, "Bell", 5, + vfamily="Hermite", vdegree=3) + x = SpatialCoordinate(mesh) + exact = cos(pi*x[0]) * cos(pi*x[1]) * cos(pi*x[2]) + + u = TrialFunction(V) + v = TestFunction(V) + a = inner(grad(u), grad(v))*dx + u*v*dx + solution = Function(V) + solve(a == a(v, exact), solution, + solver_parameters={"ksp_type": "preonly", "pc_type": "lu"}) + errors.append(sqrt(assemble(a(solution-exact, solution-exact)))) + + assert np.log2(errors[0] / errors[1]) > 2.5