Forward compatibility: flex
[foam-extend-3.2.git] / applications / utilities / postProcessing / graphics / newEnsightFoamReader / USERD_set_time_set_and_step.H
blob4c6f00e0c37edab1bd8b3639c20d79d9e1197420
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(TimeList[Current_time_step], Current_time_step);
24         }
25         else
26         {
27             runTime.setTime
28             (
29                 TimeList[Current_time_step + 1], Current_time_step + 1
30             );
31         }
33         meshPtr->readUpdate();
35         if (secondMeshPtr)
36         {
37             secondMeshPtr->readUpdate();
38         }
40         // fvMesh motion done via a meshObject.  HJ, 8/Aug/2011
41 //         if (faMeshPtr)
42 //         {
43 //             faMeshPtr->movePoints(meshPtr->points());
44 //         }
46         if (time_step == 0)
47         {
48             runTime.setTime
49             (
50                 TimeList[Current_time_step + 1], Current_time_step + 1
51             );
52         }
54 //         if (Numparts_available > nPatches+1)
55         if (sprayPtr)
56         {
57             delete sprayPtr;
58             sprayPtr = new Cloud<passiveParticle>(*meshPtr);
59         }
60     }