ENH: writeFile - return bool on successful read

This commit is contained in:
Andrew Heather
2016-11-29 14:45:45 +00:00
parent 89b1b64414
commit 86982f5eb7
2 changed files with 11 additions and 9 deletions

View File

@ -182,7 +182,7 @@ Foam::functionObjects::writeFile::~writeFile()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::functionObjects::writeFile::read(const dictionary& dict)
bool Foam::functionObjects::writeFile::read(const dictionary& dict)
{
writePrecision_ =
dict.lookupOrDefault("writePrecision", IOstream::defaultPrecision());
@ -190,6 +190,8 @@ void Foam::functionObjects::writeFile::read(const dictionary& dict)
// Only write on master process
writeToFile_ = dict.lookupOrDefault("writeToFile", true);
writeToFile_ = writeToFile_ && Pstream::master();
return true;
}