mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
ENH: static test methods for matching simple cell shapes
- (tet, pyr, hex) can be identified from their number of faces and vertices. For these common shapes can use static `test()` method instead of the virtual isA() method. This is much cheaper for calling on an individual basis since it avoids the overhead of constructing an object. ENH: tetCell edge/reverseEdge (already had tetEdge)
This commit is contained in:
@ -133,12 +133,9 @@ void Foam::printMeshStats(const polyMesh& mesh, const bool allTopology)
|
||||
<< endl;
|
||||
|
||||
// Construct shape recognizers
|
||||
hexMatcher hex;
|
||||
prismMatcher prism;
|
||||
wedgeMatcher wedge;
|
||||
pyrMatcher pyr;
|
||||
tetWedgeMatcher tetWedge;
|
||||
tetMatcher tet;
|
||||
|
||||
// Counters for different cell types
|
||||
label nHex = 0;
|
||||
@ -153,15 +150,15 @@ void Foam::printMeshStats(const polyMesh& mesh, const bool allTopology)
|
||||
|
||||
for (label celli = 0; celli < mesh.nCells(); celli++)
|
||||
{
|
||||
if (hex.isA(mesh, celli))
|
||||
if (hexMatcher::test(mesh, celli))
|
||||
{
|
||||
nHex++;
|
||||
}
|
||||
else if (tet.isA(mesh, celli))
|
||||
else if (tetMatcher::test(mesh, celli))
|
||||
{
|
||||
nTet++;
|
||||
}
|
||||
else if (pyr.isA(mesh, celli))
|
||||
else if (pyrMatcher::test(mesh, celli))
|
||||
{
|
||||
nPyr++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user