Commit 82a18e4c authored by Prashant Sonakar's avatar Prashant Sonakar
Browse files

ENH: Print info on zones only if present

parent 81d42928
......@@ -588,44 +588,51 @@ Foam::label Foam::checkTopology
Pout.setf(ios_base::left);
Info<< " "
<< setw(20) << "FaceZone"
<< setw(9) << "Faces"
<< setw(9) << "Points"
<< setw(13) << "BoundingBox" <<endl;
const pointField& points = mesh.points();
const faceList& faces = mesh.faces();
const faceZoneMesh& faceZones = mesh.faceZones();
DynamicList<point> localPoints;
forAll(faceZones, zoneI)
if (faceZones.size())
{
const faceZone& fZone = faceZones[zoneI];
localPoints.setCapacity(10*faces.size());
Info<< " "
<< setw(20) << "FaceZone"
<< setw(9) << "Faces"
<< setw(9) << "Points"
<< setw(13) << "BoundingBox" <<endl;
const pointField& points = mesh.points();
const faceList& faces = mesh.faces();
forAll(fZone, i)
DynamicList<point> localPoints;
forAll(faceZones, zoneI)
{
const label faceI = fZone[i];
const face& f = faces[faceI];
const pointField facePoints(f.points(points));
const faceZone& fZone = faceZones[zoneI];
localPoints.setCapacity(10*faces.size());
forAll(facePoints, pointI)
forAll(fZone, i)
{
const point& pt = facePoints[pointI];
localPoints.append(pt);
}
}
boundBox bb(localPoints, true);
const label faceI = fZone[i];
const face& f = faces[faceI];
const pointField facePoints(f.points(points));
Info<< " "
<< setw(20) << fZone.name()
<< setw(9) << returnReduce(fZone.size(), sumOp<label>())
<< setw(9) << returnReduce(localPoints.size(), sumOp<label>())
<< setw(3) << bb;
forAll(facePoints, pointI)
{
const point& pt = facePoints[pointI];
localPoints.append(pt);
}
}
boundBox bb(localPoints, true);
Info<< " "
<< setw(20) << fZone.name()
<< setw(9) << returnReduce(fZone.size(), sumOp<label>())
<< setw(9)
<< returnReduce(localPoints.size(), sumOp<label>())
<< setw(3) << bb << endl;
}
}
else
{
Info<< " No faceZones found."<<endl;
}
Info<< endl;
}
{
......@@ -633,45 +640,54 @@ Foam::label Foam::checkTopology
Pout.setf(ios_base::left);
Info<< " "
<< setw(20) << "CellZone"
<< setw(9) << "Cells"
<< setw(9) << "Points"
<< setw(13) << "BoundingBox" <<endl;
const pointField& points = mesh.points();
const cellList& cells = mesh.cells();
const faceList& faces = mesh.faces();
const cellZoneMesh& cellZones = mesh.cellZones();
DynamicList<point> localPoints;
forAll(cellZones, zoneI)
if (cellZones.size())
{
const cellZone& cZone = cellZones[zoneI];
localPoints.setCapacity(10*faces.size());
forAll(cZone, i)
Info<< " "
<< setw(20) << "CellZone"
<< setw(9) << "Cells"
<< setw(9) << "Points"
<< setw(13) << "BoundingBox" <<endl;
const pointField& points = mesh.points();
const cellList& cells = mesh.cells();
const faceList& faces = mesh.faces();
DynamicList<point> localPoints;
forAll(cellZones, zoneI)
{
const label cellI = cZone[i];
const cell& c = cells[cellI];
const pointField cellPoints(c.points(faces, points));
const cellZone& cZone = cellZones[zoneI];
localPoints.setCapacity(10*faces.size());
forAll(cellPoints, pointI)
forAll(cZone, i)
{
const point& pt = cellPoints[pointI];
localPoints.append(pt);
const label cellI = cZone[i];
const cell& c = cells[cellI];
const pointField cellPoints(c.points(faces, points));
forAll(cellPoints, pointI)
{
const point& pt = cellPoints[pointI];
localPoints.append(pt);
}
}
}
boundBox bb(localPoints, true);
boundBox bb(localPoints, true);
Info<< " "
<< setw(20) << cZone.name()
<< setw(9) << returnReduce(cZone.size(), sumOp<label>())
<< setw(9) << returnReduce(localPoints.size(), sumOp<label>())
<< setw(3) << bb;
Info<< " "
<< setw(20) << cZone.name()
<< setw(9) << returnReduce(cZone.size(), sumOp<label>())
<< setw(9)
<< returnReduce(localPoints.size(), sumOp<label>())
<< setw(3) << bb << endl;
}
}
else
{
Info<< " No cellZones found."<<endl;
}
Info<< endl;
}
// Force creation of all addressing if requested.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment