All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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.name() != runTime.constant()
13  && runTime.name() != "0"
14  )
15  {
16  typeIOobject<IOdictionary> io
17  (
18  "time",
19  runTime.name(),
20  "uniform",
21  runTime,
22  IOobject::READ_IF_PRESENT,
23  IOobject::NO_WRITE,
24  false
25  );
26 
27  if (io.headerOk())
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 "
37  << io.objectPath() << endl;
38  continue;
39  }
40  }
41 
42  timeIndices.insert(timeIndex, timeDirs[timeI].value());
43  Info<< "\nTime [" << timeIndex << "] = " << runTime.name() << nl;
static instantList timeDirs
Definition: globalFoam.H:44
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
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:257
messageStream Info
static const char nl
Definition: Ostream.H:266
label timeIndex
Definition: getTimeIndex.H:4