FreeFOAM The Cross-Platform CFD Toolkit
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 
10 #ifdef ENSIGHTDEBUG
11  Info << "Entering: USERD_get_part_coords" << endl <<
12  "part_number = " << part_number << endl << flush;
13 #endif
14 
15  if (part_number == 1)
16  {
17 
18  //# include "checkForNewMesh.H"
19 
20  const vectorField& points = meshPtr->points();
21  label nPoints = points.size();
22 
23  for (label indx=0; indx<nPoints; indx++)
24  {
25  coord_array[0][indx+1] = (float)points[indx].x();
26  coord_array[1][indx+1] = (float)points[indx].y();
27  coord_array[2][indx+1] = (float)points[indx].z();
28  }
29  }
30  else if (part_number < nPatches+2)
31  {
32 
33  //# include "checkForNewMesh.H"
34 
35  label patchi = part_number-2;
36  const polyBoundaryMesh& bMesh = meshPtr->boundaryMesh();
37  const vectorField& points = bMesh[patchi].points();
38  label nPoints = points.size();
39 
40  for (label indx=0; indx<nPoints; indx++)
41  {
42  coord_array[0][indx+1] = (float)points[indx].x();
43  coord_array[1][indx+1] = (float)points[indx].y();
44  coord_array[2][indx+1] = (float)points[indx].z();
45  }
46 
47  }
48  else if (part_number == nPatches+2)
49  {
50 
51  label indx = 1;
52 
53  for
54  (
55  Cloud<passiveParticle>::iterator elmnt = sprayPtr->begin();
56  elmnt != sprayPtr->end();
57  ++elmnt
58  )
59  {
60  coord_array[0][indx] = (float)elmnt().position().x();
61  coord_array[1][indx] = (float)elmnt().position().y();
62  coord_array[2][indx] = (float)elmnt().position().z();
63  indx++;
64  }
65 
66  }
67  else
68  {
69  return Z_ERR;
70  }
71 
72 #ifdef ENSIGHTDEBUG
73  Info << "Leaving: USERD_get_part_coords" << endl << flush;
74 #endif
75 
76  return Z_OK;
77 }
78 
79 // ************************ vim: set sw=4 sts=4 et: ************************ //