FreeFOAM The Cross-Platform CFD Toolkit
setTimeIndex.H
Go to the documentation of this file.
1  instantList sourceTimes = runTimeSource.times();
2  label sourceTimeIndex = runTimeSource.timeIndex();
3  if (args.optionFound("sourceTime"))
4  {
5  if (args.option("sourceTime") == "latestTime")
6  {
7  sourceTimeIndex = sourceTimes.size() - 1;
8  }
9  else
10  {
11  sourceTimeIndex = Time::findClosestTimeIndex
12  (
14  args.optionRead<scalar>("sourceTime")
15  );
16  }
17  }
18  else
19  {
20  sourceTimeIndex = Time::findClosestTimeIndex
21  (
23  runTimeTarget.time().value()
24  );
25  }
26 
27  runTimeSource.setTime(sourceTimes[sourceTimeIndex], sourceTimeIndex);
28 
29  Info<< "\nSource time: " << runTimeSource.value()
30  << "\nTarget time: " << runTimeTarget.value()
31  << endl;
32 
33 // ************************ vim: set sw=4 sts=4 et: ************************ //