Skip to content
Snippets Groups Projects
Commit d5764cee authored by Kutalmış Berçin's avatar Kutalmış Berçin
Browse files

SQUASH: simplify the weighted average routine

parent 188bce8c
No related branches found
No related tags found
No related merge requests found
...@@ -121,8 +121,7 @@ T Foam::functionObjects::fieldStatistics::calcMean(const Field<T>& field) ...@@ -121,8 +121,7 @@ T Foam::functionObjects::fieldStatistics::calcMean(const Field<T>& field)
{ {
if (internal_ && (mean_ == VOLUMETRIC)) if (internal_ && (mean_ == VOLUMETRIC))
{ {
const Field<scalar>& V = mesh_.V(); return gWeightedAverage(mesh_.V(), field);
return (gSum(V*field)/gSum(V));
} }
return gAverage(field); return gAverage(field);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment