Skip to content
Snippets Groups Projects
Commit b8c2cbaa authored by andy's avatar andy
Browse files

BUG: Contuation from commit ca0799cb - updated cellSource

parent dfaf4fbe
No related merge requests found
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -72,32 +72,32 @@ Type Foam::fieldValues::cellSource::processValues
{
case opSum:
{
result = sum(values);
result = gSum(values);
break;
}
case opVolAverage:
{
result = sum(values*V)/sum(V);
result = gSum(values*V)/gSum(V);
break;
}
case opVolIntegrate:
{
result = sum(values*V);
result = gSum(values*V);
break;
}
case opWeightedAverage:
{
result = sum(values*weightField)/sum(weightField);
result = gSum(values*weightField)/gSum(weightField);
break;
}
case opMin:
{
result = min(values);
result = gMin(values);
break;
}
case opMax:
{
result = max(values);
result = gMax(values);
break;
}
default:
......@@ -128,10 +128,10 @@ bool Foam::fieldValues::cellSource::writeValues(const word& fieldName)
combineFields(setFieldValues<scalar>(weightFieldName_))
);
Type result = processValues(values, V, weightField);
if (Pstream::master())
{
Type result = processValues(values, V, weightField);
if (valueOutput_)
{
IOField<Type>
......
......@@ -158,11 +158,10 @@ bool Foam::fieldValues::faceSource::writeValues(const word& fieldName)
magSf = combineFields(magSf);
weightField = combineFields(weightField);
Type result = processValues(values, magSf, weightField);
if (Pstream::master())
{
Type result = processValues(values, magSf, weightField);
if (valueOutput_)
{
IOField<Type>
......
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