Skip to content
Snippets Groups Projects
Commit 45ca1c06 authored by mattijs's avatar mattijs
Browse files

BUG: fieldMinMax: accessing uninitialised data (data not scattered)

parent c380d6d4
No related merge requests found
......@@ -73,16 +73,16 @@ void Foam::fieldMinMax::calcMinMaxFields
Pstream::gatherList(maxVs);
Pstream::gatherList(maxCs);
label minI = findMin(minVs);
scalar minValue = minVs[minI];
const vector& minC = minCs[minI];
label maxI = findMax(maxVs);
scalar maxValue = maxVs[maxI];
const vector& maxC = maxCs[maxI];
if (Pstream::master())
{
label minI = findMin(minVs);
scalar minValue = minVs[minI];
const vector& minC = minCs[minI];
label maxI = findMax(maxVs);
scalar maxValue = maxVs[maxI];
const vector& maxC = maxCs[maxI];
if (write_)
{
fieldMinMaxFilePtr_()
......@@ -153,17 +153,16 @@ void Foam::fieldMinMax::calcMinMaxFields
Pstream::gatherList(maxVs);
Pstream::gatherList(maxCs);
label minI = findMin(minVs);
Type minValue = minVs[minI];
const vector& minC = minCs[minI];
label maxI = findMax(maxVs);
Type maxValue = maxVs[maxI];
const vector& maxC = maxCs[maxI];
if (Pstream::master())
{
label minI = findMin(minVs);
Type minValue = minVs[minI];
const vector& minC = minCs[minI];
label maxI = findMax(maxVs);
Type maxValue = maxVs[maxI];
const vector& maxC = maxCs[maxI];
if (write_)
{
fieldMinMaxFilePtr_()
......
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