mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: checkMesh: output volume of cellZone. Fixes #727.
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user