Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions adflow/mphys/mphys_adflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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):
Expand Down