ENH: AMI - use pre-calculated areas instead of re-calculation

This commit is contained in:
andy 2011-12-08 12:48:21 +00:00
parent 1fca957415
commit f90965211f

View File

@ -889,21 +889,22 @@ Foam::scalar Foam::AMIInterpolation<SourcePatch, TargetPatch>::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_)