From 00328814d945164bb59d9a356a2832ca883b50e6 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 6 Mar 2009 13:34:35 +0000 Subject: [PATCH] disconnected cell check --- .../manipulation/checkMesh/checkTopology.C | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C b/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C index de69375595..14f5704836 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C @@ -102,6 +102,67 @@ Foam::label Foam::checkTopology } } + if (allTopology) + { + labelList nInternalFaces(mesh.nCells(), 0); + + for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++) + { + nInternalFaces[mesh.faceOwner()[faceI]]++; + nInternalFaces[mesh.faceNeighbour()[faceI]]++; + } + const polyBoundaryMesh& patches = mesh.boundaryMesh(); + forAll(patches, patchI) + { + if (patches[patchI].coupled()) + { + const unallocLabelList& owners = patches[patchI].faceCells(); + + forAll(owners, i) + { + nInternalFaces[owners[i]]++; + } + } + } + + faceSet oneCells(mesh, "oneInternalFaceCells", mesh.nCells()/100); + faceSet twoCells(mesh, "twoInternalFacesCells", mesh.nCells()/100); + + forAll(nInternalFaces, cellI) + { + if (nInternalFaces[cellI] <= 1) + { + oneCells.insert(cellI); + } + else if (nInternalFaces[cellI] == 2) + { + twoCells.insert(cellI); + } + } + + label nOneCells = returnReduce(oneCells.size(), sumOp