63 const scalar maxNonOrtho
65 dict.
lookup<scalar>(
"maxNonOrtho",
true)
69 dict.
lookup<scalar>(
"minVol",
true)
71 const scalar minTetQuality
73 dict.
lookup<scalar>(
"minTetQuality",
true)
75 const scalar maxConcave
77 dict.
lookup<scalar>(
"maxConcave",
true)
81 dict.
lookup<scalar>(
"minArea",
true)
83 const scalar maxIntSkew
85 dict.
lookup<scalar>(
"maxInternalSkewness",
true)
87 const scalar maxBounSkew
89 dict.
lookup<scalar>(
"maxBoundarySkewness",
true)
91 const scalar minWeight
93 dict.
lookup<scalar>(
"minFaceWeight",
true)
95 const scalar minVolRatio
97 dict.
lookup<scalar>(
"minVolRatio",
true)
101 dict.
lookup<scalar>(
"minTwist",
true)
103 const scalar minTriangleTwist
105 dict.
lookup<scalar>(
"minTriangleTwist",
true)
107 scalar minFaceFlatness = -1.0;
108 dict.
readIfPresent(
"minFaceFlatness", minFaceFlatness,
true);
111 dict.
lookup<scalar>(
"minDeterminant",
true)
113 label nWrongFaces = 0;
115 Info<<
"Checking faces in error :" <<
endl;
118 if (maxNonOrtho < 180.0-small)
134 Info<<
" non-orthogonality > " 135 <<
setw(3) << maxNonOrtho
137 << nNewWrongFaces-nWrongFaces <<
endl;
139 nWrongFaces = nNewWrongFaces;
158 Info<<
" faces with face pyramid volume < " 159 <<
setw(5) << minVol <<
" : " 160 << nNewWrongFaces-nWrongFaces <<
endl;
162 nWrongFaces = nNewWrongFaces;
165 if (minTetQuality > -great)
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)
204 Info<<
" faces with concavity > " 205 <<
setw(3) << maxConcave
207 << nNewWrongFaces-nWrongFaces <<
endl;
209 nWrongFaces = nNewWrongFaces;
212 if (minArea > -small)
226 Info<<
" faces with area < " 227 <<
setw(5) << minArea
229 << nNewWrongFaces-nWrongFaces <<
endl;
231 nWrongFaces = nNewWrongFaces;
234 if (maxIntSkew > 0 || maxBounSkew > 0)
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)
278 Info<<
" faces with interpolation weights (0..1) < " 279 <<
setw(5) << minWeight
281 << nNewWrongFaces-nWrongFaces <<
endl;
283 nWrongFaces = nNewWrongFaces;
286 if (minVolRatio >= 0)
301 Info<<
" faces with volume ratio of neighbour cells < " 302 <<
setw(5) << minVolRatio
304 << nNewWrongFaces-nWrongFaces <<
endl;
306 nWrongFaces = nNewWrongFaces;
328 Info<<
" faces with face twist < " 329 <<
setw(5) << minTwist
331 << nNewWrongFaces-nWrongFaces <<
endl;
333 nWrongFaces = nNewWrongFaces;
336 if (minTriangleTwist > -1)
354 Info<<
" faces with triangle twist < " 355 <<
setw(5) << minTriangleTwist
357 << nNewWrongFaces-nWrongFaces <<
endl;
359 nWrongFaces = nNewWrongFaces;
362 if (minFaceFlatness > -small)
378 Info<<
" faces with flatness < " 379 <<
setw(5) << minFaceFlatness
381 << nNewWrongFaces-nWrongFaces <<
endl;
383 nWrongFaces = nNewWrongFaces;
400 Info<<
" faces on cells with determinant < " 401 <<
setw(5) << minDet <<
" : " 402 << nNewWrongFaces-nWrongFaces <<
endl;
404 nWrongFaces = nNewWrongFaces;
409 return nWrongFaces > 0;
static bool checkMesh(const bool report, const polyMesh &mesh, const dictionary &dict, labelHashSet &wrongFaces)
Check mesh with mesh settings in dict. Collects incorrect faces.
bool checkTriangleTwist(const bool report, const scalar minTwist, const polyMesh &, const vectorField &faceAreas, const vectorField &faceCentres, const pointField &p, const labelList &checkFaces, labelHashSet *setPtr)
Check consecutive face-triangle (from face-centre decomposition) normals.
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 checkFaceArea(const bool report, const scalar minArea, const polyMesh &, const vectorField &faceAreas, const labelList &checkFaces, labelHashSet *setPtr)
Check for small faces.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Ostream & endl(Ostream &os)
Add newline and flush stream.
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
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)
Check face non-orthogonality.
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)
Check face skewness.
label size() const
Return number of elements in table.
virtual const pointField & points() const
Return raw points.
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 *)
Check face tetrahedra volumes.
PolyMesh checking routines. Checks various criteria for a mesh and supplied geometry, with the mesh only used for topology. Coupled patch aware (i.e., coupled faces are treated as internal).
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
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)
const vectorField & cellCentres() const
bool checkFaceFlatness(const bool report, const scalar minFlatness, const polyMesh &, const vectorField &faceAreas, const vectorField &faceCentres, const pointField &p, const labelList &checkFaces, labelHashSet *setPtr)
Check for face areas v.s. sum of face-triangle (from face-centre.
Istream and Ostream manipulators taking arguments.
bool checkFaceAngles(const bool report, const scalar maxDeg, const polyMesh &mesh, const vectorField &faceAreas, const pointField &p, const labelList &checkFaces, labelHashSet *setPtr)
Check convexity of angles in a face. See primitiveMesh for explanation.
const vectorField & faceCentres() const
bool checkCellDeterminant(const bool report, const scalar minDet, const polyMesh &, const vectorField &faceAreas, const labelList &checkFaces, labelHashSet *setPtr)
Check the area of internal faces v.s. boundary faces.
bool checkFacePyramids(const bool report, const scalar minPyrVol, const polyMesh &, const vectorField &cellCentres, const pointField &p, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet *)
Check face pyramid volumes.
const vectorField & faceAreas() const
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
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)
Check interpolation weights (0.5 for regular mesh)
Mesh consisting of general polyhedral cells.
Omanip< int > setw(const int i)
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)
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
const scalarField & cellVolumes() const