BUG: Fixes mantis issue 0000012: sample utiltiy update

This commit is contained in:
andy
2010-08-27 10:41:49 +01:00
parent f709d24dbe
commit 83c10e1cf6
2 changed files with 41 additions and 13 deletions

View File

@ -128,13 +128,32 @@ void Foam::sampledSets::writeSampleFile
timeDir/formatter.getFileName(masterSampleSet, valueSetNames)
);
formatter.write
(
masterSampleSet,
valueSetNames,
valueSets,
OFstream(fName)()
);
OFstream ofs(fName);
if (ofs.opened())
{
formatter.write
(
masterSampleSet,
valueSetNames,
valueSets,
ofs
);
}
else
{
WarningIn
(
"void Foam::sampledSets::writeSampleFile"
"("
"const coordSet&, "
"const PtrList<volFieldSampler<Type> >&, "
"const label, "
"const fileName&, "
"const writer<Type>&"
")"
) << "File " << ofs.name() << " could not be opened. "
<< "No data will be written" << endl;
}
}