setTimeIndex.H
Go to the documentation of this file.
1 {
4  if (args.optionFound("sourceTime"))
5  {
6  if (args["sourceTime"] == "latestTime")
7  {
8  sourceTimeIndex = sourceTimes.size() - 1;
9  }
10  else
11  {
12  sourceTimeIndex = Time::findClosestTimeIndex
13  (
15  args.optionRead<scalar>("sourceTime")
16  );
17  }
18  }
19  else
20  {
21  sourceTimeIndex = Time::findClosestTimeIndex
22  (
24  runTimeTarget.time().value()
25  );
26  }
27 
29 
30  Info<< "\nSource time: " << runTimeSource.value()
31  << "\nTarget time: " << runTimeTarget.value()
32  << endl;
33 }
sourceTimeIndex
label sourceTimeIndex
Definition: setTimeIndex.H:2
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::instantList
List< instant > instantList
List of instants.
Definition: instantList.H:42
sourceTimes
instantList sourceTimes
Definition: setTimeIndex.H:1
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::Info
messageStream Info
Foam::argList::optionRead
T optionRead(const word &opt) const
Read a value from the named option.
Definition: argListI.H:187
runTimeSource
Time runTimeSource(Time::controlDictName, argsSrc)
Foam::argList::optionFound
bool optionFound(const word &opt) const
Return true if the named option is found.
Definition: argListI.H:108
args
Foam::argList args(argc, argv)
runTimeTarget
Time runTimeTarget(Time::controlDictName, args)