47 Info<<
"Mesh stats" << nl
53 mesh.nInternalPoints(),
57 if (nInternalPoints != -Pstream::nProcs())
59 Info<<
" internal points: " << nInternalPoints <<
nl;
61 if (
returnReduce(mesh.nInternalPoints(), minOp<label>()) == -1)
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++)
133 if (hex.isA(mesh, 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 polyMesh& mesh,
207 const surfaceWriter& writer,
210 const fileName& outputDir
213 if (Pstream::parRun())
217 autoPtr<globalIndex> globalPoints;
218 autoPtr<globalIndex> globalFaces;
224 setPatch.localFaces(),
225 setPatch.meshPoints(),
226 setPatch.meshPointMap(),
229 uniqueMeshPointLabels,
238 if (Pstream::master())
240 writer.write(outputDir, name, mergedPoints, mergedFaces);
249 setPatch.localPoints(),
250 setPatch.localFaces()
258 const surfaceWriter& writer,
262 const polyMesh& mesh = refCast<const polyMesh>(
set.db());
266 IndirectList<face>(mesh.faces(),
set.sortedToc()),
270 const fileName outputDir
273 / (Pstream::parRun() ?
".." :
"")
275 / mesh.pointsInstance()
285 const surfaceWriter& writer,
289 const polyMesh& mesh = refCast<const polyMesh>(
set.db());
290 const polyBoundaryMesh& pbm = mesh.boundaryMesh();
294 PackedBoolList isInSet(mesh.nCells());
297 isInSet[iter.key()] =
true;
301 boolList bndInSet(mesh.nFaces()-mesh.nInternalFaces());
304 const polyPatch& pp = pbm[
patchi];
308 bndInSet[pp.start()+i-mesh.nInternalFaces()] = isInSet[fc[i]];
311 syncTools::swapBoundaryFaceList(mesh, bndInSet);
314 DynamicList<label> outsideFaces(3*
set.size());
315 for (
label facei = 0; facei < mesh.nInternalFaces(); facei++)
317 bool ownVal = isInSet[mesh.faceOwner()[facei]];
318 bool neiVal = isInSet[mesh.faceNeighbour()[facei]];
320 if (ownVal != neiVal)
322 outsideFaces.append(facei);
329 const polyPatch& pp = pbm[
patchi];
335 label facei = pp.start()+i;
337 bool neiVal = bndInSet[facei-mesh.nInternalFaces()];
338 if (isInSet[fc[i]] && !neiVal)
340 outsideFaces.append(facei);
350 outsideFaces.append(pp.start()+i);
359 IndirectList<face>(mesh.faces(), outsideFaces),
363 const fileName outputDir
366 / (Pstream::parRun() ?
".." :
"")
368 / mesh.pointsInstance()
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
IOstream & hex(IOstream &io)
Ostream & endl(Ostream &os)
Add newline and flush stream.
PrimitivePatch< face, IndirectList, const pointField & > indirectPrimitivePatch
Foam::indirectPrimitivePatch.
List< bool > boolList
Bool container classes.
vectorField pointField
pointField is a vectorField.
Smanip< ios_base::fmtflags > setf(const ios_base::fmtflags flags)
List< label > labelList
A List of labels.
void mergeAndWrite(const polyMesh &mesh, const surfaceWriter &writer, const word &name, const indirectPrimitivePatch setPatch, const fileName &outputDir)
Generate merged surface on master and write. Needs input patch.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Istream and Ostream manipulators taking arguments.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
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)
#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)