From e22b60078afafc7e4e0f1572b6aca32da012c0f7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Mar 2026 21:34:14 +0000 Subject: [PATCH 1/2] Initial plan From 51a5a3539acde148834d8c38db60a596ab1d6769 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Mar 2026 21:38:02 +0000 Subject: [PATCH 2/2] BdIntegral: fallback to UW_Boundaries label with collective missing-label check Co-authored-by: lmoresi <12588963+lmoresi@users.noreply.github.com> --- src/underworld3/cython/petsc_maths.pyx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/underworld3/cython/petsc_maths.pyx b/src/underworld3/cython/petsc_maths.pyx index da12acdf..12a5e490 100644 --- a/src/underworld3/cython/petsc_maths.pyx +++ b/src/underworld3/cython/petsc_maths.pyx @@ -406,6 +406,18 @@ class BdIntegral: cdef PetscInt num_vals = 1 c_label = mesh.dm.getLabel(self.boundary) + if c_label is None: + # Some meshes keep boundary strata only on the consolidated label. + # Fall back to UW_Boundaries and select this boundary via label_val. + c_label = mesh.dm.getLabel("UW_Boundaries") + if underworld3.mpi.comm.allreduce(1 if c_label else 0) == 0: + mesh_name = getattr(mesh, "name", "") + raise ValueError( + f"Boundary '{self.boundary}' was requested on mesh '{mesh_name}', " + f"but neither a DM label named '{self.boundary}' nor the " + "'UW_Boundaries' label " + "was found on this mesh." + ) # Output value cdef PetscScalar result = 0.0