checkTimeOption.H
Go to the documentation of this file.
1 //
2 // checkTimeOption.H
3 // ~~~~~~~~~~~~~~~~~
4 // Check -time and -latestTime options
5 
6 if (args.optionFound("time"))
7 {
8  Foam::scalar timeValue = args.optionRead<scalar>("time");
9 
10  startTime = Foam::Time::findClosestTimeIndex(Times, timeValue);
11 }
12 
13 if (args.optionFound("latestTime"))
14 {
15  startTime = Times.size() - 1;
16 }
Foam::Time::findClosestTimeIndex
static label findClosestTimeIndex(const instantList &, const scalar, const word &constantName="constant")
Search instantList for the time index closest to the given time.
Definition: Time.C:841
Foam::argList::optionRead
T optionRead(const word &opt) const
Read a value from the named option.
Definition: argListI.H:187
Foam::argList::optionFound
bool optionFound(const word &opt) const
Return true if the named option is found.
Definition: argListI.H:108
startTime
Foam::label startTime
Definition: checkTimeOptions.H:5
args
Foam::argList args(argc, argv)