Skip to content

Commit 3ee9028

Browse files
committed
tests
1 parent e2a19f4 commit 3ee9028

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tests/firedrake/regression/test_star_pc.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def problem_type(request):
1111
return request.param
1212

1313

14-
@pytest.fixture(params=["petscasm", "tinyasm"])
14+
@pytest.fixture(params=["petscasm", "tinyasm", "petscasm-coloring"])
1515
def backend(request):
1616
return request.param
1717

@@ -25,6 +25,10 @@ def filter_warnings(caller):
2525
def test_star_equivalence(problem_type, backend):
2626
distribution_parameters = {"partition": True,
2727
"overlap_type": (DistributedMeshOverlapType.VERTEX, 1)}
28+
use_coloring = False
29+
if backend.endswith("coloring"):
30+
backend, _ = backend.split("-")
31+
use_coloring = True
2832

2933
if problem_type == "scalar":
3034
base = UnitSquareMesh(10, 10, distribution_parameters=distribution_parameters)
@@ -169,6 +173,7 @@ def test_star_equivalence(problem_type, backend):
169173
"mg_coarse_mat_type": "aij",
170174
"mg_coarse_pc_type": "lu"}
171175

176+
star_params["mg_levels_pc_star_use_coloring"] = use_coloring
172177
star_params["mg_levels_pc_star_backend"] = backend
173178
star_params["mg_levels_pc_star_mat_ordering_type"] = "rcm"
174179
nvproblem = NonlinearVariationalProblem(a, u, bcs=bcs)
@@ -182,9 +187,13 @@ def test_star_equivalence(problem_type, backend):
182187
comp_its = comp_solver.snes.getLinearSolveIterations()
183188

184189
assert star_its == comp_its
190+
if use_coloring:
191+
l = len(mh) - 1
192+
star_patches = len(star_solver.snes.ksp.pc.getMGSmoother(l).pc.getPythonContext().asmpc.getASMSubKSP())
193+
assert star_patches < 12
185194

186195

187-
def test_vanka_equivalence(problem_type):
196+
def test_vanka_equivalence(problem_type, use_coloring):
188197
distribution_parameters = {"partition": True,
189198
"overlap_type": (DistributedMeshOverlapType.VERTEX, 2)}
190199

0 commit comments

Comments
 (0)