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)
79 const scalar maxIntSkew
81 dict.
lookup<scalar>(
"maxInternalSkewness",
true)
83 const scalar maxBounSkew
85 dict.
lookup<scalar>(
"maxBoundarySkewness",
true)
87 const scalar minWeight
89 dict.
lookup<scalar>(
"minFaceWeight",
true)
91 const scalar minVolRatio
93 dict.
lookup<scalar>(
"minVolRatio",
true)
97 dict.
lookup<scalar>(
"minTwist",
true)
99 scalar minFaceFlatness = -1.0;
100 dict.
readIfPresent(
"minFaceFlatness", minFaceFlatness,
true);
103 dict.
lookup<scalar>(
"minDeterminant",
true)
105 label nWrongFaces = 0;
107 Info<<
"Checking faces in error :" <<
endl;
110 if (maxNonOrtho < 180.0-small)
126 Info<<
" non-orthogonality > " 127 <<
setw(3) << maxNonOrtho
129 << nNewWrongFaces-nWrongFaces <<
endl;
131 nWrongFaces = nNewWrongFaces;
152 Info<<
" faces with face pyramid volume < " 153 <<
setw(5) << minVol <<
" : " 154 << nNewWrongFaces-nWrongFaces <<
endl;
156 nWrongFaces = nNewWrongFaces;
159 if (minTetQuality > -great)
176 Info<<
" faces with face-decomposition tet quality < " 177 <<
setw(5) << minTetQuality <<
" : " 178 << nNewWrongFaces-nWrongFaces <<
endl;
180 nWrongFaces = nNewWrongFaces;
183 if (maxConcave < 180.0-small)
198 Info<<
" faces with concavity > " 199 <<
setw(3) << maxConcave
201 << nNewWrongFaces-nWrongFaces <<
endl;
203 nWrongFaces = nNewWrongFaces;
206 if (maxIntSkew > 0 || maxBounSkew > 0)
225 Info<<
" faces with skewness > " 226 <<
setw(3) << maxIntSkew
227 <<
" (internal) or " <<
setw(3) << maxBounSkew
228 <<
" (boundary) : " << nNewWrongFaces-nWrongFaces <<
endl;
230 nWrongFaces = nNewWrongFaces;
233 if (minWeight >= 0 && minWeight < 1)
250 Info<<
" faces with interpolation weights (0..1) < " 251 <<
setw(5) << minWeight
253 << nNewWrongFaces-nWrongFaces <<
endl;
255 nWrongFaces = nNewWrongFaces;
258 if (minVolRatio >= 0)
273 Info<<
" faces with volume ratio of neighbour cells < " 274 <<
setw(5) << minVolRatio
276 << nNewWrongFaces-nWrongFaces <<
endl;
278 nWrongFaces = nNewWrongFaces;
300 Info<<
" faces with face twist < " 301 <<
setw(5) << minTwist
303 << nNewWrongFaces-nWrongFaces <<
endl;
305 nWrongFaces = nNewWrongFaces;
308 if (minFaceFlatness > -small)
324 Info<<
" faces with flatness < " 325 <<
setw(5) << minFaceFlatness
327 << nNewWrongFaces-nWrongFaces <<
endl;
329 nWrongFaces = nNewWrongFaces;
346 Info<<
" faces on cells with determinant < " 347 <<
setw(5) << minDet <<
" : " 348 << nNewWrongFaces-nWrongFaces <<
endl;
350 nWrongFaces = nNewWrongFaces;
355 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.
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
dimensionedScalar pow3(const dimensionedScalar &ds)
const boundBox & bounds() const
Return mesh bounding box.
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)
scalar minDim() const
Smallest length/height/width dimension.
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