diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C index f37d7ae2bd..8bc8b86d2e 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C @@ -190,12 +190,13 @@ void Foam::AMIInterpolation::normaliseWeights wghtSum.setSize(wght.size()); forAll(wght, faceI) { - scalar s = sum(wght[faceI]); + scalarList& w = wght[faceI]; + scalar s = sum(w); scalar t = s/patchAreas[faceI]; - forAll(addr[faceI], i) + forAll(w, i) { - wght[faceI][i] /= s; + w[i] /= s; } wghtSum[faceI] = t; diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/faceAreaWeightAMI/faceAreaWeightAMI.C b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/faceAreaWeightAMI/faceAreaWeightAMI.C index 820d3f22fc..ab47c3afb4 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/faceAreaWeightAMI/faceAreaWeightAMI.C +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/faceAreaWeightAMI/faceAreaWeightAMI.C @@ -67,7 +67,7 @@ bool Foam::faceAreaWeightAMI::processSourceFace visitedFaces.append(tgtFaceI); scalar area = interArea(srcFaceI, tgtFaceI); - // store when intersection area > 0 + // store when intersection fractional area > tolerance if (area/this->srcMagSf_[srcFaceI] > faceAreaIntersect::tolerance()) { srcAddr[srcFaceI].append(tgtFaceI); @@ -227,12 +227,9 @@ Foam::scalar Foam::faceAreaWeightAMI::interArea const face& tgt = this->tgtPatch_[tgtFaceI]; // quick reject if either face has zero area - // Note: do not used stored face areas for target patch + // Note: do not use stored face areas for target patch const scalar tgtMag = tgt.mag(tgtPoints); - if - ( - (this->srcMagSf_[srcFaceI] < ROOTVSMALL) || (tgtMag < ROOTVSMALL) - ) + if ((this->srcMagSf_[srcFaceI] < ROOTVSMALL) || (tgtMag < ROOTVSMALL)) { return 0.0; }