58 const scalar severeNonorthogonalityThreshold =
62 scalar minDDotS = great;
63 scalar sumDDotS = 0.0;
65 label severeNonOrth = 0;
66 label errorNonOrth = 0;
74 if (ortho[facei] < severeNonorthogonalityThreshold)
76 if (ortho[facei] > small)
97 if (isMasterFace[facei])
99 minDDotS =
min(minDDotS, ortho[facei]);
100 sumDDotS += ortho[facei];
117 Info<<
" Mesh non-orthogonality Max: "
125 if (severeNonOrth > 0)
127 Info<<
" *Number of severely non-orthogonal (> "
129 << severeNonOrth <<
"." <<
endl;
133 if (errorNonOrth > 0)
137 Info<<
" ***Number of non-orthogonality errors: "
138 << errorNonOrth <<
"." <<
endl;
147 Info<<
" Non-orthogonality check OK." <<
endl;
201 if (isMasterFace[facei])
215 Info<<
" ***Max skewness = " << maxSkew
216 <<
", " << nWarnSkew <<
" highly skew faces detected"
217 " which may impair the quality of the results"
227 Info<<
" Max skewness = " << maxSkew <<
" OK." <<
endl;
266 <<
"directions should contain 0 or 1 but is now " <<
directions
283 const face&
f = fcs[facei];
288 label p1 =
f.nextLabel(fp);
292 scalar magD =
mag(d);
294 if (magD > rootVSmall)
299 label nEmptyDirs = 0;
300 label nNonEmptyDirs = 0;
303 if (
mag(d[cmpt]) > 1
e-6)
320 else if (nEmptyDirs == 1)
323 if (nNonEmptyDirs > 0)
328 else if (nEmptyDirs > 1)
344 Info<<
" ***Number of edges not aligned with or perpendicular to "
345 <<
"non-empty directions: " << nErrorEdges <<
endl;
353 setPtr->
insert(iter.key()[0]);
354 setPtr->
insert(iter.key()[1]);
364 Info<<
" All edges aligned with or perpendicular to "
365 <<
"non-empty directions." <<
endl;
381 const scalar warnDet = 1
e-3;
398 label nErrorCells = 0;
399 scalar minDet =
min(cellDeterminant);
400 scalar sumDet =
sum(cellDeterminant);
402 forAll(cellDeterminant, celli)
404 if (cellDeterminant[celli] < warnDet)
424 Info<<
" Cell determinant (wellposedness) : minimum: " << minDet
425 <<
" average: " << sumDet/nSummed
434 Info<<
" ***Cells with small determinant (< "
435 << warnDet <<
") found, number of cells: "
436 << nErrorCells <<
endl;
445 Info<<
" Cell determinant check OK." <<
endl;
458 const scalar minWeight,
481 label nErrorFaces = 0;
482 scalar minDet = great;
491 if (faceWght[facei] < minWeight)
503 if (isMasterFace[facei])
505 minDet =
min(minDet, faceWght[facei]);
506 sumDet += faceWght[facei];
520 Info<<
" Face interpolation weight : minimum: " << minDet
521 <<
" average: " << sumDet/nSummed
530 Info<<
" ***Faces with small interpolation weight (< " << minWeight
531 <<
") found, number of faces: "
532 << nErrorFaces <<
endl;
541 Info<<
" Face interpolation weight check OK." <<
endl;
554 const scalar minRatio,
569 label nErrorFaces = 0;
570 scalar minDet = great;
579 if (volRatio[facei] < minRatio)
591 if (isMasterFace[facei])
593 minDet =
min(minDet, volRatio[facei]);
594 sumDet += volRatio[facei];
608 Info<<
" Face volume ratio : minimum: " << minDet
609 <<
" average: " << sumDet/nSummed
618 Info<<
" ***Faces with small volume ratio (< " << minRatio
619 <<
") found, number of faces: "
620 << nErrorFaces <<
endl;
629 Info<<
" Face volume ratio check OK." <<
endl;
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
bool insert(const Key &key)
Insert a new entry.
label size() const
Return number of elements in table.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
void resize(const label newSize)
Resize the hash table for efficiency.
void size(const label)
Override size to be inconsistent with allocated storage.
static const direction nComponents
Number of components in this vector space.
Set of directions for each cell in the mesh. Either uniform and size=1 or one set of directions per c...
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
A face is a list of labels corresponding to mesh vertices.
virtual bool checkFaceSkewness(const bool report=false, labelHashSet *setPtr=nullptr) const
Check face skewness.
virtual bool checkFaceOrthogonality(const bool report=false, labelHashSet *setPtr=nullptr) const
Check non-orthogonality.
virtual bool checkEdgeAlignment(const bool report, const Vector< label > &directions, labelHashSet *setPtr) const
Check edge alignment for 1D/2D cases.
virtual bool checkFaceWeight(const bool report, const scalar minWeight=0.05, labelHashSet *setPtr=nullptr) const
Check for face weights.
virtual bool checkCellDeterminant(const bool report, labelHashSet *setPtr) const
virtual bool checkVolRatio(const bool report, const scalar minRatio=0.01, labelHashSet *setPtr=nullptr) const
Check for neighbouring cell volumes.
const vectorField & cellCentres() const
const vectorField & faceAreas() const
A class for managing temporary objects.
T & ref() const
Return non-const reference or generate a fatal error.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define InfoInFunction
Report an information message using Foam::Info.
scalar skewThreshold
Skewness warning threshold.
scalar nonOrthThreshold
Non-orthogonality warning threshold in deg.
errorManipArg< error, int > exit(error &err, const int errNo=1)
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.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
scalar radToDeg(const scalar rad)
Conversion from radians to degrees.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
dimensioned< scalar > mag(const dimensioned< Type > &)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
dimensionedScalar cos(const dimensionedScalar &ds)
dimensionedTensor skew(const dimensionedTensor &dt)
dimensionedScalar acos(const dimensionedScalar &ds)
scalar degToRad(const scalar deg)
Conversion from degrees to radians.
const scalarField & cellVols
Unit conversion functions.