From c03ddde3f01d2b3402ca8c321701da98eb15b8c0 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 29 Nov 2011 18:12:49 +0000 Subject: [PATCH] BUG: Corrected normal face calculation for reversed target patch --- .../AMIInterpolation/AMIInterpolation.C | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C index ad0882c84c..74c0235606 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C @@ -904,8 +904,17 @@ Foam::scalar Foam::AMIInterpolation::interArea // create intersection object faceAreaIntersect inter(srcPoints, tgtPoints, reverseTarget_); - // crude resultant norm - face normals should be opposite - const vector n = 0.5*(tgt.normal(tgtPoints) - src.normal(srcPoints)); + // crude resultant norm + vector n(-src.normal(srcPoints)); + if (reverseTarget_) + { + n -= tgt.normal(tgtPoints); + } + else + { + n += tgt.normal(tgtPoints); + } + n *= 0.5; scalar area = 0; if (mag(n) > ROOTVSMALL)