Loading...
Searching...
No Matches
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 // Info<< "skip ... missing entry " << io.objectPath() << endl;
31 // continue;
32 }
33 }
34
35 Info<< "\nTime [" << timeName << "] = " << runTime.timeName() << nl;
engineTime & runTime
const auto & io
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 expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
constexpr char nl
The newline '\n' character (0x0a).
Definition Ostream.H:50
label timeIndex