Go to the documentation of this file.
44 const bool allTopology,
45 const bool allGeometry,
49 label noFailedChecks = 0;
51 Info<<
"Checking topology..." <<
endl;
54 mesh.boundaryMesh().checkDefinition(
true);
61 if (isA<emptyPolyPatch>(
mesh.boundaryMesh()[patchI]))
63 nEmpty +=
mesh.boundaryMesh()[patchI].size();
70 if (nTotCells && (nEmpty % nTotCells))
72 Info<<
" ***Total number of faces on empty patches"
73 <<
" is not divisible by the number of cells in the mesh."
74 <<
" Hence this mesh is not 1D or 2D."
80 mesh.boundaryMesh().checkParallelSync(
true);
83 mesh.cellZones().checkDefinition(
true);
84 if (
mesh.cellZones().checkParallelSync(
true))
88 mesh.faceZones().checkDefinition(
true);
89 if (
mesh.faceZones().checkParallelSync(
true))
93 mesh.pointZones().checkDefinition(
true);
94 if (
mesh.pointZones().checkParallelSync(
true))
105 const cell& cFaces =
mesh.cells()[cellI];
107 if (cFaces.
size() <= 3)
113 if (cFaces[i] < 0 || cFaces[i] >=
mesh.nFaces())
124 Info<<
" Illegal cells (less than 4 faces or out of range faces)"
125 <<
" found, number of cells: " << nCells <<
endl;
128 Info<<
" <<Writing " << nCells
129 <<
" illegal cells to set " <<
cells.name() <<
endl;
130 cells.instance() =
mesh.pointsInstance();
140 Info<<
" Cell to face addressing OK." <<
endl;
154 <<
" unused points to set " <<
points.name() <<
endl;
162 if (
mesh.checkUpperTriangular(
true, &faces))
171 Info<<
" <<Writing " << nFaces
172 <<
" unordered faces to set " << faces.
name() <<
endl;
184 if (
mesh.checkFaceVertices(
true, &faces))
190 Info<<
" <<Writing " << nFaces
191 <<
" faces with out-of-range or duplicate vertices to set "
211 Info<<
" <<Writing " << nCells
212 <<
" cells with over used edges to set " <<
cells.name()
214 cells.instance() =
mesh.pointsInstance();
227 if (
mesh.checkFaceFaces(
true, &faces))
235 Info<<
" <<Writing " << nFaces
236 <<
" faces with non-standard edge connectivity to set "
251 for (
label faceI = 0; faceI <
mesh.nInternalFaces(); faceI++)
253 nInternalFaces[
mesh.faceOwner()[faceI]]++;
254 nInternalFaces[
mesh.faceNeighbour()[faceI]]++;
265 nInternalFaces[owners[i]]++;
273 forAll(nInternalFaces, cellI)
275 if (nInternalFaces[cellI] <= 1)
279 else if (nInternalFaces[cellI] == 2)
289 Info<<
" <<Writing " << nOneCells
290 <<
" cells with zero or one non-boundary face to set "
305 Info<<
" <<Writing " << nTwoCells
306 <<
" cells with two non-boundary faces to set "
323 Info<<
" Number of regions: " << rs.
nRegions() <<
" (OK)."
331 Info<<
" The mesh has multiple regions which are not connected "
332 "by any face." <<
endl
333 <<
" <<Writing region information to "
334 <<
mesh.time().timeName()/
"cellToRegion"
342 mesh.time().timeName(),
365 faceI <
mesh.nFaces();
369 label regionI = rs[
mesh.faceOwner()[faceI]];
373 label& pRegion = pointToRegion[
f[fp]];
378 else if (pRegion == -2)
381 regionDisconnected[regionI] =
false;
383 else if (pRegion != regionI)
386 regionDisconnected[regionI] =
false;
387 regionDisconnected[pRegion] =
false;
393 Pstream::listCombineGather(regionDisconnected,
andEqOp<bool>());
394 Pstream::listCombineScatter(regionDisconnected);
417 cellRegions[rs[i]].insert(i);
422 Info<<
" <<Writing region " << i;
425 if (regionDisconnected[i])
427 Info<<
" (fully disconnected)";
431 Info<<
" (point connected)";
436 <<
" cells to cellSet " << cellRegions[i].name() <<
endl;
438 cellRegions[i].write();
445 if (!Pstream::parRun())
447 Info<<
"\nChecking patch topology for multiply connected"
448 <<
" surfaces..." <<
endl;
452 Info<<
"\nChecking basic patch addressing..." <<
endl;
469 <<
setw(20) <<
"Patch"
470 <<
setw(9) <<
"Faces"
471 <<
setw(9) <<
"Points";
472 if (!Pstream::parRun())
474 Info<<
setw(34) <<
"Surface topology";
478 Info<<
" Bounding box";
486 if (!isA<processorPolyPatch>(pp))
493 if (!Pstream::parRun())
501 else if (pTyp == primitivePatch::MANIFOLD)
506 <<
"multiply connected (shared point)";
510 Info<<
setw(34) <<
"ok (closed singly connected)";
520 if (pTyp == primitivePatch::OPEN)
523 <<
"ok (non-closed singly connected)";
528 <<
"multiply connected (shared edge)";
558 <<
" conflicting points to set "
577 mesh.faceNeighbour();
588 return noFailedChecks;
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const dimensionedScalar mp
Proton mass.
const Field< PointType > & points() const
Return reference to global points.
const point & max() const
Maximum describing the bounding box.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
#define forAll(list, i)
Loop across all elements in list.
virtual bool write() const
Write using setting from DB.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const fileName & instance() const
surfaceTopo surfaceType() const
Calculate surface type formed by patch.
Mesh consisting of general polyhedral cells.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
bool set(const label) const
Is element set.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
A patch is a list of labels that address the faces in the global face list.
Istream and Ostream manipulators taking arguments.
const word & name() const
Return name.
This class separates the mesh into distinct unconnected regions, each of which is then given a label ...
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
void mergeAndWrite(const surfaceWriter &, const faceSet &)
Write vtk representation of (assembled) faceSet to vtk file in.
label nRegions() const
Return total number of regions.
bool checkTopology(const bool report=false, labelHashSet *setPtr=NULL) const
Check surface formed by patch for manifoldness (see above).
const point & min() const
Minimum describing the bounding box.
label nPoints() const
Return number of points supporting patch faces.
label size() const
Return number of elements in table.
Base class for graphics format writing. Entry points are.
Omanip< int > setw(const int i)
A collection of cell labels.
surfaceTopo
Enumeration defining the surface type. Used in check routines.
ios_base::fmtflags setf(const ios_base::fmtflags f)
Set flags of stream.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
prefixOSstream Pout(cout, "Pout")
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
bool insert(const Key &key)
Insert a new entry.
A bounding box defined in terms of the points at its extremities.
A face is a list of labels corresponding to mesh vertices.
void size(const label)
Override size to be inconsistent with allocated storage.
const labelList & meshPoints() const
Return labelList of mesh points in patch.
bool checkPointManifold(const bool report=false, labelHashSet *setPtr=NULL) const
Checks primitivePatch for faces sharing point but not edge.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
const word & name() const
Return name.
A cell is defined as a list of faces with extra functionality.
word name(const complex &)
Return a string representation of a complex.
label checkTopology(const polyMesh &, const bool, const bool, const autoPtr< surfaceWriter > &)