mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
foamToEnsightParts: added -index option, streamlined IOobject usage, fixed typo
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user