getTimeIndex.H
Go to the documentation of this file.
1 // Read time index from */uniform/time, but treat 0 and constant specially
2 
3  word timeName = "0";
4 
5  if
6  (
7  runTime.timeName() != runTime.constant()
8  && runTime.timeName() != "0"
9  )
10  {
11  IOobject io
12  (
13  "time",
14  runTime.timeName(),
15  "uniform",
16  runTime,
17  IOobject::READ_IF_PRESENT,
18  IOobject::NO_WRITE,
19  IOobject::NO_REGISTER
20  );
21 
22  if (io.typeHeaderOk<IOdictionary>(true))
23  {
24  const label timeIndex = IOdictionary(io).get<label>("index");
26  }
27  else
28  {
29  timeName = runTime.timeName();
30  }
31  }
32 
33  Info<< "\nTime [" << timeName << "] = " << runTime.timeName() << nl;
constexpr char nl
The newline &#39;\n&#39; character (0x0a)
Definition: Ostream.H:50
engineTime & runTime
word timeName
Definition: getTimeIndex.H:3
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition: exprTraits.C:127
messageStream Info
Information stream (stdout output on master, null elsewhere)
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
label timeIndex
Definition: getTimeIndex.H:24