USERD_get_sol_times.H
Go to the documentation of this file.
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 //======================================================================
7 (
8  int timeset_number,
9  float *solution_times
10 )
11 {
12 #ifdef ENSIGHTDEBUG
13  Info<< "Entering: USERD_get_sol_times\n" << timeDirs << endl;
14 #endif
15 
16  for (label n=0; n<Num_time_steps;n++)
17  {
18  solution_times[n] = timeDirs[n+1].value();
19  }
20 
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;
31 
32  Info<< "Time[" << n << "] = " << timeDirs[n+1].value()
33  << " was corrected to " << solution_times[n] << endl;
34  }
35 
36  }
37 
38 #ifdef ENSIGHTDEBUG
39  Info<< "Leaving: USERD_get_sol_times" << endl;
40 #endif
41 
42  return Z_OK;
43 }
label n
int USERD_get_sol_times(int timeset_number, float *solution_times)
static instantList timeDirs
Definition: globalFoam.H:44
static int Num_time_steps
Definition: globalFoam.H:18
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:257
messageStream Info