initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / applications / utilities / postProcessing / graphics / ensightFoamReader / USERD_get_sol_times.H
blobdcc64822897df9246929b025bf1e64e61167673d
1 //======================================================================
2 // Negative values of the time is not allowed in EnSight.
3 // So for engines, where the time is CAD's we need to correct
4 // this so that all CAD's are positive. NN
5 //======================================================================
6 int USERD_get_sol_times
8     int timeset_number,
9     float *solution_times
12 #ifdef ENSIGHTDEBUG
13     Info<< "Entering: USERD_get_sol_times\n" << timeDirs << endl;
14 #endif
16     for (label n=0; n<Num_time_steps;n++)
17     {
18         solution_times[n] = timeDirs[n+1].value();
19     }
21     if (timeDirs[1].value() < 0)
22     {
23         scalar addCAD = 360.0;
24         while (timeDirs[1].value() + addCAD < 0.0)
25         {
26             addCAD += 360.0;
27         }
28         for (label n=0; n<Num_time_steps;n++)
29         {
30             solution_times[n] += addCAD;
32             Info << "Time[" << n << "] = " << timeDirs[n+1].value()
33                 << " was corrected to " << solution_times[n]  << endl;
34         }
36     }
38 #ifdef ENSIGHTDEBUG
39     Info<< "Leaving: USERD_get_sol_times" << endl;
40 #endif
42     return Z_OK;