62 if (minInt == -1 && maxInt > 0)
65 <<
"Some processors have their points sorted into internal"
66 <<
" and external and some do not." <<
endl
67 <<
" This can cause problems later on." <<
endl;
69 else if (minInt != -1)
74 mesh.nInternalPoints(),
77 Info<<
" internal points: " << nInternalPoints <<
nl;
80 if (allTopology && (minInt != -1))
85 mesh.nInternalEdges(),
90 mesh.nInternal1Edges(),
95 mesh.nInternal0Edges(),
99 Info<<
" edges: " << nEdges <<
nl
100 <<
" internal edges: " << nInternalEdges <<
nl
101 <<
" internal edges using one boundary point: "
102 << nInternal1Edges-nInternal0Edges <<
nl
103 <<
" internal edges using two boundary points: "
104 << nInternalEdges-nInternal1Edges <<
nl;
108 label nIntFaces =
returnReduce(
mesh.faceNeighbour().size(), sumOp<label>());
112 Info<<
" faces: " << nFaces <<
nl
113 <<
" internal faces: " << nIntFaces <<
nl
114 <<
" cells: " << nCells <<
nl
115 <<
" faces per cell: "
116 << (scalar(nFaces) + scalar(nIntFaces))/
max(1, nCells) <<
nl
117 <<
" boundary patches: ";
119 if (Pstream::parRun())
122 Info<<
mesh.boundaryMesh().nNonProcessor() <<
' '
130 Info<<
" point zones: " <<
mesh.pointZones().size() <<
nl
131 <<
" face zones: " <<
mesh.faceZones().size() <<
nl
132 <<
" cell zones: " <<
mesh.cellZones().size() <<
nl
140 tetWedgeMatcher tetWedge;
152 Map<label> polyhedralFaces;
154 for (label celli = 0; celli <
mesh.nCells(); celli++)
160 else if (tet.isA(
mesh, celli))
164 else if (pyr.isA(
mesh, celli))
168 else if (prism.isA(
mesh, celli))
172 else if (wedge.isA(
mesh, celli))
176 else if (tetWedge.isA(
mesh, celli))
183 polyhedralFaces(
mesh.cells()[celli].size())++;
187 reduce(nHex,sumOp<label>());
188 reduce(nPrism,sumOp<label>());
189 reduce(nWedge,sumOp<label>());
190 reduce(nPyr,sumOp<label>());
191 reduce(nTetWedge,sumOp<label>());
192 reduce(nTet,sumOp<label>());
193 reduce(nUnknown,sumOp<label>());
195 Info<<
"Overall number of cells of each type:" <<
nl
196 <<
" hexahedra: " << nHex <<
nl
197 <<
" prisms: " << nPrism <<
nl
198 <<
" wedges: " << nWedge <<
nl
199 <<
" pyramids: " << nPyr <<
nl
200 <<
" tet wedges: " << nTetWedge <<
nl
201 <<
" tetrahedra: " << nTet <<
nl
202 <<
" polyhedra: " << nUnknown
207 Pstream::mapCombineGather(polyhedralFaces, plusEqOp<label>());
209 Info<<
" Breakdown of polyhedra by number of faces:" <<
nl
210 <<
" faces" <<
" number of cells" <<
endl;
212 const labelList sortedKeys = polyhedralFaces.sortedToc();
216 const label nFaces = sortedKeys[keyi];
219 << nFaces <<
" " << polyhedralFaces[nFaces] <<
nl;
229 const polyMesh&
mesh,
230 surfaceWriter& writer,
233 const fileName& outputDir
236 if (Pstream::parRun())
240 autoPtr<globalIndex> globalPoints;
241 autoPtr<globalIndex> globalFaces;
247 setPatch.localFaces(),
248 setPatch.meshPoints(),
249 setPatch.meshPointMap(),
252 uniqueMeshPointLabels,
261 if (Pstream::master())
279 setPatch.localPoints(),
280 setPatch.localFaces(),
293 surfaceWriter& writer,
297 const polyMesh&
mesh = refCast<const polyMesh>(set.db());
301 IndirectList<face>(
mesh.faces(), set.sortedToc()),
307 set.time().globalPath()
308 / functionObject::outputPrefix
309 /
mesh.pointsInstance()
320 surfaceWriter& writer,
324 const polyMesh&
mesh = refCast<const polyMesh>(set.db());
325 const polyBoundaryMesh& pbm =
mesh.boundaryMesh();
329 bitSet isInSet(
mesh.nCells());
330 for (
const label celli : set)
339 const polyPatch& pp = pbm[patchi];
343 bndInSet[pp.start()+i-
mesh.nInternalFaces()] = isInSet[fc[i]];
346 syncTools::swapBoundaryFaceList(
mesh, bndInSet);
349 DynamicList<label> outsideFaces(3*set.size());
350 for (label facei = 0; facei <
mesh.nInternalFaces(); facei++)
352 const bool ownVal = isInSet[
mesh.faceOwner()[facei]];
353 const bool neiVal = isInSet[
mesh.faceNeighbour()[facei]];
355 if (ownVal != neiVal)
357 outsideFaces.append(facei);
364 const polyPatch& pp = pbm[patchi];
370 label facei = pp.start()+i;
372 const bool neiVal = bndInSet[facei-
mesh.nInternalFaces()];
373 if (isInSet[fc[i]] && !neiVal)
375 outsideFaces.append(facei);
385 outsideFaces.append(pp.start()+i);
394 IndirectList<face>(
mesh.faces(), outsideFaces),
400 set.time().globalPath()
401 / functionObject::outputPrefix
402 /
mesh.pointsInstance()
413 const writer<scalar>& writer,
417 const polyMesh&
mesh = refCast<const polyMesh>(set.db());
422 if (Pstream::parRun())
428 globalIndex globalNumbering(
mesh.nPoints());
431 mergedIDs.setSize(mergedPts.size());
437 labelList myIDs(globalNumbering.toGlobal(setPointIDs));
439 if (Pstream::master())
443 SubList<point>(mergedPts, myPoints.size(), pOffset) = myPoints;
444 SubList<label>(mergedIDs, myIDs.size(), pOffset) = myIDs;
445 pOffset += myPoints.size();
448 for (
int slave=1; slave<Pstream::nProcs(); slave++)
450 IPstream fromSlave(Pstream::commsTypes::scheduled, slave);
455 SubList<point>(mergedPts, slavePts.size(), pOffset) = slavePts;
456 SubList<label>(mergedIDs, slaveIDs.size(), pOffset) = slaveIDs;
457 pOffset += slaveIDs.size();
466 Pstream::commsTypes::scheduled,
468 myPoints.byteSize() + myIDs.byteSize()
470 toMaster << myPoints << myIDs;
475 mergedIDs = set.sortedToc();
481 if (Pstream::master())
486 scalarPointIDs[i] = 1.0*mergedIDs[i];
489 coordSet
points(set.name(),
"distance", mergedPts,
mag(mergedPts));
491 List<const scalarField*> flds(1, &scalarPointIDs);
499 set.time().globalPath()
500 / functionObject::outputPrefix
501 /
mesh.pointsInstance()
507 fileName outputFile(outputDir/writer.getFileName(
points,
wordList()));
510 OFstream os(outputFile);
512 writer.write(
points, fldNames, flds, os);