BUG: Fixes mantis issue 0000012: sample utiltiy update
This commit is contained in:
parent
f709d24dbe
commit
83c10e1cf6
@ -96,17 +96,26 @@ using namespace Foam;
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
timeSelector::addOptions();
|
timeSelector::addOptions();
|
||||||
# include "addRegionOption.H"
|
#include "addRegionOption.H"
|
||||||
# include "setRootCase.H"
|
argList::addOption
|
||||||
# include "createTime.H"
|
(
|
||||||
|
"dict",
|
||||||
|
"word",
|
||||||
|
"name of dictionary to provide sample information"
|
||||||
|
);
|
||||||
|
|
||||||
|
#include "setRootCase.H"
|
||||||
|
#include "createTime.H"
|
||||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||||
# include "createNamedMesh.H"
|
#include "createNamedMesh.H"
|
||||||
|
|
||||||
|
word sampleDict(args.optionLookupOrDefault<word>("dict", "sampleDict"));
|
||||||
|
|
||||||
IOsampledSets sSets
|
IOsampledSets sSets
|
||||||
(
|
(
|
||||||
sampledSets::typeName,
|
sampledSets::typeName,
|
||||||
mesh,
|
mesh,
|
||||||
"sampleDict",
|
sampleDict,
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
@ -115,7 +124,7 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
sampledSurfaces::typeName,
|
sampledSurfaces::typeName,
|
||||||
mesh,
|
mesh,
|
||||||
"sampleDict",
|
sampleDict,
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
@ -128,13 +128,32 @@ void Foam::sampledSets::writeSampleFile
|
|||||||
timeDir/formatter.getFileName(masterSampleSet, valueSetNames)
|
timeDir/formatter.getFileName(masterSampleSet, valueSetNames)
|
||||||
);
|
);
|
||||||
|
|
||||||
formatter.write
|
OFstream ofs(fName);
|
||||||
(
|
if (ofs.opened())
|
||||||
masterSampleSet,
|
{
|
||||||
valueSetNames,
|
formatter.write
|
||||||
valueSets,
|
(
|
||||||
OFstream(fName)()
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user