OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

setTimeIndex.H

Go to the documentation of this file.
00001     instantList sourceTimes = runTimeSource.times();
00002     label sourceTimeIndex = runTimeSource.timeIndex();
00003     if (args.optionFound("sourceTime"))
00004     {
00005         if (args.option("sourceTime") == "latestTime")
00006         {
00007             sourceTimeIndex = sourceTimes.size() - 1;
00008         }
00009         else
00010         {
00011             sourceTimeIndex = Time::findClosestTimeIndex
00012             (
00013                 sourceTimes,
00014                 args.optionRead<scalar>("sourceTime")
00015             );
00016         }
00017     }
00018     else
00019     {
00020         sourceTimeIndex = Time::findClosestTimeIndex
00021         (
00022             sourceTimes,
00023             runTimeTarget.time().value()
00024         );
00025     }
Copyright © 2000-2009 OpenCFD Ltd