12 List<wordList> allNames(Pstream::nProcs());
13 allNames[Pstream::myProcNo()] = names;
14 Pstream::gatherList(allNames);
15 Pstream::scatterList(allNames);
17 bool hasError =
false;
19 for (label procI = 1; procI < allNames.size(); procI++)
21 if (allNames[procI] != allNames[0])
25 Info<<
" ***Inconsistent zones across processors, "
26 "processor 0 has zones:" << allNames[0]
27 <<
", processor " << procI <<
" has zones:"
39 const bool allTopology,
40 const bool allGeometry
43 label noFailedChecks = 0;
45 Info<<
"Checking topology..." <<
endl;
48 mesh.boundaryMesh().checkDefinition(
true);
51 mesh.boundaryMesh().checkParallelSync(
true);
69 forAll(mesh.faceZones(), zoneI)
71 if (mesh.faceZones()[zoneI].checkParallelSync(
false))
73 Info<<
" ***FaceZone " << mesh.faceZones()[zoneI].name()
74 <<
" is not correctly synchronised"
75 <<
" across coupled boundaries."
76 <<
" (coupled faces are either not both "
77 <<
" present in set or have same flipmap)" <<
endl;
84 pointSet
points(mesh,
"unusedPoints", mesh.nPoints()/100);
85 if (mesh.checkPoints(
true, &
points))
91 Info<<
" <<Writing " << nPoints
92 <<
" unused points to set " <<
points.name() <<
endl;
98 faceSet faces(mesh,
"upperTriangularFace", mesh.nFaces()/100);
99 if (mesh.checkUpperTriangular(
true, &faces))
104 label nFaces =
returnReduce(faces.size(), sumOp<label>());
108 Info<<
" <<Writing " << nFaces
109 <<
" unordered faces to set " << faces.name() <<
endl;
116 cellSet
cells(mesh,
"zipUpCells", mesh.nCells()/100);
117 if (mesh.checkCellsZipUp(
true, &
cells))
123 Info<<
" <<Writing " << nCells
124 <<
" cells with over used edges to set " <<
cells.name()
131 faceSet faces(mesh,
"outOfRangeFaces", mesh.nFaces()/100);
132 if (mesh.checkFaceVertices(
true, &faces))
136 label nFaces =
returnReduce(faces.size(), sumOp<label>());
138 Info<<
" <<Writing " << nFaces
139 <<
" faces with out-of-range or duplicate vertices to set "
140 << faces.name() <<
endl;
147 faceSet faces(mesh,
"edgeFaces", mesh.nFaces()/100);
148 if (mesh.checkFaceFaces(
true, &faces))
152 label nFaces =
returnReduce(faces.size(), sumOp<label>());
154 Info<<
" <<Writing " << nFaces
155 <<
" faces with incorrect edges to set " << faces.name()
163 labelList nInternalFaces(mesh.nCells(), 0);
165 for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
167 nInternalFaces[mesh.faceOwner()[faceI]]++;
168 nInternalFaces[mesh.faceNeighbour()[faceI]]++;
170 const polyBoundaryMesh&
patches = mesh.boundaryMesh();
173 if (patches[patchI].coupled())
179 nInternalFaces[owners[i]]++;
184 cellSet oneCells(mesh,
"oneInternalFaceCells", mesh.nCells()/100);
185 cellSet twoCells(mesh,
"twoInternalFacesCells", mesh.nCells()/100);
187 forAll(nInternalFaces, cellI)
189 if (nInternalFaces[cellI] <= 1)
191 oneCells.insert(cellI);
193 else if (nInternalFaces[cellI] == 2)
195 twoCells.insert(cellI);
199 label nOneCells =
returnReduce(oneCells.size(), sumOp<label>());
203 Info<<
" <<Writing " << nOneCells
204 <<
" cells with with single non-boundary face to set "
210 label nTwoCells =
returnReduce(twoCells.size(), sumOp<label>());
214 Info<<
" <<Writing " << nTwoCells
215 <<
" cells with with single non-boundary face to set "
223 regionSplit rs(mesh);
225 if (rs.nRegions() == 1)
227 Info<<
" Number of regions: " << rs.nRegions() <<
" (OK)."
233 Info<<
" *Number of regions: " << rs.nRegions() <<
endl;
235 Info<<
" The mesh has multiple regions which are not connected "
236 "by any face." << endl
237 <<
" <<Writing region information to "
238 << mesh.time().timeName()/
"cellToRegion"
246 mesh.time().timeName(),
257 if (!Pstream::parRun())
259 Pout<<
"\nChecking patch topology for multiply connected surfaces ..."
262 const polyBoundaryMesh& patches = mesh.boundaryMesh();
275 <<
setw(20) <<
"Patch"
276 <<
setw(9) <<
"Faces"
277 <<
setw(9) <<
"Points"
278 <<
setw(34) <<
"Surface topology";
281 Pout<<
" Bounding box";
287 const polyPatch& pp = patches[patchI];
290 <<
setw(20) << pp.name()
291 <<
setw(9) << pp.size()
292 <<
setw(9) << pp.nPoints();
295 primitivePatch::surfaceTopo pTyp = pp.surfaceType();
301 else if (pTyp == primitivePatch::MANIFOLD)
303 if (pp.checkPointManifold(
true, &
points))
305 Pout<<
setw(34) <<
"multiply connected (shared point)";
309 Pout<<
setw(34) <<
"ok (closed singly connected)";
313 pp.checkTopology(
false, &
points);
317 pp.checkTopology(
false, &
points);
319 if (pTyp == primitivePatch::OPEN)
321 Pout<<
setw(34) <<
"ok (non-closed singly connected)";
325 Pout<<
setw(34) <<
"multiply connected (shared edge)";
339 bb.min() =
min(bb.min(), pts[mp[i]]);
340 bb.max() =
max(bb.max(), pts[mp[i]]);
342 reduce(bb.min(), minOp<vector>());
343 reduce(bb.max(), maxOp<vector>());
353 <<
" conflicting points to set "
371 mesh.faceNeighbour();
382 return noFailedChecks;