diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C b/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C index 14f5704836..9ce34cda1c 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C @@ -7,6 +7,31 @@ #include "pointSet.H" #include "IOmanip.H" +bool Foam::checkSync(const wordList& names) +{ + List allNames(Pstream::nProcs()); + allNames[Pstream::myProcNo()] = names; + Pstream::gatherList(allNames); + + bool hasError = false; + + for (label procI = 1; procI < allNames.size(); procI++) + { + if (allNames[procI] != allNames[0]) + { + hasError = true; + + Info<< " ***Inconsistent zones across processors, " + "processor 0 has zones:" << allNames[0] + << ", processor " << procI << " has zones:" + << allNames[procI] + << endl; + } + } + return hasError; +} + + Foam::label Foam::checkTopology ( const polyMesh& mesh, @@ -24,6 +49,31 @@ Foam::label Foam::checkTopology // Check if the boundary processor patches are correct mesh.boundaryMesh().checkParallelSync(true); + // Check names of zones are equal + if (checkSync(mesh.cellZones().names())) + { + noFailedChecks++; + } + if (checkSync(mesh.faceZones().names())) + { + noFailedChecks++; + } + if (checkSync(mesh.pointZones().names())) + { + noFailedChecks++; + } + + // Check contents of faceZones consistent + { + forAll(mesh.faceZones(), zoneI) + { + if (mesh.faceZones()[zoneI].checkParallelSync(true)) + { + noFailedChecks++; + } + } + } + { pointSet points(mesh, "unusedPoints", mesh.nPoints()/100); if (mesh.checkPoints(true, &points)) diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkTopology.H b/applications/utilities/mesh/manipulation/checkMesh/checkTopology.H index 787aa4318d..4790765d16 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkTopology.H +++ b/applications/utilities/mesh/manipulation/checkMesh/checkTopology.H @@ -1,8 +1,11 @@ #include "label.H" +#include "wordList.H" namespace Foam { class polyMesh; + bool checkSync(const wordList& names); + label checkTopology(const polyMesh&, const bool, const bool); } diff --git a/applications/utilities/mesh/manipulation/checkMesh/printMeshStats.C b/applications/utilities/mesh/manipulation/checkMesh/printMeshStats.C index 9a2c9396af..269656594c 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/printMeshStats.C +++ b/applications/utilities/mesh/manipulation/checkMesh/printMeshStats.C @@ -69,13 +69,13 @@ void Foam::printMeshStats(const polyMesh& mesh, const bool allTopology) << " cells: " << returnReduce(mesh.cells().size(), sumOp