USERD_get_var_by_component.H
Go to the documentation of this file.
2 (
3  int which_variable,
4  int which_part,
5  int var_type,
6  int which_type,
7  int imag_data,
8  int component,
9  float *var_array
10 )
11 {
12 #ifdef ENSIGHTDEBUG
13  Info<< "Entering: USERD_get_var_by_component" << endl
14  << "which_variable = " << which_variable << endl
15  << "which_part = " << which_part << endl
16  << "var_type = " << var_type << endl
17  << "which_type = " << which_type << endl
18  << "component = " << component << endl
19  << flush;
20 #endif
21 
22  label nVar = which_variable - 1;
23 
24  Time& runTime = *runTimePtr;
25 
26  fvMesh& mesh = *meshPtr;
27  const cellShapeList& cells = mesh.cellShapes();
28 
29  label nCells = cells.size();
30 
31  if (var_type == Z_SCALAR)
32  {
33  if (which_part == 1)
34  {
35  #include "getFieldScalar.H"
36  }
37  else if (which_part < nPatches+2)
38  {
39  #include "getPatchFieldScalar.H"
40  }
41  else if (which_part == nPatches+2)
42  {
43  #include "getLagrangianScalar.H"
44  }
45  else
46  {
47  return Z_ERR;
48  }
49  }
50  else if (var_type == Z_VECTOR)
51  {
52  if (which_part == 1)
53  {
54  #include "getFieldVector.H"
55  }
56  else if (which_part < nPatches+2)
57  {
58  #include "getPatchFieldVector.H"
59  }
60  else if (which_part == nPatches+2)
61  {
62  #include "getLagrangianVector.H"
63  }
64  else
65  {
66  return Z_ERR;
67  }
68 
69  }
70  else if (var_type == Z_TENSOR9)
71  {
72  // all tensor are treated as asymmetric tensors here
73 
74  if (which_part == 1)
75  {
76  #include "getFieldTensor.H"
77  }
78  else if (which_part < nPatches+2)
79  {
80  #include "getPatchFieldTensor.H"
81  }
82  else if (which_part == nPatches+2)
83  {
84  return Z_UNDEF;
85  }
86  else
87  {
88  return Z_ERR;
89  }
90 
91  }
92  else
93  {
94  return Z_UNDEF;
95  }
96 
97 #ifdef ENSIGHTDEBUG
98  Info<< "Leaving: USERD_get_var_by_component" << endl
99  << flush;
100 #endif
101 
102  return Z_OK;
103 }
label nPatches
Definition: readKivaGrid.H:402
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
static fvMesh * meshPtr
Definition: globalFoam.H:52
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
fvMesh & mesh
int USERD_get_var_by_component(int which_variable, int which_part, int var_type, int which_type, int imag_data, int component, float *var_array)
List< cellShape > cellShapeList
List of cellShapes and PtrList of List of cellShape.
Definition: cellShapeList.H:43
const cellShapeList & cells
static Time * runTimePtr
Definition: globalFoam.H:51
Ostream & flush(Ostream &os)
Flush stream.
Definition: Ostream.H:243
messageStream Info