Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / applications / utilities / postProcessing / graphics / ensightFoamReader / USERD_get_gold_variable_info.H
blob1bf375cad76980e7dd69ff23f5f4648d7e649fb8
1 //======================================================================
2 //  variable 1 - var[0] , i.e variables are zero based
3 //======================================================================
4 int USERD_get_gold_variable_info
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
17 #ifdef ENSIGHTDEBUG
18     Info<< "Entering: USERD_get_gold_variable_info" << endl
19         << flush;
20 #endif
22     label offset = Num_variables - nSprayVariables;
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     }
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     }
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     }
78     if (Numparts_available > nPatches+1)
79     {
81         label Ns = lagrangianScalarNames.size();
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;
89             word name = parcelPrepend + lagrangianScalarNames[n];
90             strncpy
91             (
92                 var_description[offset + n],
93                 name.c_str(),
94                 Z_BUFL
95             );
96         }
98         forAll(lagrangianVectorNames, n)
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;
104             word name = parcelPrepend + lagrangianVectorNames[n];
105             strncpy
106             (
107                 var_description[offset + Ns + n],
108                 name.c_str(),
109                 Z_BUFL
110             );
111         }
112     }
114 #ifdef ENSIGHTDEBUG
115     Info<< "Leaving: USERD_get_gold_variable_info" << endl
116         << flush;
117 #endif
119     return Z_OK;