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 
5 
6  if (optIndex)
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
25  );
26 
27  if (io.typeHeaderOk<IOdictionary>(true))
28  {
29  io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
30  IOdictionary timeObject(io);
31 
32  timeObject.lookup("index") >> timeIndex;
33  }
34  else
35  {
36  Info<< "skip ... missing entry " << io.objectPath() << endl;
37  continue;
38  }
39  }
40 
41  timeIndices.insert(timeIndex, timeDirs[timeI].value());
42  Info<< "\nTime [" << timeIndex << "] = " << runTime.timeName() << nl;
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
engineTime & runTime
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
static instantList timeDirs
Definition: globalFoam.H:44
static const char nl
Definition: Ostream.H:260
label timeIndex
Definition: getTimeIndex.H:4
messageStream Info