Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / applications / utilities / postProcessing / graphics / ensightFoamReader / USERD_set_time_set_and_step.H
blob5459f67ba6b71e6e02ad04571aa2ba148050e92f
1 //======================================================================
2 void USERD_set_time_set_and_step
4     int timeset_number,
5     int time_step
8 #ifdef ENSIGHTDEBUG
9     Info<< "Entering: USERD_set_time_set_and_step" << endl << flush;
10 #endif
11     // update the global pointers and variables
12     // to the current time-step
14     // at exit time_step < 0
15     if (time_step >= 0)
16     {
17         Time& runTime = *runTimePtr;
18         Current_time_step = time_step;
19         // add 1, since the first timestep is 'constant'
21         if (time_step == 0)
22         {
23             runTime.setTime
24             (
25                 timeDirs[Current_time_step],
26                 Current_time_step
27             );
28         }
29         else
30         {
31             runTime.setTime
32             (
33                 timeDirs[Current_time_step + 1],
34                 Current_time_step + 1
35             );
36         }
38         meshPtr->readUpdate();
40         if (time_step == 0)
41         {
42             runTime.setTime
43             (
44                 timeDirs[Current_time_step + 1],
45                 Current_time_step + 1
46             );
47         }
49         if (Numparts_available > nPatches+1)
50         {
51             delete sprayPtr;
52             sprayPtr = new Cloud<passiveParticle>(*meshPtr);
53         }
54     }