69 const scalar maxNonOrtho
77 const scalar minTetQuality
81 const scalar maxConcave
89 const scalar maxIntSkew
96 const scalar maxBounSkew
103 const scalar minWeight
107 const scalar minVolRatio
111 const scalar minTwist
115 const scalar minTriangleTwist
119 const scalar minFaceFlatness
137 if (errorMsg.size() || IOerrorMsg.size())
146 <<
"Missing/incorrect required dictionary entries:" <<
nl
148 << IOerrorMsg.c_str() <<
nl
149 << errorMsg.c_str() <<
nl
160 label nWrongFaces = 0;
162 Info<<
"Checking faces in error :" <<
endl;
165 if (maxNonOrtho < 180.0-SMALL)
181 Info<<
" non-orthogonality > "
182 <<
setw(3) << maxNonOrtho
184 << nNewWrongFaces-nWrongFaces <<
endl;
186 nWrongFaces = nNewWrongFaces;
205 Info<<
" faces with face pyramid volume < "
206 <<
setw(5) << minVol <<
" : "
207 << nNewWrongFaces-nWrongFaces <<
endl;
209 nWrongFaces = nNewWrongFaces;
212 if (minTetQuality > -GREAT)
229 Info<<
" faces with face-decomposition tet quality < "
230 <<
setw(5) << minTetQuality <<
" : "
231 << nNewWrongFaces-nWrongFaces <<
endl;
233 nWrongFaces = nNewWrongFaces;
236 if (maxConcave < 180.0-SMALL)
251 Info<<
" faces with concavity > "
252 <<
setw(3) << maxConcave
254 << nNewWrongFaces-nWrongFaces <<
endl;
256 nWrongFaces = nNewWrongFaces;
259 if (minArea > -SMALL)
273 Info<<
" faces with area < "
274 <<
setw(5) << minArea
276 << nNewWrongFaces-nWrongFaces <<
endl;
278 nWrongFaces = nNewWrongFaces;
281 if (maxIntSkew > 0 || maxBounSkew > 0)
300 Info<<
" faces with skewness > "
301 <<
setw(3) << maxIntSkew
302 <<
" (internal) or " <<
setw(3) << maxBounSkew
303 <<
" (boundary) : " << nNewWrongFaces-nWrongFaces <<
endl;
305 nWrongFaces = nNewWrongFaces;
308 if (minWeight >= 0 && minWeight < 1)
325 Info<<
" faces with interpolation weights (0..1) < "
326 <<
setw(5) << minWeight
328 << nNewWrongFaces-nWrongFaces <<
endl;
330 nWrongFaces = nNewWrongFaces;
333 if (minVolRatio >= 0)
348 Info<<
" faces with volume ratio of neighbour cells < "
349 <<
setw(5) << minVolRatio
351 << nNewWrongFaces-nWrongFaces <<
endl;
353 nWrongFaces = nNewWrongFaces;
375 Info<<
" faces with face twist < "
376 <<
setw(5) << minTwist
378 << nNewWrongFaces-nWrongFaces <<
endl;
380 nWrongFaces = nNewWrongFaces;
383 if (minTriangleTwist > -1)
401 Info<<
" faces with triangle twist < "
402 <<
setw(5) << minTriangleTwist
404 << nNewWrongFaces-nWrongFaces <<
endl;
406 nWrongFaces = nNewWrongFaces;
409 if (minFaceFlatness > -SMALL)
425 Info<<
" faces with flatness < "
426 <<
setw(5) << minFaceFlatness
428 << nNewWrongFaces-nWrongFaces <<
endl;
430 nWrongFaces = nNewWrongFaces;
448 Info<<
" faces on cells with determinant < "
449 <<
setw(5) << minDet <<
" : "
450 << nNewWrongFaces-nWrongFaces <<
endl;
452 nWrongFaces = nNewWrongFaces;
457 return nWrongFaces > 0;
520 const scalar maxNonOrtho
528 const scalar minTetQuality
532 const scalar maxConcave
540 const scalar maxIntSkew
544 const scalar maxBounSkew
548 const scalar minWeight
552 const scalar minVolRatio
556 const scalar minTwist
560 const scalar minTriangleTwist
564 scalar minFaceFlatness = -1.0;
581 if (errorMsg.size() || IOerrorMsg.size())
589 <<
"Missing/incorrect required dictionary entries:" <<
nl
591 << IOerrorMsg.c_str() <<
nl
592 << errorMsg.c_str() <<
nl
603 label nWrongFaces = 0;
605 Info<<
"Checking faces in error :" <<
endl;
608 if (maxNonOrtho < 180.0-SMALL)
621 Info<<
" non-orthogonality > "
622 <<
setw(3) << maxNonOrtho
624 << nNewWrongFaces-nWrongFaces <<
endl;
626 nWrongFaces = nNewWrongFaces;
643 Info<<
" faces with face pyramid volume < "
644 <<
setw(5) << minVol <<
" : "
645 << nNewWrongFaces-nWrongFaces <<
endl;
647 nWrongFaces = nNewWrongFaces;
650 if (minTetQuality > -GREAT)
664 Info<<
" faces with face-decomposition tet quality < "
665 <<
setw(5) << minTetQuality <<
" : "
666 << nNewWrongFaces-nWrongFaces <<
endl;
668 nWrongFaces = nNewWrongFaces;
671 if (maxConcave < 180.0-SMALL)
684 Info<<
" faces with concavity > "
685 <<
setw(3) << maxConcave
687 << nNewWrongFaces-nWrongFaces <<
endl;
689 nWrongFaces = nNewWrongFaces;
692 if (minArea > -SMALL)
704 Info<<
" faces with area < "
705 <<
setw(5) << minArea
707 << nNewWrongFaces-nWrongFaces <<
endl;
709 nWrongFaces = nNewWrongFaces;
712 if (maxIntSkew > 0 || maxBounSkew > 0)
731 Info<<
" faces with skewness > "
732 <<
setw(3) << maxIntSkew
733 <<
" (internal) or " <<
setw(3) << maxBounSkew
734 <<
" (boundary) : " << nNewWrongFaces-nWrongFaces <<
endl;
736 nWrongFaces = nNewWrongFaces;
739 if (minWeight >= 0 && minWeight < 1)
752 Info<<
" faces with interpolation weights (0..1) < "
753 <<
setw(5) << minWeight
755 << nNewWrongFaces-nWrongFaces <<
endl;
757 nWrongFaces = nNewWrongFaces;
760 if (minVolRatio >= 0)
773 Info<<
" faces with volume ratio of neighbour cells < "
774 <<
setw(5) << minVolRatio
776 << nNewWrongFaces-nWrongFaces <<
endl;
778 nWrongFaces = nNewWrongFaces;
796 Info<<
" faces with face twist < "
797 <<
setw(5) << minTwist
799 << nNewWrongFaces-nWrongFaces <<
endl;
801 nWrongFaces = nNewWrongFaces;
804 if (minTriangleTwist > -1)
819 Info<<
" faces with triangle twist < "
820 <<
setw(5) << minTriangleTwist
822 << nNewWrongFaces-nWrongFaces <<
endl;
824 nWrongFaces = nNewWrongFaces;
827 if (minFaceFlatness > -SMALL)
840 Info<<
" faces with flatness < "
841 <<
setw(5) << minFaceFlatness
843 << nNewWrongFaces-nWrongFaces <<
endl;
845 nWrongFaces = nNewWrongFaces;
861 Info<<
" faces on cells with determinant < "
862 <<
setw(5) << minDet <<
" : "
863 << nNewWrongFaces-nWrongFaces <<
endl;
865 nWrongFaces = nNewWrongFaces;
870 return nWrongFaces > 0;
Istream and Ostream manipulators taking arguments.
label size() const noexcept
The number of elements in table.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
string message() const
The accumulated error message.
void clear() const
Clear any messages.
void checkMesh() const
Debug: Check coupled mesh for correctness.
const polyMesh & mesh() const
Reference to mesh.
static bool checkMesh(const bool report, const polyMesh &mesh, const dictionary &dict, labelHashSet &wrongFaces, const bool dryRun=false)
Check mesh with mesh settings in dict. Collects incorrect faces.
Updateable mesh geometry and checking routines.
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 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.
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.
static bool checkFaceSkewness(const bool report, const scalar internalSkew, const scalar boundarySkew, const polyMesh &mesh, const pointField &points, const vectorField &cellCentres, const vectorField &faceCentres, const vectorField &faceAreas, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet *setPtr)
See primitiveMesh.
const vectorField & faceAreas() const
const polyMesh & mesh() const
static bool checkFaceArea(const bool report, const scalar minArea, const polyMesh &, const vectorField &faceAreas, const labelList &checkFaces, labelHashSet *setPtr)
Small faces.
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.
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 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)
const vectorField & faceCentres() const
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 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.
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.
const vectorField & cellCentres() const
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.
static labelList affectedCells(const polyMesh &, const labelList &changedFaces)
Helper function: get affected cells from faces.
Mesh consisting of general polyhedral cells.
virtual const pointField & points() const
Return raw points.
const vectorField & faceCentres() const
const scalarField & cellVolumes() const
const vectorField & cellCentres() const
label nFaces() const noexcept
Number of mesh faces.
const vectorField & faceAreas() const
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
prefixOSstream Perr
OSstream wrapped stderr (std::cerr) with parallel prefix.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Omanip< int > setw(const int i)
Ostream & endl(Ostream &os)
Add newline and flush stream.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
constexpr char nl
The newline '\n' character (0x0a)