ENH: checkMesh: parallel sizes printing for patches

This commit is contained in:
mattijs
2012-10-03 16:54:10 +01:00
parent 5fae67d2f1
commit 267d6fa42c

View File

@ -7,6 +7,7 @@
#include "pointSet.H" #include "pointSet.H"
#include "IOmanip.H" #include "IOmanip.H"
#include "emptyPolyPatch.H" #include "emptyPolyPatch.H"
#include "processorPolyPatch.H"
Foam::label Foam::checkTopology Foam::label Foam::checkTopology
( (
@ -289,10 +290,18 @@ Foam::label Foam::checkTopology
} }
} }
{
if (!Pstream::parRun()) if (!Pstream::parRun())
{ {
Pout<< "\nChecking patch topology for multiply connected surfaces ..." Info<< "\nChecking patch topology for multiply connected"
<< endl; << " surfaces..." << endl;
}
else
{
Info<< "\nChecking basic patch addressing..." << endl;
}
const polyBoundaryMesh& patches = mesh.boundaryMesh(); const polyBoundaryMesh& patches = mesh.boundaryMesh();
@ -301,47 +310,54 @@ Foam::label Foam::checkTopology
( (
mesh, mesh,
"nonManifoldPoints", "nonManifoldPoints",
mesh.nPoints()/100 mesh.nPoints()/1000
); );
Pout.setf(ios_base::left); Pout.setf(ios_base::left);
Pout<< " " Info<< " "
<< setw(20) << "Patch" << setw(20) << "Patch"
<< setw(9) << "Faces" << setw(9) << "Faces"
<< setw(9) << "Points" << setw(9) << "Points";
<< setw(34) << "Surface topology"; if (!Pstream::parRun())
{
Info<< setw(34) << "Surface topology";
}
if (allGeometry) if (allGeometry)
{ {
Pout<< " Bounding box"; Info<< " Bounding box";
} }
Pout<< endl; Info<< endl;
forAll(patches, patchI) forAll(patches, patchI)
{ {
const polyPatch& pp = patches[patchI]; const polyPatch& pp = patches[patchI];
Pout<< " " if (!isA<processorPolyPatch>(pp))
{
Info<< " "
<< setw(20) << pp.name() << setw(20) << pp.name()
<< setw(9) << pp.size() << setw(9) << returnReduce(pp.size(), sumOp<label>())
<< setw(9) << pp.nPoints(); << setw(9) << returnReduce(pp.nPoints(), sumOp<label>());
if (!Pstream::parRun())
{
primitivePatch::surfaceTopo pTyp = pp.surfaceType(); primitivePatch::surfaceTopo pTyp = pp.surfaceType();
if (pp.empty()) if (pp.empty())
{ {
Pout<< setw(34) << "ok (empty)"; Info<< setw(34) << "ok (empty)";
} }
else if (pTyp == primitivePatch::MANIFOLD) else if (pTyp == primitivePatch::MANIFOLD)
{ {
if (pp.checkPointManifold(true, &points)) if (pp.checkPointManifold(true, &points))
{ {
Pout<< setw(34) << "multiply connected (shared point)"; Info<< setw(34)
<< "multiply connected (shared point)";
} }
else else
{ {
Pout<< setw(34) << "ok (closed singly connected)"; Info<< setw(34) << "ok (closed singly connected)";
} }
// Add points on non-manifold edges to make set complete // Add points on non-manifold edges to make set complete
@ -353,11 +369,14 @@ Foam::label Foam::checkTopology
if (pTyp == primitivePatch::OPEN) if (pTyp == primitivePatch::OPEN)
{ {
Pout<< setw(34) << "ok (non-closed singly connected)"; Info<< setw(34)
<< "ok (non-closed singly connected)";
} }
else else
{ {
Pout<< setw(34) << "multiply connected (shared edge)"; Info<< setw(34)
<< "multiply connected (shared edge)";
}
} }
} }
@ -376,15 +395,16 @@ Foam::label Foam::checkTopology
} }
reduce(bb.min(), minOp<vector>()); reduce(bb.min(), minOp<vector>());
reduce(bb.max(), maxOp<vector>()); reduce(bb.max(), maxOp<vector>());
Pout<< ' ' << bb; Info<< ' ' << bb;
} }
} }
Pout<< endl; Info<< endl;
}
} }
if (points.size()) if (points.size())
{ {
Pout<< " <<Writing " << points.size() Info<< " <<Writing " << returnReduce(points.size(), sumOp<label>())
<< " conflicting points to set " << " conflicting points to set "
<< points.name() << endl; << points.name() << endl;
@ -392,7 +412,7 @@ Foam::label Foam::checkTopology
points.write(); points.write();
} }
//Pout.setf(ios_base::right); //Info.setf(ios_base::right);
} }
// Force creation of all addressing if requested. // Force creation of all addressing if requested.