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.found(
"minFaceFlatness")
81 ?
dict.lookup<scalar>(
"minFaceFlatness",
true)
86 dict.lookup<scalar>(
"minDeterminant",
true)
90 label nWrongFaces = 0;
92 Info<<
"Checking faces in error :" <<
endl;
94 if (maxNonOrtho <
degToRad(180.0)-small)
108 const label nNewWrongFaces =
111 Info<<
" non-orthogonality > "
114 << nNewWrongFaces - nWrongFaces <<
endl;
116 nWrongFaces = nNewWrongFaces;
135 const label nNewWrongFaces =
138 Info<<
" faces with face pyramid volume < "
139 <<
setw(5) << minVol <<
" : "
140 << nNewWrongFaces - nWrongFaces <<
endl;
142 nWrongFaces = nNewWrongFaces;
145 if (minTetQuality > -great)
160 const label nNewWrongFaces =
163 Info<<
" faces with face-decomposition tet quality < "
164 <<
setw(5) << minTetQuality <<
" : "
165 << nNewWrongFaces - nWrongFaces <<
endl;
167 nWrongFaces = nNewWrongFaces;
170 if (maxConcave <
degToRad(180.0)-small)
183 const label nNewWrongFaces =
186 Info<<
" faces with concavity > "
189 << nNewWrongFaces - nWrongFaces <<
endl;
191 nWrongFaces = nNewWrongFaces;
194 if (maxIntSkew > 0 || maxBounSkew > 0)
211 const label nNewWrongFaces =
214 Info<<
" faces with skewness > "
215 <<
setw(3) << maxIntSkew
216 <<
" (internal) or " <<
setw(3) << maxBounSkew
217 <<
" (boundary) : " << nNewWrongFaces - nWrongFaces <<
endl;
219 nWrongFaces = nNewWrongFaces;
222 if (minWeight >= 0 && minWeight < 1)
237 const label nNewWrongFaces =
240 Info<<
" faces with interpolation weights (0..1) < "
241 <<
setw(5) << minWeight
243 << nNewWrongFaces - nWrongFaces <<
endl;
245 nWrongFaces = nNewWrongFaces;
248 if (minVolRatio >= 0)
261 const label nNewWrongFaces =
264 Info<<
" faces with volume ratio of neighbour cells < "
265 <<
setw(5) << minVolRatio
267 << nNewWrongFaces - nWrongFaces <<
endl;
269 nWrongFaces = nNewWrongFaces;
287 const label nNewWrongFaces =
290 Info<<
" faces with face twist < "
291 <<
setw(5) << minTwist
293 << nNewWrongFaces - nWrongFaces <<
endl;
295 nWrongFaces = nNewWrongFaces;
298 if (minFaceFlatness > -small)
312 const label nNewWrongFaces =
315 Info<<
" faces with flatness < "
316 <<
setw(5) << minFaceFlatness
318 << nNewWrongFaces - nWrongFaces <<
endl;
320 nWrongFaces = nNewWrongFaces;
335 const label nNewWrongFaces =
338 Info<<
" faces on cells with determinant < "
339 <<
setw(5) << minDet <<
" : "
340 << nNewWrongFaces - nWrongFaces <<
endl;
342 nWrongFaces = nNewWrongFaces;
345 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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
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
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
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.
Omanip< int > setw(const int i)
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
void pow3(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
labelList identityMap(const label len)
Create identity map (map[i] == i) of given length.
const unitConversion unitDegrees