foamToEnsightParts: added -index option, streamlined IOobject usage, fixed typo

This commit is contained in:
Mark Olesen
2008-10-14 15:29:30 +02:00
parent 2c6b136876
commit 56296e89c1
4 changed files with 33 additions and 35 deletions

View File

@ -1,9 +1,13 @@
// Read time index from */uniform/time,
// but treat 0 and constant specially
// Read time index from */uniform/time, but treat 0 and constant specially
// or simply increment from the '-index' option if it was supplied
label timeIndex = 0;
if
if (optIndex)
{
timeIndex = indexingNumber++;
}
else if
(
runTime.timeName() != "constant"
&& runTime.timeName() != "0"
@ -22,19 +26,8 @@
if (io.headerOk())
{
IOdictionary timeObject
(
IOobject
(
"time",
runTime.timeName(),
"uniform",
runTime,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
)
);
io.readOpt() = IOobject::MUST_READ;
IOdictionary timeObject(io);
timeObject.lookup("index") >> timeIndex;
}