checkTimeOption.H
Go to the documentation of this file.
1 // Deprecated include (2024-05) - prefer timeSelector
2 // ----------------------------------------------------------------------------
3 
4 // Check -time and -latestTime options
5 if (args.found("latestTime"))
6 {
7  startTime = Times.size() - 1;
8 }
9 else if (args.found("time"))
10 {
11  Foam::scalar timeValue = args.get<Foam::scalar>("time");
12 
13  startTime = Foam::Time::findClosestTimeIndex(Times, timeValue);
14 }
15 
16 
17 // ************************************************************************* //
static label findClosestTimeIndex(const UList< instant > &timeDirs, const scalar t, const word &constantDirName="constant")
Search instantList for the time index closest to the specified time.
Definition: TimePaths.C:176
T get(const label index) const
Get a value from the argument at index.
Definition: argListI.H:271
Foam::argList args(argc, argv)
Foam::label startTime
bool found(const word &optName) const
Return true if the named option is found.
Definition: argListI.H:171