42 const scalar maxNonOrtho
48 dict.lookup<scalar>(
"minVol",
true)
50 const scalar minTetQuality
52 dict.lookup<scalar>(
"minTetQuality",
true)
54 const scalar maxConcave
58 const scalar maxIntSkew
60 dict.lookup<scalar>(
"maxInternalSkewness",
true)
62 const scalar maxBounSkew
64 dict.lookup<scalar>(
"maxBoundarySkewness",
true)
66 const scalar minWeight
68 dict.lookup<scalar>(
"minFaceWeight",
true)
70 const scalar minVolRatio
72 dict.lookup<scalar>(
"minVolRatio",
true)
76 dict.lookup<scalar>(
"minTwist",
true)
78 const scalar minFaceFlatness
80 dict.lookupOrDefault(
"minFaceFlatness", -1.0,
true)
84 dict.lookup<scalar>(
"minDeterminant",
true)
88 label nWrongFaces = 0;
90 Info<<
"Checking faces in error :" <<
endl;
92 if (maxNonOrtho <
degToRad(180.0)-small)
106 const label nNewWrongFaces =
109 Info<<
" non-orthogonality > "
112 << nNewWrongFaces - nWrongFaces <<
endl;
114 nWrongFaces = nNewWrongFaces;
133 const label nNewWrongFaces =
136 Info<<
" faces with face pyramid volume < "
137 <<
setw(5) << minVol <<
" : "
138 << nNewWrongFaces - nWrongFaces <<
endl;
140 nWrongFaces = nNewWrongFaces;
143 if (minTetQuality > -great)
158 const label nNewWrongFaces =
161 Info<<
" faces with face-decomposition tet quality < "
162 <<
setw(5) << minTetQuality <<
" : "
163 << nNewWrongFaces - nWrongFaces <<
endl;
165 nWrongFaces = nNewWrongFaces;
168 if (maxConcave <
degToRad(180.0)-small)
181 const label nNewWrongFaces =
184 Info<<
" faces with concavity > "
187 << nNewWrongFaces - nWrongFaces <<
endl;
189 nWrongFaces = nNewWrongFaces;
192 if (maxIntSkew > 0 || maxBounSkew > 0)
209 const label nNewWrongFaces =
212 Info<<
" faces with skewness > "
213 <<
setw(3) << maxIntSkew
214 <<
" (internal) or " <<
setw(3) << maxBounSkew
215 <<
" (boundary) : " << nNewWrongFaces - nWrongFaces <<
endl;
217 nWrongFaces = nNewWrongFaces;
220 if (minWeight >= 0 && minWeight < 1)
235 const label nNewWrongFaces =
238 Info<<
" faces with interpolation weights (0..1) < "
239 <<
setw(5) << minWeight
241 << nNewWrongFaces - nWrongFaces <<
endl;
243 nWrongFaces = nNewWrongFaces;
246 if (minVolRatio >= 0)
259 const label nNewWrongFaces =
262 Info<<
" faces with volume ratio of neighbour cells < "
263 <<
setw(5) << minVolRatio
265 << nNewWrongFaces - nWrongFaces <<
endl;
267 nWrongFaces = nNewWrongFaces;
285 const label nNewWrongFaces =
288 Info<<
" faces with face twist < "
289 <<
setw(5) << minTwist
291 << nNewWrongFaces - nWrongFaces <<
endl;
293 nWrongFaces = nNewWrongFaces;
296 if (minFaceFlatness > -small)
310 const label nNewWrongFaces =
313 Info<<
" faces with flatness < "
314 <<
setw(5) << minFaceFlatness
316 << nNewWrongFaces - nWrongFaces <<
endl;
318 nWrongFaces = nNewWrongFaces;
333 const label nNewWrongFaces =
336 Info<<
" faces on cells with determinant < "
337 <<
setw(5) << minDet <<
" : "
338 << nNewWrongFaces - nWrongFaces <<
endl;
340 nWrongFaces = nNewWrongFaces;
343 return nWrongFaces > 0;
Istream and Ostream manipulators taking arguments.
label size() const
Return number of elements in table.
scalar minDim() const
Smallest length/height/width dimension.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Mesh consisting of general polyhedral cells.
virtual const pointField & points() const
Return raw points.
const boundBox & bounds() const
Return mesh bounding box.
const vectorField & faceCentres() const
const scalarField & cellVolumes() const
const vectorField & cellCentres() const
const vectorField & faceAreas() const
Functions for checking mesh topology and geometry.
bool checkMesh(const bool report, const polyMesh &mesh, const dictionary &dict, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet &wrongFaces)
Check (subset of mesh including baffles) with mesh settings in dict.
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.
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)
Check the difference between normals of individual face-triangles (from.
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)
bool checkCellDeterminant(const polyMesh &mesh, const bool report, labelHashSet *setPtr)
bool checkFaceAngles(const bool report, const scalar maxConcave, 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.
bool checkVolRatio(const polyMesh &mesh, const bool report, const scalar minRatio=0.01, labelHashSet *setPtr=nullptr)
Check for neighbouring cell volumes.
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.
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.
bool checkFaceOrthogonality(const polyMesh &mesh, const scalar nonOrthThreshold, const bool report=false, labelHashSet *setPtr=nullptr)
Check face orthogonality.
bool checkFaceSkewness(const polyMesh &mesh, const scalar skewThreshold, const bool report=false, labelHashSet *setPtr=nullptr)
Check face skewness.
scalar radToDeg(const scalar rad)
Convert radians to degrees.
scalar degToRad(const scalar deg)
Convert degrees to radians.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar pow3(const dimensionedScalar &ds)
Omanip< int > setw(const int i)
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
labelList identityMap(const label len)
Create identity map (map[i] == i) of given length.
const unitConversion unitDegrees