USERD_get_gold_variable_info.H
Go to the documentation of this file.
1 //======================================================================
2 // variable 1 - var[0] , i.e variables are zero based
3 //======================================================================
5 (
6  char **var_description,
7  char **var_filename,
8  int *var_type,
9  int *var_classify,
10  int *var_complex,
11  char **var_ifilename,
12  float *var_freq,
13  int *var_contran,
14  int *var_timeset
15 )
16 {
17 #ifdef ENSIGHTDEBUG
18  Info<< "Entering: USERD_get_gold_variable_info" << endl
19  << flush;
20 #endif
21 
23 
24  // scalars first ...
25  for (label n=0; n<offset; n++)
26  {
27  if (isScalar[var2field[n]])
28  {
29  var_type[n] = Z_SCALAR;
30  var_classify[n] = Z_PER_ELEM;
31  var_complex[n] = FALSE;
32  var_timeset[n] = 1;
33  strncpy
34  (
35  var_description[n],
36  fieldNames[var2field[n]].c_str(),
37  Z_BUFL
38  );
39  }
40  }
41 
42  // ... and then vectors
43  for (label n=0; n<offset; n++)
44  {
45  if (isVector[var2field[n]])
46  {
47  var_type[n] = Z_VECTOR;
48  var_classify[n] = Z_PER_ELEM;
49  var_complex[n] = FALSE;
50  var_timeset[n] = 1;
51  strncpy
52  (
53  var_description[n],
54  fieldNames[var2field[n]].c_str(),
55  Z_BUFL
56  );
57  }
58  }
59 
60  // ... and tensors (NB! all tensors are treated as asymmetric)
61  for (label n=0; n<offset; n++)
62  {
63  if (isTensor[var2field[n]])
64  {
65  var_type[n] = Z_TENSOR9;
66  var_classify[n] = Z_PER_ELEM;
67  var_complex[n] = FALSE;
68  var_timeset[n] = 1;
69  strncpy
70  (
71  var_description[n],
72  fieldNames[var2field[n]].c_str(),
73  Z_BUFL
74  );
75  }
76  }
77 
79  {
80 
82 
83  for (label n=0; n<Ns; n++)
84  {
85  var_type[offset + n] = Z_SCALAR;
86  var_classify[offset + n] = Z_PER_ELEM;
87  var_complex[offset + n] = FALSE;
88  var_timeset[offset + n] = 1;
90  strncpy
91  (
92  var_description[offset + n],
93  name.c_str(),
94  Z_BUFL
95  );
96  }
97 
99  {
100  var_type[offset + Ns + n] = Z_VECTOR;
101  var_classify[offset + Ns + n] = Z_PER_ELEM;
102  var_complex[offset + Ns + n] = FALSE;
103  var_timeset[offset + Ns + n] = 1;
105  strncpy
106  (
107  var_description[offset + Ns + n],
108  name.c_str(),
109  Z_BUFL
110  );
111  }
112  }
113 
114 #ifdef ENSIGHTDEBUG
115  Info<< "Leaving: USERD_get_gold_variable_info" << endl
116  << flush;
117 #endif
118 
119  return Z_OK;
120 }
label nPatches
Definition: readKivaGrid.H:402
static int Num_variables
Definition: globalFoam.H:20
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
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
void size(const label)
Override size to be inconsistent with allocated storage.
Definition: ListI.H:164
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
static List< word > lagrangianScalarNames
Definition: globalFoam.H:47
static int Numparts_available
Definition: globalFoam.H:13
static bool isVector[maxNames]
Definition: globalFoam.H:28
static List< word > fieldNames
Definition: globalFoam.H:46
static label nSprayVariables
Definition: globalFoam.H:24
int USERD_get_gold_variable_info(char **var_description, char **var_filename, int *var_type, int *var_classify, int *var_complex, char **var_ifilename, float *var_freq, int *var_contran, int *var_timeset)
static word parcelPrepend
Definition: globalFoam.H:38
static List< word > lagrangianVectorNames
Definition: globalFoam.H:48
static bool isTensor[maxNames]
Definition: globalFoam.H:29
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
Ostream & flush(Ostream &os)
Flush stream.
Definition: Ostream.H:243
messageStream Info
label n
static label var2field[maxNames]
Definition: globalFoam.H:49
static bool isScalar[maxNames]
Definition: globalFoam.H:27