From f90965211fc349d8f7fbf1beedbf6964fc8f599a Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 8 Dec 2011 12:48:21 +0000 Subject: [PATCH] ENH: AMI - use pre-calculated areas instead of re-calculation --- .../AMIInterpolation/AMIInterpolation.C | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C index 74c0235606..a9c9113056 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C @@ -889,21 +889,22 @@ Foam::scalar Foam::AMIInterpolation::interArea const primitivePatch& tgtPatch ) const { - const pointField& srcPoints = srcPatch.points(); - const pointField& tgtPoints = tgtPatch.points(); - - const face& src = srcPatch[srcFaceI]; - const face& tgt = tgtPatch[tgtFaceI]; - // quick reject if either face has zero area - if ((src.mag(srcPoints) < ROOTVSMALL) || (tgt.mag(tgtPoints) < ROOTVSMALL)) + if (srcMagSf_[srcFaceI] < ROOTVSMALL || tgtMagSf_[tgtFaceI] < ROOTVSMALL) { return 0.0; } + const pointField& srcPoints = srcPatch.points(); + const pointField& tgtPoints = tgtPatch.points(); + // create intersection object faceAreaIntersect inter(srcPoints, tgtPoints, reverseTarget_); + // references to candidate faces + const face& src = srcPatch[srcFaceI]; + const face& tgt = tgtPatch[tgtFaceI]; + // crude resultant norm vector n(-src.normal(srcPoints)); if (reverseTarget_)