From 5677e10d907a98c103eb0cb0ca2334c20586d565 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 3 Oct 2022 11:41:42 +0100 Subject: [PATCH] ENH: checkMesh: report overlapping zones. See #2521 --- .../manipulation/checkMesh/checkTopology.C | 131 +++++++++++++++++- .../manipulation/checkMesh/checkTopology.H | 10 ++ 2 files changed, 137 insertions(+), 4 deletions(-) diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C b/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C index 4bdb0cf1b1..82af0aa152 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C @@ -104,9 +104,6 @@ void Foam::checkPatch // << endl; } - //DebugVar(globalEdgeFaces); - - // Synchronise across coupled edges. syncTools::syncEdgeList ( @@ -116,7 +113,6 @@ void Foam::checkPatch labelList() // null value ); - //DebugVar(globalEdgeFaces); label labelTyp = TopoType::MANIFOLD; forAll(meshEdges, edgei) @@ -200,6 +196,35 @@ void Foam::checkPatch } +template +Foam::label Foam::checkZones +( + const polyMesh& mesh, + const ZoneMesh& zones, + topoSet& set +) +{ + labelList zoneID(set.maxSize(mesh), -1); + for (const auto& zone : zones) + { + for (const label elem : zone) + { + if + ( + zoneID[elem] != -1 + && zoneID[elem] != zone.index() + ) + { + set.insert(elem); + } + zoneID[elem] = zone.index(); + } + } + + return returnReduce(set.size(), sumOp