setTimeIndex.H
Go to the documentation of this file.
2  label sourceTimeIndex = runTimeSource.timeIndex();
3  if (args.found("sourceTime"))
4  {
5  if (args["sourceTime"] == "latestTime")
6  {
7  sourceTimeIndex = sourceTimes.size() - 1;
8  }
9  else
10  {
11  sourceTimeIndex = Time::findClosestTimeIndex
12  (
14  args.get<scalar>("sourceTime")
15  );
16  }
17  }
18  else
19  {
20  sourceTimeIndex = Time::findClosestTimeIndex
21  (
23  runTimeTarget.time().value()
24  );
25  }
26 
28 
29  Info<< "\nSource time: " << runTimeSource.value()
30  << "\nTarget time: " << runTimeTarget.value()
31  << endl;
List< instant > instantList
List of instants.
Definition: instantList.H:41
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:487
Time runTimeTarget(Time::controlDictName, args)
Time runTimeSource(Time::controlDictName, argsSrc)
instantList sourceTimes
Definition: setTimeIndex.H:1
T get(const label index) const
Get a value from the argument at index.
Definition: argListI.H:271
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::argList args(argc, argv)
label sourceTimeIndex
Definition: setTimeIndex.H:2
bool found(const word &optName) const
Return true if the named option is found.
Definition: argListI.H:171