From 00797389d9d8ed2d08d39603cfd12ffec46d9582 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Thu, 26 May 2011 11:29:38 +0100 Subject: [PATCH] Added owner-neighbour check --- .../primitiveMeshCheck/primitiveMeshCheck.C | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C index 4307defc2..50b7d967b 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C @@ -166,14 +166,45 @@ bool Foam::primitiveMesh::checkClosedCells return true; } + // Check if a face has got the same cell as owner and neighbour + // HJ, 25/May/2011 + const labelList& own = faceOwner(); + const labelList& nei = faceNeighbour(); + + label nErrorOwnNei = 0; + + // Check internal faces only + forAll (nei, faceI) + { + if (own[faceI] == nei[faceI]) + { + if (setPtr) + { + setPtr->insert(own[faceI]); + } + + nErrorOwnNei++; + } + } + + if (nErrorOwnNei > 0) + { + if (debug || report) + { + Info<< " ***Faces declaring same cell as owner and neighbour " + << "found, number of faces " + << nErrorOwnNei << endl; + } + + return true; + } + // Loop through cell faces and sum up the face area vectors for each cell. // This should be zero in all vector components vectorField sumClosed(nCells(), vector::zero); vectorField sumMagClosed(nCells(), vector::zero); - const labelList& own = faceOwner(); - const labelList& nei = faceNeighbour(); const vectorField& areas = faceAreas(); forAll (own, faceI)