FreeFOAM The Cross-Platform CFD Toolkit
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 }
104 
105 // ************************ vim: set sw=4 sts=4 et: ************************ //