26 #include "checkTools.H"
38 #include "PatchTools.H"
53 mesh.nInternalPoints(),
57 if (nInternalPoints != -Pstream::nProcs())
59 Info<<
" internal points: " << nInternalPoints <<
nl;
64 <<
"Some processors have their points sorted into internal"
65 <<
" and external and some do not." <<
endl
66 <<
"This can cause problems later on." <<
endl;
70 if (allTopology && nInternalPoints != -Pstream::nProcs())
75 mesh.nInternalEdges(),
80 mesh.nInternal1Edges(),
85 mesh.nInternal0Edges(),
89 Info<<
" edges: " << nEdges <<
nl
90 <<
" internal edges: " << nInternalEdges <<
nl
91 <<
" internal edges using one boundary point: "
92 << nInternal1Edges-nInternal0Edges <<
nl
93 <<
" internal edges using two boundary points: "
94 << nInternalEdges-nInternal1Edges <<
nl;
101 Info<<
" faces: " << nFaces <<
nl
102 <<
" internal faces: " << nIntFaces <<
nl
103 <<
" cells: " << nCells <<
nl
104 <<
" faces per cell: "
105 << scalar(nFaces + nIntFaces)/
max(1, nCells) <<
nl
106 <<
" boundary patches: " <<
mesh.boundaryMesh().size() <<
nl
107 <<
" point zones: " <<
mesh.pointZones().size() <<
nl
108 <<
" face zones: " <<
mesh.faceZones().size() <<
nl
109 <<
" cell zones: " <<
mesh.cellZones().size() <<
nl
117 tetWedgeMatcher tetWedge;
129 Map<label> polyhedralFaces;
131 for (
label cellI = 0; cellI <
mesh.nCells(); cellI++)
137 else if (tet.isA(
mesh, cellI))
141 else if (pyr.isA(
mesh, cellI))
145 else if (prism.isA(
mesh, cellI))
149 else if (wedge.isA(
mesh, cellI))
153 else if (tetWedge.isA(
mesh, cellI))
160 polyhedralFaces(
mesh.cells()[cellI].size())++;
164 reduce(nHex,sumOp<label>());
165 reduce(nPrism,sumOp<label>());
166 reduce(nWedge,sumOp<label>());
167 reduce(nPyr,sumOp<label>());
168 reduce(nTetWedge,sumOp<label>());
169 reduce(nTet,sumOp<label>());
170 reduce(nUnknown,sumOp<label>());
172 Info<<
"Overall number of cells of each type:" <<
nl
173 <<
" hexahedra: " << nHex <<
nl
174 <<
" prisms: " << nPrism <<
nl
175 <<
" wedges: " << nWedge <<
nl
176 <<
" pyramids: " << nPyr <<
nl
177 <<
" tet wedges: " << nTetWedge <<
nl
178 <<
" tetrahedra: " << nTet <<
nl
179 <<
" polyhedra: " << nUnknown
184 Pstream::mapCombineGather(polyhedralFaces, plusEqOp<label>());
186 Info<<
" Breakdown of polyhedra by number of faces:" <<
nl
187 <<
" faces" <<
" number of cells" <<
endl;
189 const labelList sortedKeys = polyhedralFaces.sortedToc();
193 const label nFaces = sortedKeys[keyI];
196 << nFaces <<
" " << polyhedralFaces[nFaces] <<
nl;
206 const surfaceWriter& writer,
210 const polyMesh&
mesh = refCast<const polyMesh>(set.db());
214 IndirectList<face>(
mesh.faces(), set.sortedToc()),
218 const fileName outputDir
221 / (Pstream::parRun() ?
".." :
"")
223 /
mesh.pointsInstance()
228 if (Pstream::parRun())
232 const scalar tol = sampledSurfaces::mergeTol();
234 scalar mergeDim = tol *
mesh.bounds().mag();
240 PatchTools::gatherAndMerge
248 if (Pstream::master())
265 setPatch.localPoints(),
266 setPatch.localFaces()
274 const surfaceWriter& writer,
278 const polyMesh&
mesh = refCast<const polyMesh>(set.db());
279 const polyBoundaryMesh& pbm =
mesh.boundaryMesh();
283 PackedBoolList isInSet(
mesh.nCells());
286 isInSet[iter.key()] =
true;
293 const polyPatch& pp = pbm[patchI];
297 bndInSet[pp.start()+i-
mesh.nInternalFaces()] = isInSet[fc[i]];
300 syncTools::swapBoundaryFaceList(
mesh, bndInSet);
303 DynamicList<label> outsideFaces(3*set.size());
304 for (
label faceI = 0; faceI <
mesh.nInternalFaces(); faceI++)
306 bool ownVal = isInSet[
mesh.faceOwner()[faceI]];
307 bool neiVal = isInSet[
mesh.faceNeighbour()[faceI]];
309 if (ownVal != neiVal)
311 outsideFaces.append(faceI);
318 const polyPatch& pp = pbm[patchI];
324 label faceI = pp.start()+i;
326 bool neiVal = bndInSet[faceI-
mesh.nInternalFaces()];
327 if (isInSet[fc[i]] && !neiVal)
329 outsideFaces.append(faceI);
339 outsideFaces.append(pp.start()+i);
348 IndirectList<face>(
mesh.faces(), outsideFaces),
352 const fileName outputDir
355 / (Pstream::parRun() ?
".." :
"")
357 /
mesh.pointsInstance()
362 if (Pstream::parRun())
366 const scalar tol = sampledSurfaces::mergeTol();
368 scalar mergeDim = tol *
mesh.bounds().mag();
374 PatchTools::gatherAndMerge
382 if (Pstream::master())
399 setPatch.localPoints(),
400 setPatch.localFaces()