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

BUG: functionObjectFile - file pointer index was not being incremented

parent 5cc01e73
......@@ -97,6 +97,8 @@ void Foam::functionObjectFile::createFiles()
filePtrs_.set(i, new OFstream(outputDir/(fName + ".dat")));
writeFileHeader(i);
i++;
}
}
}
......@@ -240,6 +242,13 @@ Foam::OFstream& Foam::functionObjectFile::file()
<< endl;
}
if (!filePtrs_.set(0))
{
FatalErrorIn("Foam::OFstream& Foam::functionObjectFile::file()")
<< "File pointer at index " << 0 << " not allocated"
<< abort(FatalError);
}
return filePtrs_[0];
}
......@@ -269,6 +278,13 @@ Foam::OFstream& Foam::functionObjectFile::file(const label i)
<< abort(FatalError);
}
if (!filePtrs_.set(i))
{
FatalErrorIn("Foam::OFstream& Foam::functionObjectFile::file()")
<< "File pointer at index " << i << " not allocated"
<< abort(FatalError);
}
return filePtrs_[i];
}
......
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