#include "checkTopology.H" #include "polyMesh.H" #include "foamTime.H" #include "regionSplit.H" #include "cellSet.H" #include "faceSet.H" #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, const bool allTopology, const bool allGeometry ) { label noFailedChecks = 0; Info<< "Checking topology..." << endl; // Check if the boundary definition is unique mesh.boundaryMesh().checkDefinition(true); // 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(false)) { Info<< " ***FaceZone " << mesh.faceZones()[zoneI].name() << " is not correctly synchronised" << " across coupled boundaries." << " (coupled faces both" << " present in set but with opposite flipmap)" << endl; noFailedChecks++; } } } { pointSet points(mesh, "unusedPoints", mesh.nPoints()/100); if (mesh.checkPoints(true, &points)) { noFailedChecks++; label nPoints = returnReduce(points.size(), sumOp