FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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     }
00026 
00027     runTimeSource.setTime(sourceTimes[sourceTimeIndex], sourceTimeIndex);
00028 
00029     Info<< "\nSource time: " << runTimeSource.value()
00030         << "\nTarget time: " << runTimeTarget.value()
00031         << endl;
00032 
00033 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines