1 int USERD_get_part_elements_by_type
9 Info<< "Entering: USERD_get_part_elements_by_type" << nl
10 << "part_number = " << part_number << nl
11 << "element_type = " << element_type;
12 if (element_type == Z_HEX08)
16 else if (element_type == Z_PEN06)
20 else if (element_type == Z_PYR05)
24 else if (element_type == Z_TET04)
28 else if (element_type == Z_TRI03)
32 else if (element_type == Z_QUA04)
36 else if (element_type == Z_NFACED)
40 else if (element_type == Z_NSIDED)
48 Info << endl << flush;
53 const cellShapeList& cellShapes = meshPtr->cellShapes();
55 //================================
57 //================================
58 if (element_type == Z_HEX08)
60 const cellModel& hex = *(cellModeller::lookup("hex"));
63 forAll(cellShapes, celli)
65 const cellShape& cellShape = cellShapes[celli];
66 const cellModel& cellModel = cellShape.model();
72 conn_array[nHex08][ip] = cellShape[ip] + 1;
78 //================================
80 //================================
81 else if (element_type == Z_PEN06)
83 const cellModel& prism = *(cellModeller::lookup("prism"));
86 forAll(cellShapes, celli)
88 const cellShape& cellShape = cellShapes[celli];
89 const cellModel& cellModel = cellShape.model();
91 if (cellModel == prism)
95 conn_array[nPen06][ip] = cellShape[ip] + 1;
101 //================================
103 //================================
104 else if (element_type == Z_PYR05)
106 const cellModel& pyr = *(cellModeller::lookup("pyr"));
109 forAll(cellShapes, celli)
111 const cellShape& cellShape = cellShapes[celli];
112 const cellModel& cellModel = cellShape.model();
114 if (cellModel == pyr)
116 forAll(cellShape, ip)
118 conn_array[nPyr05][ip] = cellShape[ip] + 1;
124 //================================
126 //================================
127 else if (element_type == Z_TET04)
129 const cellModel& tet = *(cellModeller::lookup("tet"));
132 forAll(cellShapes, celli)
134 const cellShape& cellShape = cellShapes[celli];
135 const cellModel& cellModel = cellShape.model();
137 if (cellModel == tet)
139 forAll(cellShape, ip)
141 conn_array[nTet04][ip] = cellShape[ip] + 1;
147 //================================
149 //================================
152 label nCells = cellShapes.size();
154 const cellList cells = meshPtr->cells();
156 for (label n=0; n<nCells; n++)
158 label nFacesInCell = cells[n].size();
159 labelList points = cellShapes[n];
160 if ((nFacesInCell == 6) && (points.size() == 8))
162 else if ((nFacesInCell == 4) && (points.size() == 4))
164 else if (nFacesInCell == 5)
166 if (points.size() == 6)
168 else if (points.size() == 5)
172 conn_array[nFaced++][0] = nFacesInCell;
177 conn_array[nFaced++][0] = nFacesInCell;
182 else if (part_number < nPatches+2)
184 label patchi = part_number - 2;
185 const polyBoundaryMesh& bMesh = meshPtr->boundaryMesh();
189 if (element_type == Z_TRI03)
191 forAll(bMesh[patchi], n)
193 label nPoints = bMesh[patchi][n].size();
196 for(label i=0; i<nPoints; i++)
198 label ip = bMesh[patchi][n][i];
199 conn_array[nTri03][i] = ip + 1;
205 else if (element_type == Z_QUA04)
207 forAll(bMesh[patchi], n)
209 label nPoints = bMesh[patchi][n].size();
212 for(label i=0; i<nPoints; i++)
214 label ip = bMesh[patchi][n][i];
215 conn_array[nQuad04][i] = ip + 1;
222 else if (element_type == Z_NSIDED)
225 forAll(bMesh[patchi], n)
227 label nPoints = bMesh[patchi][n].size();
228 if ((nPoints != 3) && (nPoints != 4))
230 conn_array[nPoly++][0] = nPoints;
235 else if (part_number == nPatches+2)
237 for (label n=0; n<sprayPtr->size(); n++)
239 conn_array[n][0] = n + 1;
248 Info<< "Leaving: USERD_get_part_elements_by_type" << endl;