mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: checkMesh: Add output for the average number of faces per cell
Works in parallel
This commit is contained in:
@ -8,6 +8,7 @@
|
||||
#include "pyrMatcher.H"
|
||||
#include "tetWedgeMatcher.H"
|
||||
#include "tetMatcher.H"
|
||||
#include "IOmanip.H"
|
||||
|
||||
|
||||
void Foam::printMeshStats(const polyMesh& mesh, const bool allTopology)
|
||||
@ -62,22 +63,19 @@ void Foam::printMeshStats(const polyMesh& mesh, const bool allTopology)
|
||||
<< nInternalEdges-nInternal1Edges << nl;
|
||||
}
|
||||
|
||||
Info<< " faces: "
|
||||
<< returnReduce(mesh.faces().size(), sumOp<label>()) << nl
|
||||
<< " internal faces: "
|
||||
<< returnReduce(mesh.faceNeighbour().size(), sumOp<label>()) << nl
|
||||
<< " cells: "
|
||||
<< returnReduce(mesh.cells().size(), sumOp<label>()) << nl
|
||||
<< " boundary patches: "
|
||||
<< mesh.boundaryMesh().size() << nl
|
||||
<< " point zones: "
|
||||
<< mesh.pointZones().size() << nl
|
||||
<< " face zones: "
|
||||
<< mesh.faceZones().size() << nl
|
||||
<< " cell zones: "
|
||||
<< mesh.cellZones().size() << nl
|
||||
<< endl;
|
||||
label nFaces = returnReduce(mesh.faces().size(), sumOp<label>());
|
||||
label nIntFaces = returnReduce(mesh.faceNeighbour().size(), sumOp<label>());
|
||||
label nCells = returnReduce(mesh.cells().size(), sumOp<label>());
|
||||
|
||||
Info<< " faces: " << nFaces << nl
|
||||
<< " internal faces: " << nIntFaces << nl
|
||||
<< " cells: " << nCells << nl
|
||||
<< " faces per cell: " << scalar(nFaces + nIntFaces)/nCells << nl
|
||||
<< " boundary patches: " << mesh.boundaryMesh().size() << nl
|
||||
<< " point zones: " << mesh.pointZones().size() << nl
|
||||
<< " face zones: " << mesh.faceZones().size() << nl
|
||||
<< " cell zones: " << mesh.cellZones().size() << nl
|
||||
<< endl;
|
||||
|
||||
// Construct shape recognizers
|
||||
hexMatcher hex;
|
||||
@ -96,6 +94,8 @@ void Foam::printMeshStats(const polyMesh& mesh, const bool allTopology)
|
||||
label nTetWedge = 0;
|
||||
label nUnknown = 0;
|
||||
|
||||
Map<label> polyhedralFaces;
|
||||
|
||||
for (label cellI = 0; cellI < mesh.nCells(); cellI++)
|
||||
{
|
||||
if (hex.isA(mesh, cellI))
|
||||
@ -125,6 +125,7 @@ void Foam::printMeshStats(const polyMesh& mesh, const bool allTopology)
|
||||
else
|
||||
{
|
||||
nUnknown++;
|
||||
polyhedralFaces(mesh.cells()[cellI].size())++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -144,5 +145,21 @@ void Foam::printMeshStats(const polyMesh& mesh, const bool allTopology)
|
||||
<< " tet wedges: " << nTetWedge << nl
|
||||
<< " tetrahedra: " << nTet << nl
|
||||
<< " polyhedra: " << nUnknown
|
||||
<< nl << endl;
|
||||
<< endl;
|
||||
|
||||
if (nUnknown > 0)
|
||||
{
|
||||
Pstream::mapCombineGather(polyhedralFaces, plusEqOp<label>());
|
||||
|
||||
Info<< " Breakdown of polyhedra by number of faces:" << endl;
|
||||
Info<< " faces" << " number of cells" << endl;
|
||||
|
||||
forAllConstIter(Map<label>, polyhedralFaces, iter)
|
||||
{
|
||||
Info<< setf(std::ios::right) << setw(13)
|
||||
<< iter.key() << " " << iter() << nl;
|
||||
}
|
||||
}
|
||||
|
||||
Info<< endl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user