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 false
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 // Info<< "skip ... missing entry " << io.objectPath() << endl;
31 // continue;
32 }
33 }
34
35 Info<< "\nTime [" << timeName << "] = " << runTime.timeName() << nl;
engineTime & runTime
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
word timeName
Definition: getTimeIndex.H:3
messageStream Info
Information stream (stdout output on master, null elsewhere)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
constexpr char nl
The newline '\n' character (0x0a)
Definition: Ostream.H:53
label timeIndex
Definition: getTimeIndex.H:30