63 const scalar maxNonOrtho
71 const scalar minTetQuality
75 const scalar maxConcave
83 const scalar maxIntSkew
87 const scalar maxBounSkew
91 const scalar minWeight
95 const scalar minVolRatio
103 const scalar minTriangleTwist
107 scalar minFaceFlatness = -1.0;
108 dict.
readIfPresent(
"minFaceFlatness", minFaceFlatness,
true);
113 label nWrongFaces = 0;
115 Info<<
"Checking faces in error :" <<
endl;
118 if (maxNonOrtho < 180.0-small)
120 polyMeshGeometry::checkFaceDotProduct
134 Info<<
" non-orthogonality > " 135 <<
setw(3) << maxNonOrtho
137 << nNewWrongFaces-nWrongFaces <<
endl;
139 nWrongFaces = nNewWrongFaces;
144 polyMeshGeometry::checkFacePyramids
158 Info<<
" faces with face pyramid volume < " 159 <<
setw(5) << minVol <<
" : " 160 << nNewWrongFaces-nWrongFaces <<
endl;
162 nWrongFaces = nNewWrongFaces;
165 if (minTetQuality > -great)
167 polyMeshGeometry::checkFaceTets
182 Info<<
" faces with face-decomposition tet quality < " 183 <<
setw(5) << minTetQuality <<
" : " 184 << nNewWrongFaces-nWrongFaces <<
endl;
186 nWrongFaces = nNewWrongFaces;
189 if (maxConcave < 180.0-small)
191 polyMeshGeometry::checkFaceAngles
204 Info<<
" faces with concavity > " 205 <<
setw(3) << maxConcave
207 << nNewWrongFaces-nWrongFaces <<
endl;
209 nWrongFaces = nNewWrongFaces;
212 if (minArea > -small)
214 polyMeshGeometry::checkFaceArea
226 Info<<
" faces with area < " 227 <<
setw(5) << minArea
229 << nNewWrongFaces-nWrongFaces <<
endl;
231 nWrongFaces = nNewWrongFaces;
234 if (maxIntSkew > 0 || maxBounSkew > 0)
236 polyMeshGeometry::checkFaceSkewness
253 Info<<
" faces with skewness > " 254 <<
setw(3) << maxIntSkew
255 <<
" (internal) or " <<
setw(3) << maxBounSkew
256 <<
" (boundary) : " << nNewWrongFaces-nWrongFaces <<
endl;
258 nWrongFaces = nNewWrongFaces;
261 if (minWeight >= 0 && minWeight < 1)
263 polyMeshGeometry::checkFaceWeights
278 Info<<
" faces with interpolation weights (0..1) < " 279 <<
setw(5) << minWeight
281 << nNewWrongFaces-nWrongFaces <<
endl;
283 nWrongFaces = nNewWrongFaces;
286 if (minVolRatio >= 0)
288 polyMeshGeometry::checkVolRatio
301 Info<<
" faces with volume ratio of neighbour cells < " 302 <<
setw(5) << minVolRatio
304 << nNewWrongFaces-nWrongFaces <<
endl;
306 nWrongFaces = nNewWrongFaces;
313 polyMeshGeometry::checkFaceTwist
328 Info<<
" faces with face twist < " 329 <<
setw(5) << minTwist
331 << nNewWrongFaces-nWrongFaces <<
endl;
333 nWrongFaces = nNewWrongFaces;
336 if (minTriangleTwist > -1)
340 polyMeshGeometry::checkTriangleTwist
354 Info<<
" faces with triangle twist < " 355 <<
setw(5) << minTriangleTwist
357 << nNewWrongFaces-nWrongFaces <<
endl;
359 nWrongFaces = nNewWrongFaces;
362 if (minFaceFlatness > -small)
364 polyMeshGeometry::checkFaceFlatness
378 Info<<
" faces with flatness < " 379 <<
setw(5) << minFaceFlatness
381 << nNewWrongFaces-nWrongFaces <<
endl;
383 nWrongFaces = nNewWrongFaces;
388 polyMeshGeometry::checkCellDeterminant
395 polyMeshGeometry::affectedCells(mesh, checkFaces),
401 Info<<
" faces on cells with determinant < " 402 <<
setw(5) << minDet <<
" : " 403 << nNewWrongFaces-nWrongFaces <<
endl;
405 nWrongFaces = nNewWrongFaces;
410 return nWrongFaces > 0;
465 const scalar maxNonOrtho
473 const scalar minTetQuality
477 const scalar maxConcave
493 const scalar minWeight
497 const scalar minVolRatio
501 const scalar minTwist
505 const scalar minTriangleTwist
509 scalar minFaceFlatness = -1.0;
510 dict.
readIfPresent(
"minFaceFlatness", minFaceFlatness,
true);
516 label nWrongFaces = 0;
518 Info<<
"Checking faces in error :" <<
endl;
521 if (maxNonOrtho < 180.0-small)
534 Info<<
" non-orthogonality > " 535 <<
setw(3) << maxNonOrtho
537 << nNewWrongFaces-nWrongFaces <<
endl;
539 nWrongFaces = nNewWrongFaces;
556 Info<<
" faces with face pyramid volume < " 557 <<
setw(5) << minVol <<
" : " 558 << nNewWrongFaces-nWrongFaces <<
endl;
560 nWrongFaces = nNewWrongFaces;
563 if (minTetQuality > -great)
577 Info<<
" faces with face-decomposition tet quality < " 578 <<
setw(5) << minTetQuality <<
" : " 579 << nNewWrongFaces-nWrongFaces <<
endl;
581 nWrongFaces = nNewWrongFaces;
584 if (maxConcave < 180.0-small)
597 Info<<
" faces with concavity > " 598 <<
setw(3) << maxConcave
600 << nNewWrongFaces-nWrongFaces <<
endl;
602 nWrongFaces = nNewWrongFaces;
605 if (minArea > -small)
607 meshGeom.
checkFaceArea(report, minArea, checkFaces, &wrongFaces);
611 Info<<
" faces with area < " 612 <<
setw(5) << minArea
614 << nNewWrongFaces-nWrongFaces <<
endl;
616 nWrongFaces = nNewWrongFaces;
644 if (minWeight >= 0 && minWeight < 1)
657 Info<<
" faces with interpolation weights (0..1) < " 658 <<
setw(5) << minWeight
660 << nNewWrongFaces-nWrongFaces <<
endl;
662 nWrongFaces = nNewWrongFaces;
665 if (minVolRatio >= 0)
678 Info<<
" faces with volume ratio of neighbour cells < " 679 <<
setw(5) << minVolRatio
681 << nNewWrongFaces-nWrongFaces <<
endl;
683 nWrongFaces = nNewWrongFaces;
701 Info<<
" faces with face twist < " 702 <<
setw(5) << minTwist
704 << nNewWrongFaces-nWrongFaces <<
endl;
706 nWrongFaces = nNewWrongFaces;
709 if (minTriangleTwist > -1)
724 Info<<
" faces with triangle twist < " 725 <<
setw(5) << minTriangleTwist
727 << nNewWrongFaces-nWrongFaces <<
endl;
729 nWrongFaces = nNewWrongFaces;
732 if (minFaceFlatness > -1)
745 Info<<
" faces with flatness < " 746 <<
setw(5) << minFaceFlatness
748 << nNewWrongFaces-nWrongFaces <<
endl;
750 nWrongFaces = nNewWrongFaces;
766 Info<<
" faces on cells with determinant < " 767 <<
setw(5) << minDet <<
" : " 768 << nNewWrongFaces-nWrongFaces <<
endl;
770 nWrongFaces = nNewWrongFaces;
775 return nWrongFaces > 0;
static bool checkFacePyramids(const bool report, const scalar minPyrVol, const polyMesh &, const vectorField &cellCentres, const pointField &p, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet *)
See primitiveMesh.
static bool checkMesh(const bool report, const polyMesh &mesh, const dictionary &dict, labelHashSet &wrongFaces)
Check mesh with mesh settings in dict. Collects incorrect faces.
static bool checkFaceTets(const bool report, const scalar minPyrVol, const polyMesh &, const vectorField &cellCentres, const vectorField &faceCentres, const pointField &p, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet *)
See primitiveMesh.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
static bool checkTriangleTwist(const bool report, const scalar minTwist, const polyMesh &, const vectorField &faceAreas, const vectorField &faceCentres, const pointField &p, const labelList &checkFaces, labelHashSet *setPtr)
Consecutive triangle (from face-centre decomposition) normals.
A list of keyword definitions, which are a keyword followed by any number of values (e...
static bool checkFaceTwist(const bool report, const scalar minTwist, const polyMesh &, const vectorField &cellCentres, const vectorField &faceAreas, const vectorField &faceCentres, const pointField &p, const labelList &checkFaces, labelHashSet *setPtr)
Triangle (from face-centre decomposition) normal v.s.
Ostream & endl(Ostream &os)
Add newline and flush stream.
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
static bool checkVolRatio(const bool report, const scalar warnRatio, const polyMesh &mesh, const scalarField &cellVolumes, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet *setPtr)
Cell volume ratio of neighbouring cells (1 for regular mesh)
static bool checkFaceFlatness(const bool report, const scalar minFlatness, const polyMesh &, const vectorField &faceAreas, const vectorField &faceCentres, const pointField &p, const labelList &checkFaces, labelHashSet *setPtr)
Area of faces v.s. sum of triangle areas.
label size() const
Return number of elements in table.
virtual const pointField & points() const
Return raw points.
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
Updateable mesh geometry and checking routines.
const vectorField & cellCentres() const
Istream and Ostream manipulators taking arguments.
static bool checkFaceArea(const bool report, const scalar minArea, const polyMesh &, const vectorField &faceAreas, const labelList &checkFaces, labelHashSet *setPtr)
Small faces.
const vectorField & faceCentres() const
static bool checkFaceAngles(const bool report, const scalar maxDeg, const polyMesh &mesh, const vectorField &faceAreas, const pointField &p, const labelList &checkFaces, labelHashSet *setPtr)
See primitiveMesh.
static bool checkFaceDotProduct(const bool report, const scalar orthWarn, const polyMesh &, const vectorField &cellCentres, const vectorField &faceAreas, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet *setPtr)
See primitiveMesh.
const vectorField & faceAreas() const
static labelList affectedCells(const polyMesh &, const labelList &changedFaces)
Helper function: get affected cells from faces.
static bool checkFaceWeights(const bool report, const scalar warnWeight, const polyMesh &mesh, const vectorField &cellCentres, const vectorField &faceCentres, const vectorField &faceAreas, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet *setPtr)
Interpolation weights (0.5 for regular mesh)
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
Mesh consisting of general polyhedral cells.
Omanip< int > setw(const int i)
static bool checkCellDeterminant(const bool report, const scalar minDet, const polyMesh &, const vectorField &faceAreas, const labelList &checkFaces, const labelList &affectedCells, labelHashSet *setPtr)
Area of internal faces v.s. boundary faces.
const polyMesh & mesh() const
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
const scalarField & cellVolumes() const