FreeFOAM The Cross-Platform CFD Toolkit
USERD_get_maxsize_info.H
Go to the documentation of this file.
2 (
3  int *max_number_of_nodes,
4  int *max_number_of_elements[Z_MAXTYPE],
5  int *max_ijk_dimensions[3]
6 )
7 {
8  return Z_ERR;
9 
10 #ifdef ENSIGHTDEBUG
11  Info << "Entering: USERD_get_maxsize_info" << endl;
12 #endif
13 
14  label maxNPoints = 0;
15  label maxNParcels = 0;
16 
17  label nPen06Max = 0;
18  label nHex08Max = 0;
19  label nPyr05Max = 0;
20  label nTet04Max = 0;
21 
22  Info<< "Checking all time steps for EnSight memory allocation purpose. This can take some time." << endl;
23 
24  for (label timeI=1; timeI < timeDirs.size(); ++timeI)
25  {
26 
27  label nPen06 = 0;
28  label nHex08 = 0;
29  label nPyr05 = 0;
30  label nTet04 = 0;
31 
32  runTimePtr->setTime(timeDirs[timeI], timeI);
33 
34  Info<< "Checking time = " << runTimePtr->timeName() << endl;
35 
36  const cellShapeList& cells = meshPtr->cellShapes();
37 
38  const label nPoints = meshPtr->nPoints();
39  const label nCells = cells.size();
40 
41  maxNPoints = max(maxNPoints, nPoints);
42 
43  for (label n=0; n<nCells;n++)
44  {
45  label nFaces = cells[n].nFaces();
46  const labelList& points = cells[n];
47 
48  if ((nFaces == 6) && (points.size() == 8))
49  {
50  nHex08++;
51  }
52  else if ((nFaces == 5) && (points.size() == 6))
53  {
54  nPen06++;
55  }
56  else if ((nFaces == 5) && (points.size() == 5))
57  {
58  nPyr05++;
59  }
60  else if ((nFaces == 4) && (points.size() == 4))
61  {
62  nTet04++;
63  }
64  }
65 
66  nPen06Max = max(nPen06Max, nPen06);
67  nHex08Max = max(nHex08Max, nHex08);
68  nPyr05Max = max(nPyr05Max, nPyr05);
69  nTet04Max = max(nTet04Max, nTet04);
70 
71  if (Numparts_available > 1)
72  {
73  // Get the maximum number of spray parcels
74  // and store it
75  Cloud<passiveParticle> lagrangian(*meshPtr);
76 
77  if (lagrangian.size() > nMaxParcels)
78  {
79  nMaxParcels = lagrangian.size();
80  }
81  }
82  }
83 
84  max_number_of_nodes[0] = maxNPoints;
85  max_number_of_elements[0][Z_HEX08] = nHex08Max;
86  max_number_of_elements[0][Z_PEN06] = nPen06Max;
87  max_number_of_elements[0][Z_PYR05] = nPyr05Max;
88  max_number_of_elements[0][Z_TET04] = nTet04Max;
89 
90  if (Numparts_available > 1)
91  {
92  max_number_of_nodes[1] = maxNParcels;
93  max_number_of_elements[1][Z_POINT] = maxNParcels;
94  }
95 
96 #ifdef ENSIGHTDEBUG
97  Info<< "Leaving: USERD_get_maxsize_info" << endl;
98 #endif
99 
100  return Z_OK;
101 }
102 
103 // ************************ vim: set sw=4 sts=4 et: ************************ //