50 Info<<
"Mesh stats" << nl
56 mesh.nInternalPoints(),
60 if (nInternalPoints != -Pstream::nProcs())
62 Info<<
" internal points: " << nInternalPoints <<
nl;
64 if (
returnReduce(mesh.nInternalPoints(), minOp<label>()) == -1)
67 <<
"Some processors have their points sorted into internal" 68 <<
" and external and some do not." << endl
69 <<
"This can cause problems later on." <<
endl;
73 if (allTopology && nInternalPoints != -Pstream::nProcs())
78 mesh.nInternalEdges(),
83 mesh.nInternal1Edges(),
88 mesh.nInternal0Edges(),
92 Info<<
" edges: " << nEdges << nl
93 <<
" internal edges: " << nInternalEdges << nl
94 <<
" internal edges using one boundary point: " 95 << nInternal1Edges-nInternal0Edges << nl
96 <<
" internal edges using two boundary points: " 97 << nInternalEdges-nInternal1Edges <<
nl;
104 Info<<
" faces: " << nFaces << nl
105 <<
" internal faces: " << nIntFaces << nl
106 <<
" cells: " << nCells << nl
107 <<
" faces per cell: " 108 << scalar(nFaces + nIntFaces)/
max(1, nCells) << nl
109 <<
" boundary patches: " << mesh.boundaryMesh().size() << nl
110 <<
" point zones: " << mesh.pointZones().size() << nl
111 <<
" face zones: " << mesh.faceZones().size() << nl
112 <<
" cell zones: " << mesh.cellZones().size() << nl
120 tetWedgeMatcher tetWedge;
132 Map<label> polyhedralFaces;
134 for (
label celli = 0; celli < mesh.nCells(); celli++)
136 if (hex.isA(mesh, celli))
140 else if (tet.isA(mesh, celli))
144 else if (pyr.isA(mesh, celli))
148 else if (prism.isA(mesh, celli))
152 else if (wedge.isA(mesh, celli))
156 else if (tetWedge.isA(mesh, celli))
163 polyhedralFaces(mesh.cells()[celli].size())++;
167 reduce(nHex,sumOp<label>());
168 reduce(nPrism,sumOp<label>());
169 reduce(nWedge,sumOp<label>());
170 reduce(nPyr,sumOp<label>());
171 reduce(nTetWedge,sumOp<label>());
172 reduce(nTet,sumOp<label>());
173 reduce(nUnknown,sumOp<label>());
175 Info<<
"Overall number of cells of each type:" << nl
176 <<
" hexahedra: " << nHex << nl
177 <<
" prisms: " << nPrism << nl
178 <<
" wedges: " << nWedge << nl
179 <<
" pyramids: " << nPyr << nl
180 <<
" tet wedges: " << nTetWedge << nl
181 <<
" tetrahedra: " << nTet << nl
182 <<
" polyhedra: " << nUnknown
187 Pstream::mapCombineGather(polyhedralFaces, plusEqOp<label>());
189 Info<<
" Breakdown of polyhedra by number of faces:" << nl
190 <<
" faces" <<
" number of cells" <<
endl;
192 const labelList sortedKeys = polyhedralFaces.sortedToc();
196 const label nFaces = sortedKeys[keyI];
199 << nFaces <<
" " << polyhedralFaces[nFaces] <<
nl;
209 const polyMesh& mesh,
210 const surfaceWriter& writer,
213 const fileName& outputDir
216 if (Pstream::parRun())
220 autoPtr<globalIndex> globalPoints;
221 autoPtr<globalIndex> globalFaces;
227 setPatch.localFaces(),
228 setPatch.meshPoints(),
229 setPatch.meshPointMap(),
232 uniqueMeshPointLabels,
241 if (Pstream::master())
243 writer.write(outputDir, name, mergedPoints, mergedFaces);
252 setPatch.localPoints(),
253 setPatch.localFaces()
261 const surfaceWriter& writer,
265 const polyMesh& mesh = refCast<const polyMesh>(
set.db());
269 IndirectList<face>(mesh.faces(),
set.sortedToc()),
275 set.time().globalPath()
276 /functionObjects::writeFile::outputPrefix
277 /mesh.pointsInstance()
287 const surfaceWriter& writer,
291 const polyMesh& mesh = refCast<const polyMesh>(
set.db());
292 const polyBoundaryMesh& pbm = mesh.boundaryMesh();
296 PackedBoolList isInSet(mesh.nCells());
299 isInSet[iter.key()] =
true;
303 boolList bndInSet(mesh.nFaces()-mesh.nInternalFaces());
306 const polyPatch& pp = pbm[
patchi];
310 bndInSet[pp.start()+i-mesh.nInternalFaces()] = isInSet[fc[i]];
313 syncTools::swapBoundaryFaceList(mesh, bndInSet);
316 DynamicList<label> outsideFaces(3*
set.size());
317 for (
label facei = 0; facei < mesh.nInternalFaces(); facei++)
319 bool ownVal = isInSet[mesh.faceOwner()[facei]];
320 bool neiVal = isInSet[mesh.faceNeighbour()[facei]];
322 if (ownVal != neiVal)
324 outsideFaces.append(facei);
331 const polyPatch& pp = pbm[
patchi];
337 label facei = pp.start()+i;
339 bool neiVal = bndInSet[facei-mesh.nInternalFaces()];
340 if (isInSet[fc[i]] && !neiVal)
342 outsideFaces.append(facei);
352 outsideFaces.append(pp.start()+i);
361 IndirectList<face>(mesh.faces(), outsideFaces),
368 / (Pstream::parRun() ?
".." :
"")
370 / mesh.pointsInstance()
381 const setWriter& writer,
385 const polyMesh& mesh = refCast<const polyMesh>(
set.db());
390 if (Pstream::parRun())
396 globalIndex globalNumbering(mesh.nPoints());
399 mergedIDs.setSize(mergedPts.size());
404 pointField myPoints(mesh.points(), setPointIDs);
408 myIDs[i] = globalNumbering.toGlobal(setPointIDs[i]);
411 if (Pstream::master())
415 SubList<point>(mergedPts, myPoints.size(), pOffset) = myPoints;
416 SubList<label>(mergedIDs, myIDs.size(), pOffset) = myIDs;
417 pOffset += myPoints.size();
420 for (
int slave=1; slave<Pstream::nProcs(); slave++)
422 IPstream fromSlave(Pstream::commsTypes::scheduled, slave);
427 SubList<point>(mergedPts, slavePts.size(), pOffset) = slavePts;
428 SubList<label>(mergedIDs, slaveIDs.size(), pOffset) = slaveIDs;
429 pOffset += slaveIDs.size();
438 Pstream::commsTypes::scheduled,
440 myPoints.byteSize() + myIDs.byteSize()
442 toMaster << myPoints << myIDs;
447 mergedIDs =
set.sortedToc();
448 mergedPts =
pointField(mesh.points(), mergedIDs);
452 if (Pstream::master())
456 set.time().globalPath()
457 /functionObjects::writeFile::outputPrefix
458 /mesh.pointsInstance(),
460 coordSet(
false, word::null, mergedPts),
#define forAll(list, i)
Loop across all elements in list.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
IOstream & hex(IOstream &io)
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
void mergeAndWrite(const polyMesh &mesh, const surfaceWriter &setWriter, const word &name, const indirectPrimitivePatch setPatch, const fileName &outputDir)
Generate merged surface on master and write. Needs input patch.
Ostream & endl(Ostream &os)
Add newline and flush stream.
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
Foam::indirectPrimitivePatch.
List< bool > boolList
Bool container classes.
vectorField pointField
pointField is a vectorField.
List< scalar > scalarList
A List of scalars.
Smanip< ios_base::fmtflags > setf(const ios_base::fmtflags flags)
List< label > labelList
A List of labels.
volScalarField scalarField(fieldObject, mesh)
Istream and Ostream manipulators taking arguments.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
word name(const complex &)
Return a string representation of a complex.
void printMeshStats(const polyMesh &mesh, const bool allTopology)
void setSize(const label)
Reset size of List.
#define WarningInFunction
Report a warning using Foam::Warning.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
Omanip< int > setw(const int i)