FreeFOAM The Cross-Platform CFD Toolkit
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 
24  if (nVar < Num_variables - nSprayVariables)
25  {
26  Time& runTime = *runTimePtr;
27 
28  IOobject fieldObject
29  (
30  fieldNames[var2field[nVar]],
31  runTime.timeName(),
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 }
71 
72 
73 // ************************ vim: set sw=4 sts=4 et: ************************ //