From 0937b5c33f1a51468ec25a93d2527d381f917bf8 Mon Sep 17 00:00:00 2001 From: Pablo Brubeck Date: Tue, 21 Apr 2026 12:36:52 +0100 Subject: [PATCH] Cell Vanka coloring using FVM++ adjacency --- firedrake/preconditioners/asm.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/firedrake/preconditioners/asm.py b/firedrake/preconditioners/asm.py index 716f772e9c..31ab349860 100644 --- a/firedrake/preconditioners/asm.py +++ b/firedrake/preconditioners/asm.py @@ -245,8 +245,18 @@ def splitting(V): V_local_ises_indices = tuple(iset.indices for iset in V.dof_dset.local_ises) Z_local_ises_indices = splitting(V_local_ises_indices) + # Compute the coloring + useCone, useClosure = mesh_dm.getBasicAdjacency() + if depth == mesh_dm.getDimension(): + distance = 2 + mesh_dm.setBasicAdjacency(True, True) + else: + distance = 3 + mesh_dm.setBasicAdjacency(False, True) + colors = get_colors(mesh_dm, use_coloring, depth, distance=distance) + mesh_dm.setBasicAdjacency(useCone, useClosure) + # Build index sets for the patches - colors = get_colors(mesh_dm, use_coloring, depth, distance=3) ises = [build_vanka_indices(Z, Z_local_ises_indices, mesh_dm, ordering, self.prefix, include_star, color) for color in colors] return ises