OpenFOAM
v2312
The open source CFD toolbox
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"
);
25
timeName
=
Foam::name
(
timeIndex
);
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
;
Foam::nl
constexpr char nl
The newline '\n' character (0x0a)
Definition:
Ostream.H:50
runTime
engineTime & runTime
Definition:
createEngineTime.H:13
timeName
word timeName
Definition:
getTimeIndex.H:3
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition:
exprTraits.C:127
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
io
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
timeIndex
label timeIndex
Definition:
getTimeIndex.H:24
applications
utilities
mesh
conversion
foamToStarMesh
getTimeIndex.H
Generated by
1.8.14