From 94cf816b9dc28d403ee9fea6fdc94739f260bbdf Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Fri, 26 Aug 2022 16:21:47 +0100 Subject: [PATCH] extrudeToRegionMesh: Detect and report invalidly extruded edges --- .../extrudeToRegionMesh/extrudeToRegionMesh.C | 702 ++++++++++-------- 1 file changed, 384 insertions(+), 318 deletions(-) diff --git a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C index 48330b91a7..49530149ca 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C +++ b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C @@ -283,51 +283,116 @@ void deleteEmptyPatches(fvMesh& mesh) } -// Check zone either all internal or all external faces -void checkZoneInside -( - const polyMesh& mesh, - const wordList& zoneNames, - const labelList& zoneID, - const labelList& extrudeMeshFaces, - const boolList& isInternal -) +enum class connectivity { - forAll(zoneNames, i) + unset, + boundary, + internal, + error +}; + + +struct isInternalEqOp +{ + void operator()(connectivity& x, const connectivity& y) const { - if (isInternal[i]) + if (x == connectivity::unset) { - Info<< "Zone " << zoneNames[i] << " has internal faces" << endl; + // Set x if not yet set + x = y; + } + else if (y == connectivity::unset) + { + // Do not set x if y is not yet set + } + else if (x == y) + { + // Do nothing if x and y are equal } else { - Info<< "Zone " << zoneNames[i] << " has boundary faces" << endl; + // Set an error value if x and y are both set and unequal + x = connectivity::error; + } + } +}; + + +Ostream& operator<<(Ostream& os, const connectivity& p) +{ + return os << static_cast