db7fac3f24
git-svn-id: https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Core/OpenFOAM-1.5-dev@1731 e4e07f05-0c2f-0410-a05a-b8ba57e0c909
50 lines
1.1 KiB
C
50 lines
1.1 KiB
C
// Read time index from */uniform/time,
|
|
// but treat 0 and constant specially
|
|
|
|
label timeIndex = 0;
|
|
|
|
if
|
|
(
|
|
runTime.timeName() != "constant"
|
|
&& runTime.timeName() != "0"
|
|
)
|
|
{
|
|
IOobject io
|
|
(
|
|
"time",
|
|
runTime.timeName(),
|
|
"uniform",
|
|
runTime,
|
|
IOobject::READ_IF_PRESENT,
|
|
IOobject::NO_WRITE,
|
|
false
|
|
);
|
|
|
|
if (io.headerOk())
|
|
{
|
|
IOdictionary timeObject
|
|
(
|
|
IOobject
|
|
(
|
|
"time",
|
|
runTime.timeName(),
|
|
"uniform",
|
|
runTime,
|
|
IOobject::MUST_READ,
|
|
IOobject::NO_WRITE,
|
|
false
|
|
)
|
|
);
|
|
|
|
timeObject.lookup("index") >> timeIndex;
|
|
}
|
|
else
|
|
{
|
|
Info<< "skip ... missing entry " << io.objectPath() << endl;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
timeIndices.insert(timeIndex, timeDirs[timeI].value());
|
|
Info<< "\nTime [" << timeIndex << "] = " << runTime.timeName() << nl;
|
|
|