USERD_get_var_value_at_specific.H
Go to the documentation of this file.
1 //======================================================================
3 (
4  int which_var,
5  int which_node_or_elem,
6  int which_part,
7  int which_elem_type,
8  int time_step,
9  float values[3],
10  int imag_data
11 )
12 {
13 #ifdef ENSIGHTDEBUG
14  Info<< "Entering: USERD_get_var_value_at_specific" << endl
15  << flush;
16 #endif
17  // Not sure if it is 0 or 1 based
18 
19  label nNode = which_node_or_elem;
20  label nVar = which_var - 1;
21 
22  fvMesh& mesh = *meshPtr;
23 
25  {
26  Time& runTime = *runTimePtr;
27 
28  IOobject fieldObject
29  (
31  runTime.name(),
32  mesh,
33  IOobject::MUST_READ,
34  IOobject::NO_WRITE
35  );
36 
37  if (isScalar[nVar])
38  {
40  values[0] = scalarField[nNode];
41  }
42  else if (isVector[nVar])
43  {
45  values[0] = vectorField[nNode].x();
46  values[1] = vectorField[nNode].y();
47  values[2] = vectorField[nNode].z();
48  }
49  else
50  {
51  Info<< "ERROR in USERD_get_variable_value_at_specific. "
52  << "No available variable???"
53  << endl;
54  return Z_ERR;
55  }
56  }
57  else
58  {
59  Info<< "This functionality is not implemented yet."
60  << endl;
61  return Z_ERR;
62  }
63 
64 
65 #ifdef ENSIGHTDEBUG
66  Info<< "Leaving: USERD_get_var_value_at_specific" << endl
67  << flush;
68 #endif
69  return Z_OK;
70 }
int USERD_get_var_value_at_specific(int which_var, int which_node_or_elem, int which_part, int which_elem_type, int time_step, float values[3], int imag_data)
IOobject fieldObject(fieldNames[var2field[nVar]], runTime.name(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE)
volScalarField scalarField(fieldObject, mesh)
volVectorField vectorField(fieldObject, mesh)
static int Num_variables
Definition: globalFoam.H:20
static Time * runTimePtr
Definition: globalFoam.H:51
static fvMesh * meshPtr
Definition: globalFoam.H:52
static label nSprayVariables
Definition: globalFoam.H:24
static bool isVector[maxNames]
Definition: globalFoam.H:28
static List< word > fieldNames
Definition: globalFoam.H:46
static bool isScalar[maxNames]
Definition: globalFoam.H:27
static label var2field[maxNames]
Definition: globalFoam.H:49
VolField< vector > volVectorField
Definition: volFieldsFwd.H:65
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
VolField< scalar > volScalarField
Definition: volFieldsFwd.H:64
Ostream & flush(Ostream &os)
Flush stream.
Definition: Ostream.H:249