Go to the documentation of this file.
26 #include "primitiveMesh.H"
34 const Foam::debug::tolerancesSwitch
37 "primitiveMeshClosedThreshold",
41 const Foam::debug::tolerancesSwitch
44 "primitiveMeshAspectThreshold",
48 Foam::debug::tolerancesSwitch
51 "primitiveMeshNonOrthThreshold",
55 const Foam::debug::tolerancesSwitch
58 "primitiveMeshSkewThreshold",
62 Foam::debug::tolerancesSwitch
65 "primitiveMeshFaceAngleThreshold",
69 const Foam::debug::tolerancesSwitch
72 "primitiveMeshFaceFlatnessThreshold",
83 Info<<
"bool primitiveMesh::checkClosedBoundary("
84 <<
"const bool) const: "
85 <<
"checking whether the boundary is closed" <<
endl;
92 scalar sumMagClosedBoundary = 0;
98 sumClosed += areas[faceI];
99 sumMagClosedBoundary +=
mag(areas[faceI]);
105 vector openness = sumClosed/(sumMagClosedBoundary + VSMALL);
111 Info<<
" ***Boundary openness " << openness
113 <<
" possible hole in boundary description."
123 Info<<
" Boundary openness " << openness
143 Info<<
"bool primitiveMesh::checkClosedCells("
144 <<
"const bool, labelHashSet*, labelHashSet*) const: "
145 <<
"checking whether cells are closed" <<
endl;
151 label nErrorClosed = 0;
155 const cell& curCell =
c[cI];
157 if (
min(curCell) < 0 ||
max(curCell) > nFaces())
168 if (nErrorClosed > 0)
172 Info<<
" ***Cells with invalid face labels found, number of cells "
173 << nErrorClosed <<
endl;
184 label nErrorOwnNei = 0;
189 if (own[faceI] == nei[faceI])
193 setPtr->
insert(own[faceI]);
200 if (nErrorOwnNei > 0)
204 Info<<
" ***Faces declaring same cell as owner and neighbour "
205 <<
"found, number of faces "
206 << nErrorOwnNei <<
endl;
223 sumClosed[own[faceI]] += areas[faceI];
224 sumMagClosed[own[faceI]] +=
cmptMag(areas[faceI]);
230 sumClosed[nei[faceI]] -= areas[faceI];
231 sumMagClosed[nei[faceI]] +=
cmptMag(areas[faceI]);
235 scalar maxOpennessCell = 0;
238 scalar maxAspectRatio = 0;
245 scalar maxOpenness = 0;
252 mag(sumClosed[cellI][cmpt])
253 /(sumMagClosed[cellI][cmpt] + VSMALL)
257 maxOpennessCell =
max(maxOpennessCell, maxOpenness);
259 if (maxOpenness > closedThreshold_())
271 scalar aspectRatio =
max
274 /(
cmptMin(sumMagClosed[cellI]) + VSMALL),
275 1.0/6.0*
cmptSum(sumMagClosed[cellI])/
279 maxAspectRatio =
max(maxAspectRatio, aspectRatio);
281 if (aspectRatio > aspectThreshold_())
285 aspectSetPtr->
insert(cellI);
303 Info<<
" ***Open cells found, max cell openness: "
304 << maxOpennessCell <<
", number of open cells " << nOpen
305 <<
" Threshold = " << closedThreshold_()
316 Info<<
" ***High aspect ratio cells found, Max aspect ratio: "
318 <<
", number of cells " << nAspect
319 <<
" Threshold = " << aspectThreshold_()
328 Info<<
" Max cell openness = " << maxOpennessCell <<
" OK." <<
nl
329 <<
" Max aspect ratio = " << maxAspectRatio <<
" OK."
345 Info<<
"bool primitiveMesh::checkFaceAreas("
346 <<
"const bool, labelHashSet*) const: "
347 <<
"checking face area magnitudes" <<
endl;
352 scalar minArea = GREAT;
353 scalar maxArea = -GREAT;
355 forAll (magFaceAreas, faceI)
357 if (magFaceAreas[faceI] < VSMALL)
365 minArea =
min(minArea, magFaceAreas[faceI]);
366 maxArea =
max(maxArea, magFaceAreas[faceI]);
372 if (minArea < VSMALL)
376 Info<<
" ***Zero or negative face area detected. "
377 "Minimum area: " << minArea <<
endl;
386 Info<<
" Minumum face area = " << minArea
387 <<
". Maximum face area = " << maxArea
388 <<
". Face area magnitudes OK." <<
endl;
404 Info<<
"bool primitiveMesh::checkCellVolumes("
405 <<
"const bool, labelHashSet*) const: "
406 <<
"checking cell volumes" <<
endl;
411 scalar minVolume = GREAT;
412 scalar maxVolume = -GREAT;
414 label nNegVolCells = 0;
418 if (vols[cellI] < VSMALL)
428 minVolume =
min(minVolume, vols[cellI]);
429 maxVolume =
max(maxVolume, vols[cellI]);
436 if (minVolume < VSMALL)
440 Info<<
" ***Zero or negative cell volume detected. "
441 <<
"Minimum negative volume: " << minVolume
442 <<
", Number of negative volume cells: " << nNegVolCells
452 Info<<
" Min volume = " << minVolume
453 <<
". Max volume = " << maxVolume
454 <<
". Total volume = " <<
gSum(vols)
455 <<
". Cell volumes OK." <<
endl;
471 Info<<
"bool primitiveMesh::checkFaceOrthogonality("
472 <<
"const bool, labelHashSet*) const: "
473 <<
"checking mesh non-orthogonality" <<
endl;
484 const scalar severeNonorthogonalityThreshold =
487 scalar minDDotS = GREAT;
491 label severeNonOrth = 0;
493 label errorNonOrth = 0;
497 vector d = centres[nei[faceI]] - centres[own[faceI]];
498 const vector&
s = areas[faceI];
500 scalar dDotS = (d &
s)/(
mag(d)*
mag(
s) + VSMALL);
502 if (dDotS < severeNonorthogonalityThreshold)
524 if (dDotS < minDDotS)
546 Info<<
" Mesh non-orthogonality Max: "
550 <<
" Threshold = " << nonOrthThreshold_()
555 if (severeNonOrth > 0)
557 Info<<
" *Number of severely non-orthogonal faces: "
558 << severeNonOrth <<
"." <<
endl;
562 if (errorNonOrth > 0)
566 Info<<
" ***Number of non-orthogonality errors: "
567 << errorNonOrth <<
"." <<
endl;
576 Info<<
" Non-orthogonality check OK." <<
endl;
587 const scalar minPyrVol,
593 Info<<
"bool primitiveMesh::checkFacePyramids("
594 <<
"const bool, const scalar, labelHashSet*) const: "
595 <<
"checking face orientation" <<
endl;
608 label nErrorPyrs = 0;
615 if (pyrVol > -minPyrVol)
625 if (isInternalFace(faceI))
631 if (pyrVol < minPyrVol)
649 Info<<
" ***Error in face pyramids: "
650 << nErrorPyrs <<
" faces are incorrectly oriented."
660 Info<<
" Face pyramids OK." <<
endl;
676 Info<<
"bool primitiveMesh::checkFaceSkewnesss("
677 <<
"const bool, labelHashSet*) const: "
678 <<
"checking face skewness" <<
endl;
698 vector Cpf = faceCtrs[faceI] - cellCtrs[own[faceI]];
699 vector d = cellCtrs[nei[faceI]] - cellCtrs[own[faceI]];
703 Cpf - ((fAreas[faceI] & Cpf)/((fAreas[faceI] & d) + SMALL))*d;
709 scalar fd = 0.2*
mag(d) + VSMALL;
710 const face&
f = fcs[faceI];
713 fd =
max(fd,
mag(svHat & (
p[
f[
pi]] - faceCtrs[faceI])));
717 scalar skewness =
mag(sv)/fd;
721 if (skewness > skewThreshold_())
731 if(skewness > maxSkew)
741 for (
label faceI = nInternalFaces(); faceI < nFaces(); faceI++)
743 vector Cpf = faceCtrs[faceI] - cellCtrs[own[faceI]];
751 vector sv = Cpf - ((fAreas[faceI]&Cpf)/((fAreas[faceI]&d)+VSMALL))*d;
757 scalar fd = 0.4*
mag(d) + VSMALL;
758 const face&
f = fcs[faceI];
761 fd =
max(fd,
mag(svHat & (
p[
f[
pi]] - faceCtrs[faceI])));
765 scalar skewness =
mag(sv)/fd;
769 if (skewness > skewThreshold_())
779 if(skewness > maxSkew)
793 Info<<
" ***Max skewness = " << maxSkew
794 <<
", " << nWarnSkew <<
" highly skew faces detected"
795 <<
" Threshold = " << skewThreshold_()
805 Info<<
" Max skewness = " << maxSkew <<
" OK." <<
endl;
821 Info<<
"bool primitiveMesh::checkPoints"
822 <<
"(const bool, labelHashSet*) const: "
823 <<
"checking points" <<
endl;
826 label nFaceErrors = 0;
827 label nCellErrors = 0;
833 if (pf[pointI].empty())
847 const labelList& pc = pointCells(pointI);
863 if (nFaceErrors > 0 || nCellErrors > 0)
867 Info<<
" ***Unused points found in the mesh, "
868 "number unused by faces: " << nFaceErrors
869 <<
" number unused by cells: " << nCellErrors
899 Info<<
"bool primitiveMesh::checkFaceAngles"
900 <<
"(const bool, labelHashSet*) const: "
901 <<
"checking face angles" <<
endl;
904 if (faceAngleThreshold_() < -SMALL || faceAngleThreshold_() > 180 + SMALL)
908 "primitiveMesh::checkFaceAngles(const bool, labelHashSet*)"
909 ) <<
"faceAngleThreshold_ should be [0..180] but is now "
910 << faceAngleThreshold_()
914 const scalar maxSin =
920 faceNormals /=
mag(faceNormals) + VSMALL;
922 scalar maxEdgeSin = 0.0;
926 label errorFaceI = -1;
930 const face&
f = fcs[faceI];
934 scalar magEPrev =
mag(ePrev);
935 ePrev /= magEPrev + VSMALL;
940 label fp1 =
f.fcIndex(fp0);
944 scalar magE10 =
mag(e10);
945 e10 /= magE10 + VSMALL;
947 if (magEPrev > SMALL && magE10 > SMALL)
949 vector edgeNormal = ePrev ^ e10;
950 scalar magEdgeNormal =
mag(edgeNormal);
952 if (magEdgeNormal < maxSin)
959 edgeNormal /= magEdgeNormal;
961 if ((edgeNormal & faceNormals[faceI]) < SMALL)
963 if (faceI != errorFaceI)
975 maxEdgeSin =
max(maxEdgeSin, magEdgeNormal);
990 scalar maxConcaveDegr =
996 Info<<
" *There are " << nConcave
997 <<
" faces with concave angles between consecutive"
998 <<
" edges. Max concave angle = " << maxConcaveDegr
999 <<
" degrees." <<
endl;
1006 if (debug || report)
1008 Info<<
" All angles in faces OK." <<
endl;
1027 Info<<
"bool primitiveMesh::checkFaceFlatness"
1028 <<
"(const bool, labelHashSet*) const: "
1029 <<
"checking face flatness" <<
endl;
1032 if (faceFlatnessThreshold_() < 0 || faceFlatnessThreshold_() > 1)
1036 "primitiveMesh::checkFaceFlatness"
1037 "(const bool, labelHashSet*)"
1038 ) <<
"faceFlatnessThreshold_ should be [0..1] but is now "
1039 << faceFlatnessThreshold_()
1054 scalar minFlatness = GREAT;
1055 scalar sumFlatness = 0;
1060 const face&
f = fcs[faceI];
1062 if (
f.
size() > 3 && magAreas[faceI] > VSMALL)
1064 const point& fc = fctrs[faceI];
1073 const point& thisPoint =
p[
f[fp]];
1074 const point& nextPoint =
p[
f.nextLabel(fp)];
1077 vector n = 0.5*((nextPoint - thisPoint)^(fc - thisPoint));
1081 scalar flatness = magAreas[faceI] / (sumA+VSMALL);
1083 sumFlatness += flatness;
1086 minFlatness =
min(minFlatness, flatness);
1088 if (flatness < faceFlatnessThreshold_())
1107 if (debug || report)
1111 Info<<
" Face flatness (1 = flat, 0 = butterfly) : average = "
1112 << sumFlatness / nSummed <<
" min = " << minFlatness <<
endl;
1119 if (debug || report)
1121 Info<<
" *There are " << nWarped
1122 <<
" faces with ratio between projected and actual area < "
1123 << faceFlatnessThreshold_() <<
endl;
1125 Info<<
" Minimum ratio (minimum flatness, maximum warpage) = "
1126 << minFlatness <<
endl;
1133 if (debug || report)
1135 Info<<
" All face flatness OK." <<
endl;
1158 Info<<
"bool primitiveMesh::checkEdgeAlignment("
1159 <<
"const bool, const Vector<label>&, labelHashSet*) const: "
1160 <<
"checking edge alignment" <<
endl;
1174 "primitiveMesh::checkEdgeAlignment"
1175 "(const bool, const Vector<label>&, labelHashSet*)"
1176 ) <<
"directions should contain 0 or 1 but is now " <<
directions
1195 const face&
f = fcs[faceI];
1200 label p1 =
f.nextLabel(fp);
1204 scalar magD =
mag(d);
1206 if (magD > ROOTVSMALL)
1211 label nEmptyDirs = 0;
1212 label nNonEmptyDirs = 0;
1215 if (
mag(d[cmpt]) > 1
e-6)
1228 if (nEmptyDirs == 0)
1232 else if (nEmptyDirs == 1)
1235 if (nNonEmptyDirs > 0)
1240 else if (nEmptyDirs > 1)
1252 if (nErrorEdges > 0)
1254 if (debug || report)
1256 Info<<
" ***Number of edges not aligned with or perpendicular to "
1257 <<
"non-empty directions: " << nErrorEdges <<
endl;
1265 setPtr->
insert(iter.key()[0]);
1266 setPtr->
insert(iter.key()[1]);
1274 if (debug || report)
1276 Info<<
" All edges aligned with or perpendicular to "
1277 <<
"non-empty directions." <<
endl;
1292 Info<<
"bool primitiveMesh::checkUpperTriangular("
1293 <<
"const bool, labelHashSet*) const: "
1294 <<
"checking face ordering" <<
endl;
1302 label internal = nInternalFaces();
1307 label nMultipleCells =
false;
1311 for (
label faceI = 0; faceI <
internal; faceI++)
1313 if (own[faceI] >= nei[faceI])
1337 label faceI = curFaces[i];
1339 if (faceI >= nInternalFaces())
1346 label nbrCellI = nei[faceI];
1348 if (nbrCellI == cellI)
1350 nbrCellI = own[faceI];
1353 if (cellI < nbrCellI)
1375 label prevCell = nbr[0];
1378 bool hasMultipleFaces =
false;
1380 for (
label i = 1; i < nbr.size(); i++)
1382 label thisCell = nbr[i];
1390 if (thisCell == prevCell)
1392 hasMultipleFaces =
true;
1396 setPtr->
insert(prevFace);
1397 setPtr->
insert(thisFace);
1400 else if (thisFace < prevFace)
1406 setPtr->
insert(thisFace);
1410 prevCell = thisCell;
1411 prevFace = thisFace;
1414 if (hasMultipleFaces)
1424 if ((debug || report) && nMultipleCells > 0)
1426 Info<<
" <<Found " << nMultipleCells
1427 <<
" neighbouring cells with multiple inbetween faces." <<
endl;
1432 if (debug || report)
1434 Info<<
" ***Faces not in upper triangular order." <<
endl;
1441 if (debug || report)
1443 Info<<
" Upper triangular ordering OK." <<
endl;
1459 Info<<
"bool primitiveMesh::checkCellsZipUp("
1460 <<
"const bool, labelHashSet*) const: "
1461 <<
"checking topological cell openness" <<
endl;
1464 label nOpenCells = 0;
1473 const edgeList cellEdges =
c[cellI].edges(
f);
1479 edgeList curFaceEdges =
f[curFaces[faceI]].edges();
1481 forAll (curFaceEdges, faceEdgeI)
1483 const edge& curEdge = curFaceEdges[faceEdgeI];
1485 forAll (cellEdges, cellEdgeI)
1487 if (cellEdges[cellEdgeI] == curEdge)
1489 edgeUsage[cellEdgeI]++;
1497 label nSingleEdges = 0;
1499 forAll (edgeUsage, edgeI)
1501 if (edgeUsage[edgeI] == 1)
1503 singleEdges[nSingleEdges] = cellEdges[edgeI];
1506 else if (edgeUsage[edgeI] != 2)
1515 if (nSingleEdges > 0)
1530 if (debug || report)
1532 Info<<
" ***Open cells found, number of cells: " << nOpenCells
1533 <<
". This problem may be fixable using the zipUpMesh utility."
1541 if (debug || report)
1543 Info<<
" Topological cell zip-up check OK." <<
endl;
1560 Info<<
"bool primitiveMesh::checkFaceVertices("
1561 <<
"const bool, labelHashSet*) const: "
1562 <<
"checking face vertices" <<
endl;
1568 label nErrorFaces = 0;
1572 const face& curFace =
f[fI];
1589 bool inserted = facePoints.
insert(curFace[fp]);
1605 if (nErrorFaces > 0)
1607 if (debug || report)
1609 Info<<
" Faces with invalid vertex labels found, "
1610 <<
" number of faces: " << nErrorFaces <<
endl;
1617 if (debug || report)
1619 Info<<
" Face vertices OK." <<
endl;
1632 label& nBaffleFaces,
1640 label nbFaceI = iter.key();
1641 label nCommon = iter();
1643 const face& curFace = faces()[faceI];
1644 const face& nbFace = faces()[nbFaceI];
1646 if (nCommon == nbFace.
size() || nCommon == curFace.
size())
1648 if (nbFace.
size() != curFace.
size())
1681 label nbFaceI = iter.key();
1682 label nCommon = iter();
1684 const face& curFace = faces()[faceI];
1685 const face& nbFace = faces()[nbFaceI];
1690 && nCommon != nbFace.
size()
1691 && nCommon != curFace.
size()
1711 label fpPlus1 = curFace.fcIndex(fp);
1712 label fpMin1 = curFace.rcIndex(fp);
1715 label nbPlus1 = nbFace.fcIndex(nb);
1716 label nbMin1 = nbFace.rcIndex(nb);
1723 if (nbFace[nbPlus1] == curFace[fpPlus1])
1728 else if (nbFace[nbPlus1] == curFace[fpMin1])
1733 else if (nbFace[nbMin1] == curFace[fpMin1])
1753 if (curFp >= curFace.
size())
1759 curFp = curFace.
size()-1;
1764 if (curNb >= nbFace.
size())
1770 curNb = nbFace.
size()-1;
1772 }
while (curFace[curFp] == nbFace[curNb]);
1781 for (
label commonI = 0; commonI < nCommon; commonI++)
1785 if (curFp >= curFace.
size())
1791 curFp = curFace.
size()-1;
1796 if (curNb >= nbFace.
size())
1802 curNb = nbFace.
size()-1;
1805 if (curFace[curFp] != nbFace[curNb])
1841 Info<<
"bool primitiveMesh::checkFaceFaces(const bool, labelHashSet*)"
1842 <<
" const: " <<
"checking face-face connectivity" <<
endl;
1847 label nBaffleFaces = 0;
1848 label nErrorDuplicate = 0;
1849 label nErrorOrder = 0;
1852 for (
label faceI = 0; faceI < nFaces(); faceI++)
1854 const face& curFace = faces()[faceI];
1858 nCommonPoints.clear();
1862 label pointI = curFace[fp];
1868 label nbFaceI = nbs[nbI];
1870 if (faceI < nbFaceI)
1876 if (fnd == nCommonPoints.end())
1879 nCommonPoints.insert(nbFaceI, 1);
1892 if (checkDuplicateFaces(faceI, nCommonPoints, nBaffleFaces, setPtr))
1898 if (checkCommonOrder(faceI, nCommonPoints, setPtr))
1910 Info<<
" Number of identical duplicate faces (baffle faces): "
1911 << nBaffleFaces <<
endl;
1914 if (nErrorDuplicate > 0 || nErrorOrder > 0)
1916 if (nErrorDuplicate > 0)
1918 Info<<
" ***Number of duplicate (not baffle) faces found: "
1919 << nErrorDuplicate <<
endl;
1922 if (nErrorOrder > 0)
1924 Info<<
" ***Number of faces with non-consecutive shared points: "
1925 << nErrorOrder <<
endl;
1932 if (debug || report)
1934 Info<<
" Face-face connectivity OK." <<
endl;
1951 Info<<
"bool primitiveMesh::checkCellDeterminant(const bool"
1952 <<
", labelHashSet*) const: "
1953 <<
"checking for under-determined cells" <<
endl;
1958 label nErrorCells = 0;
1960 scalar minDet = GREAT;
1971 label nInternalFaces = 0;
1975 if (isInternalFace(curFaces[i]))
1977 avgArea +=
mag(faceAreas()[curFaces[i]]);
1983 if (nInternalFaces == 0)
1994 avgArea /= nInternalFaces;
2000 if (isInternalFace(curFaces[i]))
2002 areaTensor +=
sqr(faceAreas()[curFaces[i]]/avgArea);
2006 scalar determinant =
mag(
det(areaTensor));
2008 minDet =
min(determinant, minDet);
2009 sumDet += determinant;
2012 if (determinant < 1
e-3)
2029 if (debug || report)
2033 Info<<
" Cell determinant (wellposedness) : minimum: " << minDet
2034 <<
" average: " << sumDet/nSummed
2039 if (nErrorCells > 0)
2041 if (debug || report)
2043 Info<<
" ***Cells with small determinant found, number of cells: "
2044 << nErrorCells <<
endl;
2051 if (debug || report)
2053 Info<<
" Cell determinant check OK." <<
endl;
2067 label noFailedChecks = 0;
2073 if (checkFaceFaces(report)) noFailedChecks++;
2076 if (noFailedChecks == 0)
2078 if (debug || report)
2080 Info<<
" Mesh topology OK." <<
endl;
2087 if (debug || report)
2089 Info<<
" Failed " << noFailedChecks
2090 <<
" mesh topology checks." <<
endl;
2100 label noFailedChecks = 0;
2106 if (checkFaceOrthogonality(report)) noFailedChecks++;
2110 if (noFailedChecks == 0)
2112 if (debug || report)
2114 Info<<
" Mesh geometry OK." <<
endl;
2120 if (debug || report)
2122 Info<<
" Failed " << noFailedChecks
2123 <<
" mesh geometry checks." <<
endl;
2135 Info<<
"bool primitiveMesh::checkMesh(const bool report) const: "
2136 <<
"checking primitiveMesh" <<
endl;
2141 if (noFailedChecks == 0)
2143 if (debug || report)
2152 if (debug || report)
2154 Info<<
" Failed " << noFailedChecks
2155 <<
" mesh checks." <<
endl;
bool checkClosedBoundary(const polyMeshGen &, const bool report=false)
Check boundary closedness.
void resize(const label newSize)
Resize the hash table for efficiency.
void checkFaceSkewness(const polyMeshGen &, scalarField &, const boolList *changedFacePtr=NULL)
Check face skewness.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
void sort()
(stable) sort the list (if changed after construction time)
bool checkMesh(const bool report=false) const
Check mesh for correctness. Returns false for no error.
#define forAll(list, i)
Loop across all elements in list.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurence of given element and return index,.
dimensionedScalar sin(const dimensionedScalar &ds)
bool checkFaceVertices(const bool report=false, labelHashSet *setPtr=NULL) const
Check uniqueness of face vertices.
static const label labelMax
bool checkDuplicateFaces(const label, const Map< label > &, label &nBaffleFaces, labelHashSet *) const
Check if all points on face are shared with another face.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
bool checkUpperTriangular(const polyMeshGen &, const bool report=false, labelHashSet *setPtr=NULL)
Check face ordering.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
@ nComponents
Number of components in this vector space.
label checkGeometry(const polyMesh &mesh, const bool allGeometry, const autoPtr< surfaceWriter > &)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Type gSum(const FieldField< Field, Type > &f)
bool checkFaceAreas(const polyMeshGen &, const bool report=false, const scalar minFaceArea=VSMALL, labelHashSet *setPtr=NULL, const boolList *changedFacePtr=NULL)
Check for negative face areas.
dimensioned< scalar > mag(const dimensioned< Type > &)
Set of directions for each cell in the mesh. Either uniform and size=1 or one set of directions per c...
bool checkFaceAreas(const bool report=false, labelHashSet *setPtr=NULL) const
Check for negative face areas.
bool checkFaceVertices(const polyMeshGen &, const bool report=false, labelHashSet *setPtr=NULL)
Check uniqueness of face vertices.
bool checkTopology(const bool report=false) const
Check mesh topology for correctness.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
void cmptMag(FieldField< Field, Type > &cf, const FieldField< Field, Type > &f)
void cmptMax(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
bool checkGeometry(const bool report=false) const
Check mesh geometry (& implicitly topology) for correctness.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
bool checkFaceFlatness(const bool report, labelHashSet *setPtr) const
Check face warpage: decompose face and check ratio between.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
bool checkCellsZipUp(const polyMeshGen &, const bool report=false, labelHashSet *setPtr=NULL)
Check cell zip-up.
bool checkFaceOrthogonality(const bool report=false, labelHashSet *setPtr=NULL) const
Check for non-orthogonality.
bool checkPoints(const polyMeshGen &, const bool report=false, labelHashSet *setPtr=NULL)
Check for unused points.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
label size() const
Return number of elements in table.
label nInternalFaces() const
A list that is sorted upon construction or when explicitly requested with the sort() method.
static const debug::tolerancesSwitch aspectThreshold_
Aspect ratio warning threshold.
bool checkClosedBoundary(const bool report=false) const
Check boundary for closedness.
bool checkFaceSkewness(const bool report=false, labelHashSet *setPtr=NULL) const
Check face skewness.
static const SymmTensor zero
const double e
Elementary charge.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
bool checkEdgeAlignment(const bool report, const Vector< label > &directions, labelHashSet *setPtr=NULL) const
Check edge alignment for 1D/2D cases.
bool checkUpperTriangular(const bool report=false, labelHashSet *setPtr=NULL) const
Check face ordering.
errorManipArg< error, int > exit(error &err, const int errNo=1)
bool checkFacePyramids(const polyMeshGen &, const bool report=false, const scalar minPyrVol=-SMALL, labelHashSet *setPtr=NULL, const boolList *changedFacePtr=NULL)
Check face pyramid volume.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
static const debug::tolerancesSwitch closedThreshold_
Static data to control mesh checking.
bool checkClosedCells(const bool report=false, labelHashSet *setPtr=NULL, labelHashSet *highAspectSetPtr=NULL) const
Check cells for closedness.
static Foam::debug::tolerancesSwitch nonOrthThreshold_
Non-orthogonality warning threshold in deg.
bool checkCellDeterminant(const bool report=false, labelHashSet *setPtr=NULL) const
Check cell determinant.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
bool checkFaceAngles(const bool report=false, labelHashSet *setPtr=NULL) const
Check face angles.
bool checkCellVolumes(const polyMeshGen &, const bool report=false, labelHashSet *setPtr=NULL)
Check for negative cell volumes.
static const debug::tolerancesSwitch skewThreshold_
Skewness warning threshold.
bool checkCellVolumes(const bool report=false, labelHashSet *setPtr=NULL) const
Check for negative cell volumes.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
bool checkPoints(const bool report=false, labelHashSet *setPtr=NULL) const
Check for unused points.
dimensionedScalar acos(const dimensionedScalar &ds)
bool checkFaceFaces(const bool report=false, labelHashSet *setPtr=NULL) const
Check face-face connectivity.
const dimensionedScalar e
Elementary charge.
bool insert(const Key &key)
Insert a new entry.
const labelList & indices() const
Return the list of sorted indices. Updated every sort.
const dimensionedScalar c
Speed of light in a vacuum.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
A face is a list of labels corresponding to mesh vertices.
Various functions to operate on Lists.
dimensionedScalar det(const dimensionedSphericalTensor &dt)
void size(const label)
Override size to be inconsistent with allocated storage.
bool checkCellsZipUp(const bool report=false, labelHashSet *setPtr=NULL) const
Check cell zip-up.
static const debug::tolerancesSwitch faceFlatnessThreshold_
Face flatness threshold.
static Foam::debug::tolerancesSwitch faceAngleThreshold_
Face angle threshold.
bool checkFacePyramids(const bool report=false, const scalar minPyrVol=-SMALL, labelHashSet *setPtr=NULL) const
Check face pyramid volume.
Cmpt cmptSum(const VectorSpace< Form, Cmpt, nCmpt > &vs)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
pyramid< point, const point &, const face & > pyramidPointFaceRef
A cell is defined as a list of faces with extra functionality.
Class to handle errors and exceptions in a simple, consistent stream-based manner.
bool checkClosedCells(const polyMeshGen &, const bool report=false, const scalar aspectWarn=1000, labelHashSet *setPtr=NULL)
Check cells for closedness.
dimensionedScalar asin(const dimensionedScalar &ds)
A normal distribution model.
label checkTopology(const polyMesh &, const bool, const bool, const autoPtr< surfaceWriter > &)
bool checkCommonOrder(const label, const Map< label > &, labelHashSet *) const
Check that shared points are in consecutive order.
dimensionedScalar cos(const dimensionedScalar &ds)
const vectorField & faceAreas() const