ENH: Updated AMI output to include average weights

This commit is contained in:
andy
2011-11-15 14:53:27 +00:00
parent 36e4a15363
commit 9d453652d6

View File

@ -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;
}
}