SQUASH: simplify the weighted average routine

This commit is contained in:
Kutalmis Bercin 2025-03-31 11:15:51 +01:00
parent 188bce8c38
commit d5764cee62

View File

@ -121,8 +121,7 @@ T Foam::functionObjects::fieldStatistics::calcMean(const Field<T>& field)
{
if (internal_ && (mean_ == VOLUMETRIC))
{
const Field<scalar>& V = mesh_.V();
return (gSum(V*field)/gSum(V));
return gWeightedAverage(mesh_.V(), field);
}
return gAverage(field);