From 7ca505ce1bcb35866398bebf860b9bd158db839c Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 21 Jul 2011 14:02:49 +0100 Subject: [PATCH] ENH: checkTopology: illegal cells checking --- .../manipulation/checkMesh/checkTopology.C | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C b/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C index 256ffa19cd..daf71ac7e9 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C @@ -66,6 +66,45 @@ Foam::label Foam::checkTopology } + { + cellSet cells(mesh, "illegalCells", mesh.nCells()/100); + + forAll(mesh.cells(), cellI) + { + const cell& cFaces = mesh.cells()[cellI]; + + if (cFaces.size() <= 3) + { + cells.insert(cellI); + } + forAll(cFaces, i) + { + if (cFaces[i] < 0 || cFaces[i] >= mesh.nFaces()) + { + cells.insert(cellI); + break; + } + } + } + label nCells = returnReduce(cells.size(), sumOp