1 #include "printMeshStats.H"
3 #include "globalMeshData.H"
5 #include "hexMatcher.H"
6 #include "wedgeMatcher.H"
7 #include "prismMatcher.H"
8 #include "pyrMatcher.H"
9 #include "tetWedgeMatcher.H"
10 #include "tetMatcher.H"
13 void Foam::printMeshStats(const polyMesh& mesh, const bool allTopology)
15 Info<< "Mesh stats" << nl
17 << returnReduce(mesh.allPoints().size(), sumOp<label>()) << nl
19 << returnReduce(mesh.points().size(), sumOp<label>()) << nl
21 << returnReduce(mesh.allFaces().size(), sumOp<label>()) << nl
23 << returnReduce(mesh.faces().size(), sumOp<label>()) << nl
24 << " internal faces: "
25 << returnReduce(mesh.faceNeighbour().size(), sumOp<label>()) << nl
27 << returnReduce(mesh.cells().size(), sumOp<label>()) << nl
28 << " boundary patches: "
29 << mesh.boundaryMesh().size() << nl
31 << mesh.pointZones().size() << nl
33 << mesh.faceZones().size() << nl
35 << mesh.cellZones().size() << nl
39 // Construct shape recognizers
44 tetWedgeMatcher tetWedge;
47 // Counters for different cell types
56 for(label cellI = 0; cellI < mesh.nCells(); cellI++)
58 if (hex.isA(mesh, cellI))
62 else if (tet.isA(mesh, cellI))
66 else if (pyr.isA(mesh, cellI))
70 else if (prism.isA(mesh, cellI))
74 else if (wedge.isA(mesh, cellI))
78 else if (tetWedge.isA(mesh, cellI))
88 reduce(nHex, sumOp<label>());
89 reduce(nPrism, sumOp<label>());
90 reduce(nWedge, sumOp<label>());
91 reduce(nPyr, sumOp<label>());
92 reduce(nTetWedge, sumOp<label>());
93 reduce(nTet, sumOp<label>());
94 reduce(nUnknown, sumOp<label>());
96 Info<< "Overall number of cells of each type:" << nl
97 << " hexahedra: " << nHex << nl
98 << " prisms: " << nPrism << nl
99 << " wedges: " << nWedge << nl
100 << " pyramids: " << nPyr << nl
101 << " tet wedges: " << nTetWedge << nl
102 << " tetrahedra: " << nTet << nl
103 << " polyhedra: " << nUnknown