Skip to content

Commit

Permalink
test matrix-free fieldsplit with cofunction rhs
Browse files Browse the repository at this point in the history
  • Loading branch information
JHopeCollins committed Dec 17, 2024
1 parent 6f2c542 commit f2305dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 62 deletions.
60 changes: 0 additions & 60 deletions tests/firedrake/regression/test_fieldsplit_cofunction.py

This file was deleted.

10 changes: 8 additions & 2 deletions tests/firedrake/regression/test_matrix_free.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def test_matrixfree_action(a, V, bcs):

@pytest.mark.parametrize("preassembled", [False, True],
ids=["variational", "preassembled"])
@pytest.mark.parametrize("rhs", ["func_rhs", "cofunc_rhs"])
@pytest.mark.parametrize("parameters",
[{"ksp_type": "preonly",
"pc_type": "python",
Expand Down Expand Up @@ -168,7 +169,7 @@ def test_matrixfree_action(a, V, bcs):
"fieldsplit_1_fieldsplit_1_pc_type": "python",
"fieldsplit_1_fieldsplit_1_pc_python_type": "firedrake.AssembledPC",
"fieldsplit_1_fieldsplit_1_assembled_pc_type": "lu"}])
def test_fieldsplitting(mesh, preassembled, parameters):
def test_fieldsplitting(mesh, preassembled, parameters, rhs):
V = FunctionSpace(mesh, "CG", 1)
P = FunctionSpace(mesh, "DG", 0)
Q = VectorFunctionSpace(mesh, "DG", 1)
Expand All @@ -184,7 +185,12 @@ def test_fieldsplitting(mesh, preassembled, parameters):

a = inner(u, v)*dx

L = inner(expect, v)*dx
if rhs == 'func_rhs':
L = inner(expect, v)*dx
elif rhs == 'cofunc_rhs':
L = expect.riesz_representation()
else:
raise ValueError("Unknown right hand side type")

f = Function(W)

Expand Down

0 comments on commit f2305dc

Please sign in to comment.