Go to the documentation of this file.
52 label nFaceErrors = 0;
53 label nCellErrors = 0;
64 "(const polyMeshGen&, const bool, labelHashSet*)"
65 ) <<
"Point " << pointI <<
" not used by any faces." <<
endl;
83 "(const polyMeshGen&, const bool, labelHashSet*)"
84 ) <<
"Point " << pointI <<
" not used by any cells." <<
endl;
96 if( nFaceErrors > 0 || nCellErrors > 0 )
101 "(const polyMeshGen&, const bool, labelHashSet*)"
102 ) <<
"Error in point usage detected: " << nFaceErrors
103 <<
" unused points found in the mesh. This mesh is invalid."
111 Info <<
"Point usage check OK.\n" <<
endl;
131 const label internal =
mesh.nInternalFaces();
133 labelList checkInternalFaces(
internal, -1);
141 for(
label faceI=0;faceI<
internal;++faceI)
143 if( own[faceI] >= nei[faceI] )
147 Pout<<
"bool checkUpperTriangular(const polyMeshGen&, "
148 <<
"const bool, labelHashSet*) : " <<
endl
150 <<
" has the owner label greater than neighbour:" <<
endl
151 << own[faceI] <<
tab << nei[faceI] <<
endl;
172 for(
label nSweeps=0;nSweeps<usedNbr.
size();++nSweeps)
180 const label neiI = cc(cellI, nbrI);
181 if( (neiI > cellI) && !usedNbr[nbrI] && (neiI < minNei) )
191 usedNbr[nextNei] =
true;
195 if( curFaces[faceI] <
internal )
197 if( nei[curFaces[faceI]] == cc(cellI, nextNei) )
199 checkInternalFaces[nChecks] = curFaces[faceI];
211 forAll(checkInternalFaces, faceI)
213 if( checkInternalFaces[faceI] != faceI )
217 Pout<<
"bool checkUpperTriangular(const polyMeshGen&, const bool"
218 <<
", labelHashSet*) : " <<
endl
219 <<
"face " << faceI <<
" out of position. Markup label: "
220 << checkInternalFaces[faceI] <<
". All subsequent faces will "
221 <<
"also be out of position. Please check the mesh manually."
237 "bool checkUpperTriangular(const polyMeshGen&, const bool"
239 ) <<
"Error in face ordering: faces not in upper triangular order!"
247 Info<<
"Upper triangular ordering OK.\n" <<
endl;
260 label nOpenCells = 0;
266 # pragma omp parallel for schedule(guided) reduction(+ : nOpenCells)
277 const face&
f = faces[
c[faceI]];
281 const edge e =
f.faceEdge(eI);
301 if( edgeUsage[edgeI] == 1 )
303 singleEdges.
append(cellEdges[edgeI]);
305 else if( edgeUsage[edgeI] != 2 )
309 "bool checkCellsZipUp(const polyMeshGen&,"
310 "const bool, labelHashSet*)"
311 ) <<
"edge " << cellEdges[edgeI] <<
" in cell " << cellI
312 <<
" used " << edgeUsage[edgeI] <<
" times. " <<
endl
313 <<
"Should be 1 or 2 - serious error in mesh structure"
319 # pragma omp critical
326 if( singleEdges.
size() > 0 )
330 Pout<<
"bool checkCellsZipUp(const polyMeshGen&, const bool"
331 <<
", labelHashSet*) : " <<
endl
332 <<
"Cell " << cellI <<
" has got " << singleEdges.
size()
333 <<
" unmatched edges: " << singleEdges <<
endl;
339 # pragma omp critical
354 "bool checkCellsZipUp(const polyMeshGen&,"
355 " const bool, labelHashSet*)"
357 <<
" open cells found. Please use the mesh zip-up tool. "
365 Info<<
"Topological cell zip-up check OK.\n" <<
endl;
382 label nErrorFaces = 0;
387 const face& curFace = faces[fI];
393 "bool checkFaceVertices("
394 "const polyMesgGen&, const bool, labelHashSet*)"
395 ) <<
"Face " << fI <<
" contains vertex labels out of range: "
396 << curFace <<
" Max point index = " <<
nPoints-1 <<
endl;
409 bool inserted = facePoints.
insert(curFace[fp]);
415 "bool checkFaceVertices("
416 "const polyMeshGen&, const bool, labelHashSet*)"
417 ) <<
"Face " << fI <<
" contains duplicate vertex labels: "
430 if( nErrorFaces > 0 )
434 "bool checkFaceVertices("
435 "const polyMeshGen&, const bool, labelHashSet*)"
436 ) <<
"const bool, labelHashSet*) const: "
437 << nErrorFaces <<
" faces with invalid vertex labels found"
445 Info<<
"Face vertices OK.\n" <<
endl;
#define forAll(list, i)
Loop across all elements in list.
A set of functions used for mesh checking mesh quality.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
bool checkUpperTriangular(const polyMeshGen &, const bool report=false, labelHashSet *setPtr=NULL)
Check face ordering.
Ostream & endl(Ostream &os)
Add newline and flush stream.
#define SeriousErrorIn(functionName)
Report an error message using Foam::SeriousError.
bool checkFaceVertices(const polyMeshGen &, const bool report=false, labelHashSet *setPtr=NULL)
Check uniqueness of face vertices.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool checkCellsZipUp(const polyMeshGen &, const bool report=false, labelHashSet *setPtr=NULL)
Check cell zip-up.
#define forAllRow(graph, rowI, index)
bool checkPoints(const polyMeshGen &, const bool report=false, labelHashSet *setPtr=NULL)
Check for unused points.
label sizeOfRow(const label rowI) const
Returns the number of elements in the given row.
const double e
Elementary charge.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
label containsAtPosition(const T &e) const
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...
bool insert(const Key &key)
Insert a new entry.
const dimensionedScalar c
Speed of light in a vacuum.
A face is a list of labels corresponding to mesh vertices.
#define WarningIn(functionName)
Report a warning using Foam::Warning.
void size(const label)
Override size to be inconsistent with allocated storage.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
Class to handle errors and exceptions in a simple, consistent stream-based manner.
void append(const T &e)
Append an element at the end of the list.
dimensionedScalar pos(const dimensionedScalar &ds)