USERD_get_part_coords.H
Go to the documentation of this file.
1 // Note: coord_array is 1-based.
2 
4 (
5  int part_number,
6  float **coord_array
7 )
8 {
9  #ifdef ENSIGHTDEBUG
10  Info<< "Entering: USERD_get_part_coords" << endl <<
11  "part_number = " << part_number << endl << flush;
12  #endif
13 
14  if (part_number == 1)
15  {
16  const vectorField& points = meshPtr->points();
17  label nPoints = points.size();
18 
19  for (label indx=0; indx<nPoints; indx++)
20  {
21  coord_array[0][indx+1] = float(points[indx].x());
22  coord_array[1][indx+1] = float(points[indx].y());
23  coord_array[2][indx+1] = float(points[indx].z());
24  }
25  }
26  else if (part_number < nPatches+2)
27  {
28  label patchi = part_number-2;
29  const polyBoundaryMesh& bMesh = meshPtr->boundaryMesh();
30  const vectorField& points = bMesh[patchi].points();
31  label nPoints = points.size();
32 
33  for (label indx=0; indx<nPoints; indx++)
34  {
35  coord_array[0][indx+1] = float(points[indx].x());
36  coord_array[1][indx+1] = float(points[indx].y());
37  coord_array[2][indx+1] = float(points[indx].z());
38  }
39 
40  }
41  else if (part_number == nPatches+2)
42  {
43  label indx = 1;
44 
45  forAllConstIter(Cloud<passiveParticle>, *sprayPtr, iter)
46  {
47  coord_array[0][indx] = float(iter().position().x());
48  coord_array[1][indx] = float(iter().position().y());
49  coord_array[2][indx] = float(iter().position().z());
50  indx++;
51  }
52 
53  }
54  else
55  {
56  return Z_ERR;
57  }
58 
59  #ifdef ENSIGHTDEBUG
60  Info<< "Leaving: USERD_get_part_coords" << endl << flush;
61  #endif
62 
63  return Z_OK;
64 }
label nPatches
Definition: readKivaGrid.H:402
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
static fvMesh * meshPtr
Definition: globalFoam.H:52
static Cloud< passiveParticle > * sprayPtr
Definition: globalFoam.H:53
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
volVectorField vectorField(fieldObject, mesh)
scalar y
const pointField & points
label nPoints
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Definition: pEqn.H:29
int USERD_get_part_coords(int part_number, float **coord_array)
label patchi
Ostream & flush(Ostream &os)
Flush stream.
Definition: Ostream.H:243
const polyBoundaryMesh & bMesh
messageStream Info