59 Info<<
"Mesh " <<
mesh.name() <<
" stats" <<
nl;
70 if (minInt == -1 && maxInt > 0)
73 <<
"Some processors have their points sorted into internal"
74 <<
" and external and some do not." <<
endl
75 <<
" This can cause problems later on." <<
endl;
77 else if (minInt != -1)
82 mesh.nInternalPoints(),
85 Info<<
" internal points: " << nInternalPoints <<
nl;
88 if (allTopology && (minInt != -1))
93 mesh.nInternalEdges(),
98 mesh.nInternal1Edges(),
103 mesh.nInternal0Edges(),
107 Info<<
" edges: " << nEdges <<
nl
108 <<
" internal edges: " << nInternalEdges <<
nl
109 <<
" internal edges using one boundary point: "
110 << nInternal1Edges-nInternal0Edges <<
nl
111 <<
" internal edges using two boundary points: "
112 << nInternalEdges-nInternal1Edges <<
nl;
116 label nIntFaces =
returnReduce(
mesh.faceNeighbour().size(), sumOp<label>());
120 Info<<
" faces: " << nFaces <<
nl
121 <<
" internal faces: " << nIntFaces <<
nl
122 <<
" cells: " << nCells <<
nl
123 <<
" faces per cell: "
124 << (scalar(nFaces) + scalar(nIntFaces))/
max(1, nCells) <<
nl
125 <<
" boundary patches: ";
127 if (Pstream::parRun())
130 Info<<
mesh.boundaryMesh().nNonProcessor() <<
' '
138 Info<<
" point zones: " <<
mesh.pointZones().size() <<
nl
139 <<
" face zones: " <<
mesh.faceZones().size() <<
nl
140 <<
" cell zones: " <<
mesh.cellZones().size() <<
nl
146 tetWedgeMatcher tetWedge;
157 Map<label> polyhedralFaces;
159 for (label celli = 0; celli <
mesh.nCells(); celli++)
161 if (hexMatcher::test(
mesh, celli))
165 else if (tetMatcher::test(
mesh, celli))
169 else if (pyrMatcher::test(
mesh, celli))
173 else if (prism.isA(
mesh, celli))
177 else if (wedge.isA(
mesh, celli))
181 else if (tetWedge.isA(
mesh, celli))
188 polyhedralFaces(
mesh.cells()[celli].size())++;
192 reduce(nHex,sumOp<label>());
193 reduce(nPrism,sumOp<label>());
194 reduce(nWedge,sumOp<label>());
195 reduce(nPyr,sumOp<label>());
196 reduce(nTetWedge,sumOp<label>());
197 reduce(nTet,sumOp<label>());
198 reduce(nUnknown,sumOp<label>());
200 Info<<
"Overall number of cells of each type:" <<
nl
201 <<
" hexahedra: " << nHex <<
nl
202 <<
" prisms: " << nPrism <<
nl
203 <<
" wedges: " << nWedge <<
nl
204 <<
" pyramids: " << nPyr <<
nl
205 <<
" tet wedges: " << nTetWedge <<
nl
206 <<
" tetrahedra: " << nTet <<
nl
207 <<
" polyhedra: " << nUnknown
212 Pstream::mapCombineGather(polyhedralFaces, plusEqOp<label>());
214 Info<<
" Breakdown of polyhedra by number of faces:" <<
nl
215 <<
" faces" <<
" number of cells" <<
endl;
217 const labelList sortedKeys = polyhedralFaces.sortedToc();
221 const label nFaces = sortedKeys[keyi];
224 << nFaces <<
" " << polyhedralFaces[nFaces] <<
nl;
234 const polyMesh&
mesh,
238 const fileName& outputDir
241 if (Pstream::parRun())
245 autoPtr<globalIndex> globalPoints;
246 autoPtr<globalIndex> globalFaces;
252 setPatch.localFaces(),
253 setPatch.meshPoints(),
254 setPatch.meshPointMap(),
257 uniqueMeshPointLabels,
266 if (Pstream::master())
284 setPatch.localPoints(),
285 setPatch.localFaces(),
302 const polyMesh&
mesh = refCast<const polyMesh>(
set.db());
306 IndirectList<face>(
mesh.faces(),
set.sortedToc()),
312 set.time().globalPath()
313 / functionObject::outputPrefix
314 /
mesh.pointsInstance()
329 const polyMesh&
mesh = refCast<const polyMesh>(
set.db());
330 const polyBoundaryMesh& pbm =
mesh.boundaryMesh();
334 bitSet isInSet(
mesh.nCells());
335 for (
const label celli :
set)
344 const polyPatch& pp = pbm[patchi];
348 bndInSet[pp.start()+i-
mesh.nInternalFaces()] = isInSet[fc[i]];
351 syncTools::swapBoundaryFaceList(
mesh, bndInSet);
354 DynamicList<label> outsideFaces(3*
set.size());
355 for (label facei = 0; facei <
mesh.nInternalFaces(); facei++)
357 const bool ownVal = isInSet[
mesh.faceOwner()[facei]];
358 const bool neiVal = isInSet[
mesh.faceNeighbour()[facei]];
360 if (ownVal != neiVal)
362 outsideFaces.append(facei);
369 const polyPatch& pp = pbm[patchi];
375 label facei = pp.start()+i;
377 const bool neiVal = bndInSet[facei-
mesh.nInternalFaces()];
378 if (isInSet[fc[i]] && !neiVal)
380 outsideFaces.append(facei);
390 outsideFaces.append(pp.start()+i);
399 IndirectList<face>(
mesh.faces(), outsideFaces),
405 set.time().globalPath()
406 / functionObject::outputPrefix
407 /
mesh.pointsInstance()
418 const writer<scalar>&
writer,
422 const polyMesh&
mesh = refCast<const polyMesh>(
set.db());
427 if (Pstream::parRun())
433 globalIndex globalNumbering(
mesh.nPoints());
436 mergedIDs.setSize(mergedPts.size());
442 labelList myIDs(globalNumbering.toGlobal(setPointIDs));
444 if (Pstream::master())
448 SubList<point>(mergedPts, myPoints.size(), pOffset) = myPoints;
449 SubList<label>(mergedIDs, myIDs.size(), pOffset) = myIDs;
450 pOffset += myPoints.size();
453 for (
const int slave : Pstream::subProcs())
455 IPstream fromSlave(Pstream::commsTypes::scheduled, slave);
460 SubList<point>(mergedPts, slavePts.size(), pOffset) = slavePts;
461 SubList<label>(mergedIDs, slaveIDs.size(), pOffset) = slaveIDs;
462 pOffset += slaveIDs.size();
471 Pstream::commsTypes::scheduled,
473 myPoints.byteSize() + myIDs.byteSize()
475 toMaster << myPoints << myIDs;
480 mergedIDs =
set.sortedToc();
486 if (Pstream::master())
491 scalarPointIDs[i] = 1.0*mergedIDs[i];
494 coordSet
points(
set.name(),
"distance", mergedPts,
mag(mergedPts));
496 List<const scalarField*> flds(1, &scalarPointIDs);
504 set.time().globalPath()
505 / functionObject::outputPrefix
506 /
mesh.pointsInstance()
515 OFstream
os(outputFile);