Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
20 changes: 20 additions & 0 deletions tests/firedrake/extrusion/test_real_tensorproduct.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
22 changes: 22 additions & 0 deletions tests/firedrake/regression/test_helmholtz_zany.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading