From e54f156e60266fa80ccabd78f8bcd2fc9cc2e01b Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 8 Aug 2013 12:21:15 +0100 Subject: [PATCH] BUG: AMI - corrected appending of neighbour faces routine --- .../AMIMethod/AMIMethod/AMIMethod.C | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethod.C b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethod.C index bb1e61d210..4805878be2 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethod.C +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethod.C @@ -273,9 +273,8 @@ void Foam::AMIMethod::appendNbrFaces ) const { const labelList& nbrFaces = patch.faceFaces()[faceI]; - const pointField& points = patch.points(); - // filter out faces already visited from src face neighbours + // filter out faces already visited from face neighbours forAll(nbrFaces, i) { label nbrFaceI = nbrFaces[i]; @@ -301,15 +300,15 @@ void Foam::AMIMethod::appendNbrFaces } } + // prevent addition of face if it is not on the same plane-ish if (valid) { - const face& f = patch[faceI]; - const face& nbrF = patch[nbrFaceI]; - const vector& n = f.normal(points); - const vector& nbrN = nbrF.normal(points); - scalar cosI = mag(nbrN & n); + const vector& n1 = patch.faceNormals()[faceI]; + const vector& n2 = patch.faceNormals()[nbrFaceI]; - if (cosI < Foam::cos(degToRad(89.0))) + scalar cosI = n1 & n2; + + if (cosI > Foam::cos(degToRad(89.0))) { faceIDs.append(nbrFaceI); }