OpenFOAM: API Guide
v2012
The open source CFD toolbox
checkTimeOption.H
Go to the documentation of this file.
1
// Check -time and -latestTime options
2
3
if
(
args
.
found
(
"time"
))
4
{
5
Foam::scalar timeValue =
args
.
get
<scalar>(
"time"
);
6
7
startTime
=
Foam::Time::findClosestTimeIndex
(Times, timeValue);
8
}
9
10
if
(
args
.
found
(
"latestTime"
))
11
{
12
startTime
= Times.size() - 1;
13
}
Foam::TimePaths::findClosestTimeIndex
static label findClosestTimeIndex(const instantList &timeDirs, const scalar t, const word &constantName="constant")
Search instantList for the time index closest to the specified time.
Definition:
TimePaths.C:156
Foam::argList::get
T get(const label index) const
Get a value from the argument at index.
Definition:
argListI.H:251
startTime
Foam::label startTime
Definition:
checkTimeOptions.H:1
args
Foam::argList args(argc, argv)
Foam::argList::found
bool found(const word &optName) const
Return true if the named option is found.
Definition:
argListI.H:151
src
OpenFOAM
include
checkTimeOption.H
Generated by
1.8.17
OPENFOAM® is a registered
trademark
of OpenCFD Ltd.