mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
checks on zones
This commit is contained in:
@ -7,6 +7,31 @@
|
||||
#include "pointSet.H"
|
||||
#include "IOmanip.H"
|
||||
|
||||
bool Foam::checkSync(const wordList& names)
|
||||
{
|
||||
List<wordList> 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))
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -69,13 +69,13 @@ void Foam::printMeshStats(const polyMesh& mesh, const bool allTopology)
|
||||
<< " cells: "
|
||||
<< returnReduce(mesh.cells().size(), sumOp<label>()) << nl
|
||||
<< " boundary patches: "
|
||||
<< returnReduce(mesh.boundaryMesh().size(), sumOp<label>()) << nl
|
||||
<< mesh.boundaryMesh().size() << nl
|
||||
<< " point zones: "
|
||||
<< returnReduce(mesh.pointZones().size(), sumOp<label>()) << nl
|
||||
<< mesh.pointZones().size() << nl
|
||||
<< " face zones: "
|
||||
<< returnReduce(mesh.faceZones().size(), sumOp<label>()) << nl
|
||||
<< mesh.faceZones().size() << nl
|
||||
<< " cell zones: "
|
||||
<< returnReduce(mesh.cellZones().size(), sumOp<label>()) << nl
|
||||
<< mesh.cellZones().size() << nl
|
||||
<< endl;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user