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. "
23  << "This can take some time." << endl;
24 
25  for (label timeI=1; timeI < timeDirs.size(); ++timeI)
26  {
27 
28  label nPen06 = 0;
29  label nHex08 = 0;
30  label nPyr05 = 0;
31  label nTet04 = 0;
32 
33  runTimePtr->setTime(timeDirs[timeI], timeI);
34 
35  Info<< "Checking time = " << runTimePtr->name() << endl;
36 
37  const cellShapeList& cells = meshPtr->cellShapes();
38 
39  const label nPoints = meshPtr->nPoints();
40  const label nCells = cells.size();
41 
42  maxNPoints = max(maxNPoints, nPoints);
43 
44  for (label n=0; n<nCells;n++)
45  {
46  label nFaces = cells[n].nFaces();
47  const labelList& points = cells[n];
48 
49  if ((nFaces == 6) && (points.size() == 8))
50  {
51  nHex08++;
52  }
53  else if ((nFaces == 5) && (points.size() == 6))
54  {
55  nPen06++;
56  }
57  else if ((nFaces == 5) && (points.size() == 5))
58  {
59  nPyr05++;
60  }
61  else if ((nFaces == 4) && (points.size() == 4))
62  {
63  nTet04++;
64  }
65  }
66 
67  nPen06Max = max(nPen06Max, nPen06);
68  nHex08Max = max(nHex08Max, nHex08);
69  nPyr05Max = max(nPyr05Max, nPyr05);
70  nTet04Max = max(nTet04Max, nTet04);
71 
72  if (Numparts_available > 1)
73  {
74  // Get the maximum number of spray parcels
75  // and store it
76  Cloud<passiveParticle> lagrangian(*meshPtr, cloud::defaultName);
77 
78  if (lagrangian.size() > nMaxParcels)
79  {
80  nMaxParcels = lagrangian.size();
81  }
82  }
83  }
84 
85  max_number_of_nodes[0] = maxNPoints;
86  max_number_of_elements[0][Z_HEX08] = nHex08Max;
87  max_number_of_elements[0][Z_PEN06] = nPen06Max;
88  max_number_of_elements[0][Z_PYR05] = nPyr05Max;
89  max_number_of_elements[0][Z_TET04] = nTet04Max;
90 
91  if (Numparts_available > 1)
92  {
93  max_number_of_nodes[1] = maxNParcels;
94  max_number_of_elements[1][Z_POINT] = maxNParcels;
95  }
96 
97 #ifdef ENSIGHTDEBUG
98  Info<< "Leaving: USERD_get_maxsize_info" << endl;
99 #endif
100 
101  return Z_OK;
102 }
label n
int USERD_get_maxsize_info(int *max_number_of_nodes, int *max_number_of_elements[Z_MAXTYPE], int *max_ijk_dimensions[3])
static int Numparts_available
Definition: globalFoam.H:13
static instantList timeDirs
Definition: globalFoam.H:44
static Time * runTimePtr
Definition: globalFoam.H:51
static label nMaxParcels
Definition: globalFoam.H:25
static fvMesh * meshPtr
Definition: globalFoam.H:52
const pointField & points
label nPoints
const cellShapeList & cells
List< cellShape > cellShapeList
List of cellShapes and PtrList of List of cellShape.
Definition: cellShapeList.H:43
List< label > labelList
A List of labels.
Definition: labelList.H:56
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
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)