ENH: checkMesh: output volume of cellZone. Fixes #727.

This commit is contained in:
mattijs
2018-07-04 12:08:24 +01:00
parent 252b5ff7dc
commit 989ee54bb1

View File

@ -656,19 +656,24 @@ Foam::label Foam::checkTopology
<< setw(20) << "CellZone"
<< setw(13) << "Cells"
<< setw(13) << "Points"
<< ' ' << "BoundingBox" <<endl;
<< setw(13) << "Volume"
<< "BoundingBox" << endl;
const cellList& cells = mesh.cells();
const faceList& faces = mesh.faces();
const scalarField& cellVolumes = mesh.cellVolumes();
bitSet isZonePoint(mesh.nPoints());
for (const cellZone& cZone : cellZones)
{
boundBox bb;
isZonePoint.reset(); // clears all bits (reset count)
scalar v = 0.0;
for (const label celli : cZone)
{
v += cellVolumes[celli];
for (const label facei : cells[celli])
{
const face& f = faces[facei];
@ -685,11 +690,13 @@ Foam::label Foam::checkTopology
bb.reduce(); // Global min/max
Info<< " "
<< setw(20) << cZone.name()
<< setw(19) << cZone.name()
<< ' ' << setw(12)
<< returnReduce(cZone.size(), sumOp<label>())
<< ' ' << setw(12)
<< returnReduce(isZonePoint.count(), sumOp<label>())
<< ' ' << setw(12)
<< returnReduce(v, sumOp<scalar>())
<< ' ' << bb << endl;
}
}