diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C index 4c6cda063a7997b81c91a5fb16eb4e6151e4fe06..3b7f7a527f4903de5c169b61dae4cedc946f4dfb 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C @@ -1094,18 +1094,19 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::normaliseWeights const bool output ) { - scalarList wghtSum(wght.size(), 0.0); - scalar minBound = VGREAT; scalar maxBound = -VGREAT; + scalar tSum = 0.0; + // Normalise the weights forAll(wght, faceI) { scalar s = sum(wght[faceI]); - wghtSum[faceI] = s; - scalar t = s/patchAreas[faceI]; + + tSum += t; + if (t < minBound) { minBound = t; @@ -1122,11 +1123,16 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::normaliseWeights } } + if (output) { - Info<< "AMI: Patch " << patchName << " weights min/max = " + const label nFace = returnReduce(wght.size(), sumOp<scalar>()); + reduce(tSum, sumOp<scalar>()); + + Info<< "AMI: Patch " << patchName << " weights min/max/average = " << returnReduce(minBound, minOp<scalar>()) << ", " - << returnReduce(maxBound, maxOp<scalar>()) << endl; + << returnReduce(maxBound, maxOp<scalar>()) << ", " + << tSum/nFace << endl; } }