getTimeIndex.H
Go to the documentation of this file.
1 // Read time index from */uniform/time, but treat 0 and constant specially
2 // or simply increment from the '-index' option if it was supplied
3 
4 label timeIndex = 0;
5 {
6  if (doConsecutive)
7  {
8  timeIndex = indexingNumber++;
9  }
10  else if
11  (
12  runTime.timeName() != runTime.constant()
13  && runTime.timeName() != "0"
14  )
15  {
16  IOobject io
17  (
18  "time",
19  runTime.timeName(),
20  "uniform",
21  runTime,
22  IOobject::READ_IF_PRESENT,
23  IOobject::NO_WRITE,
24  false // no register
25  );
26 
27  if (io.typeHeaderOk<IOdictionary>(true, false))
28  {
29  io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
30  IOdictionary timeObject(io);
31 
32  timeObject.readEntry("index", timeIndex);
33  }
34  else
35  {
36  Info<< "skip ... missing entry " << io.objectPath() << endl;
37  continue;
38  }
39  }
40 }
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:350
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
timeIndex
label timeIndex
Definition: getTimeIndex.H:4