From 35f893e8b3c7f662836dbafc8e801c0f4dd64a9f Mon Sep 17 00:00:00 2001 From: JavierAlbaM Date: Tue, 23 Jun 2026 14:57:46 -0400 Subject: [PATCH] Add includeZipper option to mphys_get_triangulated_surface The mphys triangulated-surface helper always returned the zippered wall surface (includeZipper=True). For overset meshes that surface depends on the overset hole-cut/zipper, which is partition-dependent: at some MPI rank counts wall faces near overset overlaps are blanked and not recovered for a single-family request, leaving holes in the gathered surface. When the surface is used as a geometry reference (e.g. DVConstraints thickness/volume constraint projections) this caused projection failures that appeared or disappeared depending only on the processor count. Expose includeZipper (default True, so no behaviour change) on mphys_get_triangulated_surface / _getTriangulatedMeshSurface and the ADflowMeshGroup pass-through, forwarding it to both getSurfaceCoordinates and getSurfaceConnectivity so callers can request the raw, processor-count independent wall surface with includeZipper=False. Co-Authored-By: Claude Opus 4.8 (1M context) --- adflow/mphys/mphys_adflow.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/adflow/mphys/mphys_adflow.py b/adflow/mphys/mphys_adflow.py index df61c2141..6e13f5f09 100644 --- a/adflow/mphys/mphys_adflow.py +++ b/adflow/mphys/mphys_adflow.py @@ -257,13 +257,17 @@ def mphys_add_coordinate_input(self): def mphys_get_surface_mesh(self): return self.x_a0 - def mphys_get_triangulated_surface(self, groupName=None): + def mphys_get_triangulated_surface(self, groupName=None, includeZipper=True): # this is a list of lists of 3 points # p0, v1, v2 + # includeZipper=False returns the raw wall surface (all faces, no overset + # blanking and no zipper mesh), which is independent of the processor count. + # This is the appropriate choice when the surface is used as a geometry + # reference, e.g. for DVConstraints projections. - return self._getTriangulatedMeshSurface(groupName=groupName) + return self._getTriangulatedMeshSurface(groupName=groupName, includeZipper=includeZipper) - def _getTriangulatedMeshSurface(self, groupName=None, **kwargs): + def _getTriangulatedMeshSurface(self, groupName=None, includeZipper=True, **kwargs): """ This function returns a trianguled verision of the surface mesh on all processors. The intent is to use this for doing @@ -281,8 +285,10 @@ def _getTriangulatedMeshSurface(self, groupName=None, **kwargs): # Obtain the points and connectivity for the specified # groupName - pts = self.aero_solver.comm.allgather(self.aero_solver.getSurfaceCoordinates(groupName, **kwargs)) - conn, faceSizes = self.aero_solver.getSurfaceConnectivity(groupName) + pts = self.aero_solver.comm.allgather( + self.aero_solver.getSurfaceCoordinates(groupName, includeZipper=includeZipper, **kwargs) + ) + conn, faceSizes = self.aero_solver.getSurfaceConnectivity(groupName, includeZipper=includeZipper) conn = np.array(conn).flatten() conn = self.aero_solver.comm.allgather(conn) faceSizes = self.aero_solver.comm.allgather(faceSizes) @@ -1320,9 +1326,9 @@ def mphys_add_coordinate_input(self): # just pass through the call return self.surface_mesh.mphys_add_coordinate_input() - def mphys_get_triangulated_surface(self): + def mphys_get_triangulated_surface(self, includeZipper=True): # just pass through the call - return self.surface_mesh.mphys_get_triangulated_surface() + return self.surface_mesh.mphys_get_triangulated_surface(includeZipper=includeZipper) class ADflowBuilder(Builder):