Commit fd57af99 authored by henry's avatar henry
Browse files

Changed sum to gSum for parallel execution.

parent 2fe4ba82
......@@ -79,12 +79,12 @@ int main(int argc, char *argv[])
Info<< " Reading volScalarField " << fieldName << endl;
volScalarField field(fieldHeader, mesh);
scalar area = sum(mesh.magSf().boundaryField()[patchi]);
scalar area = gSum(mesh.magSf().boundaryField()[patchi]);
scalar sumField = 0;
if (area > 0)
{
sumField = sum
sumField = gSum
(
mesh.magSf().boundaryField()[patchi]
* field.boundaryField()[patchi]
......
......@@ -75,14 +75,14 @@ int main(int argc, char *argv[])
}
// Give patch area
Info<< " Patch area = " << sum(mesh.Sf().boundaryField()[patchi]) << endl;
Info<< " Patch area = " << gSum(mesh.Sf().boundaryField()[patchi]) << endl;
if (fieldHeader.headerClassName() == "volScalarField")
{
Info<< " Reading volScalarField " << fieldName << endl;
volScalarField field(fieldHeader, mesh);
vector sumField = sum
vector sumField = gSum
(
mesh.Sf().boundaryField()[patchi]
* field.boundaryField()[patchi]
......@@ -97,7 +97,7 @@ int main(int argc, char *argv[])
Info<< " Reading surfaceScalarField " << fieldName << endl;
surfaceScalarField field(fieldHeader, mesh);
scalar sumField = sum(field.boundaryField()[patchi]);
scalar sumField = gSum(field.boundaryField()[patchi]);
Info<< " Integral of " << fieldName << " over patch "
<< patchName << '[' << patchi << ']' << " = "
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment