47 void Foam::polyMeshGeometry::updateFaceCentresAndAreas
55 for (
const label facei : changedFaces)
57 const face&
f = fcs[facei];
72 solveScalar sumA =
Zero;
88 solveVector n = (nextPoint - thisPoint)^(fCentre - thisPoint);
89 solveScalar a =
mag(
n);
96 if (sumA < ROOTVSMALL)
98 faceCentres_[facei] = fCentre;
99 faceAreas_[facei] =
Zero;
103 faceCentres_[facei] = (1.0/3.0)*sumAc/sumA;
104 faceAreas_[facei] = 0.5*sumN;
111 void Foam::polyMeshGeometry::updateCellCentresAndVols
121 UIndirectList<vector>(cellCentres_, changedCells) =
Zero;
122 UIndirectList<scalar>(cellVolumes_, changedCells) =
Zero;
126 for (
const label celli : changedCells)
134 for (
const label facei : cFaces)
136 const point& fc = faceCentres_[facei];
140 cEst /= cFaces.size();
144 for (
const label facei : cFaces)
147 scalar pyr3Vol = faceAreas_[facei] & (faceCentres_[facei] - cEst);
149 if (own[facei] != celli)
155 cellVolumes_[celli] += pyr3Vol;
158 const vector pCtr = (3.0/4.0)*faceCentres_[facei] + (1.0/4.0)*cEst;
161 cellCentres_[celli] += pyr3Vol*pCtr;
166 if (
mag(cellVolumes_[celli]) > VSMALL)
168 point cc = cellCentres_[celli] / cellVolumes_[celli];
175 cellCentres_[celli] = cc;
179 cellCentres_[celli] = cEst;
184 cellCentres_[celli] = cEst;
187 cellVolumes_[celli] *= (1.0/3.0);
194 const polyMesh&
mesh,
203 for (
const label facei : changedFaces)
205 affectedCells.insert(own[facei]);
209 affectedCells.insert(nei[facei]);
212 return affectedCells.toc();
216 Foam::scalar Foam::polyMeshGeometry::checkNonOrtho
218 const polyMesh&
mesh,
220 const scalar severeNonorthogonalityThreshold,
225 label& severeNonOrth,
230 scalar dDotS = (d &
s)/(
mag(d)*
mag(
s) + VSMALL);
232 if (dDotS < severeNonorthogonalityThreshold)
246 Pout<<
"Severe non-orthogonality for face " << facei
262 <<
"Severe non-orthogonality detected for face " 276 setPtr->insert(facei);
284 bool Foam::polyMeshGeometry::checkFaceTet
286 const polyMesh&
mesh,
288 const scalar minTetQuality,
309 if (tetQual < minTetQuality)
313 Pout<<
"bool polyMeshGeometry::checkFaceTets(" 314 <<
"const bool, const scalar, const pointField&" 315 <<
", const pointField&" 316 <<
", const labelList&, labelHashSet*) : " 318 <<
" has a triangle that points the wrong way." <<
nl 319 <<
"Tet quality: " << tetQual
325 setPtr->insert(facei);
349 faceAreas_ = mesh_.faceAreas();
350 faceCentres_ = mesh_.faceCentres();
351 cellCentres_ = mesh_.cellCentres();
352 cellVolumes_ = mesh_.cellVolumes();
363 updateFaceCentresAndAreas(
p, changedFaces);
365 updateCellCentresAndVols(affectedCells(mesh_, changedFaces), changedFaces);
372 const scalar orthWarn,
389 const scalar severeNonorthogonalityThreshold =
::cos(
degToRad(orthWarn));
401 scalar minDDotS = GREAT;
406 label severeNonOrth = 0;
408 label errorNonOrth = 0;
410 for (
const label facei : checkFaces)
412 const point& ownCc = cellCentres[own[facei]];
416 scalar dDotS = checkNonOrtho
420 severeNonorthogonalityThreshold,
423 cellCentres[nei[facei]] - ownCc,
430 if (dDotS < minDDotS)
444 scalar dDotS = checkNonOrtho
448 severeNonorthogonalityThreshold,
458 if (dDotS < minDDotS)
471 const label face0 = baffle.first();
472 const label face1 = baffle.second();
474 const point& ownCc = cellCentres[own[face0]];
476 scalar dDotS = checkNonOrtho
480 severeNonorthogonalityThreshold,
483 cellCentres[own[face1]] - ownCc,
490 if (dDotS < minDDotS)
499 reduce(minDDotS, minOp<scalar>());
500 reduce(sumDDotS, sumOp<scalar>());
501 reduce(nDDotS, sumOp<label>());
502 reduce(severeNonOrth, sumOp<label>());
503 reduce(errorNonOrth, sumOp<label>());
508 if (report && minDDotS < severeNonorthogonalityThreshold)
510 Info<<
"Number of non-orthogonality errors: " << errorNonOrth
511 <<
". Number of severely non-orthogonal faces: " 512 << severeNonOrth <<
"." <<
endl;
520 Info<<
"Mesh non-orthogonality Max: " 527 if (errorNonOrth > 0)
532 <<
"Error in non-orthogonality detected" <<
endl;
540 Info<<
"Non-orthogonality check OK.\n" <<
endl;
550 const scalar minPyrVol,
551 const polyMesh&
mesh,
555 const List<labelPair>& baffles,
565 label nErrorPyrs = 0;
567 for (
const label facei : checkFaces)
573 cellCentres[own[facei]]
576 if (pyrVol > -minPyrVol)
582 Pout<<
"bool polyMeshGeometry::checkFacePyramids(" 583 <<
"const bool, const scalar, const pointField&" 584 <<
", const labelList&, labelHashSet*): " 585 <<
"face " << facei <<
" points the wrong way. " <<
endl 586 <<
"Pyramid volume: " << -pyrVol
587 <<
" Face " <<
f[facei] <<
" area: " <<
f[facei].mag(
p)
588 <<
" Owner cell: " << own[facei] <<
endl 589 <<
"Owner cell vertex labels: " 595 setPtr->insert(facei);
605 if (pyrVol < minPyrVol)
611 Pout<<
"bool polyMeshGeometry::checkFacePyramids(" 612 <<
"const bool, const scalar, const pointField&" 613 <<
", const labelList&, labelHashSet*): " 614 <<
"face " << facei <<
" points the wrong way. " <<
endl 615 <<
"Pyramid volume: " << -pyrVol
616 <<
" Face " <<
f[facei] <<
" area: " <<
f[facei].mag(
p)
617 <<
" Neighbour cell: " << nei[facei] <<
endl 618 <<
"Neighbour cell vertex labels: " 624 setPtr->insert(facei);
632 const label face0 = baffle.first();
633 const label face1 = baffle.second();
635 const point& ownCc = cellCentres[own[face0]];
644 if (pyrVolOwn > -minPyrVol)
650 Pout<<
"bool polyMeshGeometry::checkFacePyramids(" 651 <<
"const bool, const scalar, const pointField&" 652 <<
", const labelList&, labelHashSet*): " 653 <<
"face " << face0 <<
" points the wrong way. " <<
endl 654 <<
"Pyramid volume: " << -pyrVolOwn
655 <<
" Face " <<
f[face0] <<
" area: " <<
f[face0].mag(
p)
656 <<
" Owner cell: " << own[face0] <<
endl 657 <<
"Owner cell vertex labels: " 663 setPtr->insert(face0);
671 if (pyrVolNbr < minPyrVol)
677 Pout<<
"bool polyMeshGeometry::checkFacePyramids(" 678 <<
"const bool, const scalar, const pointField&" 679 <<
", const labelList&, labelHashSet*): " 680 <<
"face " << face0 <<
" points the wrong way. " <<
endl 681 <<
"Pyramid volume: " << -pyrVolNbr
682 <<
" Face " <<
f[face0] <<
" area: " <<
f[face0].mag(
p)
683 <<
" Neighbour cell: " << own[face1] <<
endl 684 <<
"Neighbour cell vertex labels: " 690 setPtr->insert(face0);
695 reduce(nErrorPyrs, sumOp<label>());
702 <<
"Error in face pyramids: faces pointing the wrong way." 711 Info<<
"Face pyramids OK.\n" <<
endl;
721 const scalar minTetQuality,
722 const polyMesh&
mesh,
727 const List<labelPair>& baffles,
747 label nErrorTets = 0;
749 for (
const label facei : checkFaces)
753 bool tetError = checkFaceTet
760 cellCentres[own[facei]],
773 bool tetError = checkFaceTet
781 cellCentres[nei[facei]],
804 setPtr->insert(facei);
829 setPtr->insert(facei);
849 setPtr->insert(facei);
858 const label face0 = baffle.first();
859 const label face1 = baffle.second();
861 bool tetError = checkFaceTet
868 cellCentres[own[face0]],
879 tetError = checkFaceTet
887 cellCentres[own[face1]],
902 cellCentres[own[face1]],
911 setPtr->insert(face0);
916 reduce(nErrorTets, sumOp<label>());
923 <<
"Error in face decomposition: negative tets." 942 const scalar internalSkew,
943 const scalar boundarySkew,
944 const polyMesh&
mesh,
950 const List<labelPair>& baffles,
970 for (
const label facei : checkFaces)
982 cellCentres[own[facei]],
983 cellCentres[nei[facei]]
989 if (skewness > internalSkew)
995 Pout<<
"Severe skewness for face " << facei
996 <<
" skewness = " << skewness <<
endl;
1000 setPtr->insert(facei);
1004 maxSkew =
max(maxSkew, skewness);
1016 cellCentres[own[facei]],
1023 if (skewness > internalSkew)
1029 Pout<<
"Severe skewness for coupled face " << facei
1030 <<
" skewness = " << skewness <<
endl;
1034 setPtr->insert(facei);
1038 maxSkew =
max(maxSkew, skewness);
1050 cellCentres[own[facei]]
1057 if (skewness > boundarySkew)
1063 Pout<<
"Severe skewness for boundary face " << facei
1064 <<
" skewness = " << skewness <<
endl;
1068 setPtr->insert(facei);
1072 maxSkew =
max(maxSkew, skewness);
1078 const label face0 = baffle.first();
1079 const label face1 = baffle.second();
1081 const point& ownCc = cellCentres[own[face0]];
1082 const point& neiCc = cellCentres[own[face1]];
1099 if (skewness > internalSkew)
1105 Pout<<
"Severe skewness for face " << face0
1106 <<
" skewness = " << skewness <<
endl;
1110 setPtr->insert(face0);
1114 maxSkew =
max(maxSkew, skewness);
1118 reduce(maxSkew, maxOp<scalar>());
1119 reduce(nWarnSkew, sumOp<label>());
1127 <<
" percent.\nThis may impair the quality of the result." <<
nl 1128 << nWarnSkew <<
" highly skew faces detected." 1137 Info<<
"Max skewness = " << 100*maxSkew
1138 <<
" percent. Face skewness OK.\n" <<
endl;
1148 const scalar warnWeight,
1149 const polyMesh&
mesh,
1154 const List<labelPair>& baffles,
1174 scalar minWeight = GREAT;
1176 label nWarnWeight = 0;
1178 for (
const label facei : checkFaces)
1180 const point& fc = faceCentres[facei];
1181 const vector& fa = faceAreas[facei];
1183 scalar dOwn =
mag(fa & (fc-cellCentres[own[facei]]));
1187 scalar dNei =
mag(fa & (cellCentres[nei[facei]]-fc));
1188 scalar weight =
min(dNei,dOwn)/(dNei+dOwn+VSMALL);
1190 if (weight < warnWeight)
1196 Pout<<
"Small weighting factor for face " << facei
1197 <<
" weight = " << weight <<
endl;
1201 setPtr->insert(facei);
1205 minWeight =
min(minWeight, weight);
1214 scalar weight =
min(dNei,dOwn)/(dNei+dOwn+VSMALL);
1216 if (weight < warnWeight)
1222 Pout<<
"Small weighting factor for face " << facei
1223 <<
" weight = " << weight <<
endl;
1227 setPtr->insert(facei);
1231 minWeight =
min(minWeight, weight);
1238 const label face0 = baffle.first();
1239 const label face1 = baffle.second();
1241 const point& ownCc = cellCentres[own[face0]];
1242 const point& fc = faceCentres[face0];
1243 const vector& fa = faceAreas[face0];
1245 scalar dOwn =
mag(fa & (fc-ownCc));
1246 scalar dNei =
mag(fa & (cellCentres[own[face1]]-fc));
1247 scalar weight =
min(dNei,dOwn)/(dNei+dOwn+VSMALL);
1249 if (weight < warnWeight)
1255 Pout<<
"Small weighting factor for face " << face0
1256 <<
" weight = " << weight <<
endl;
1260 setPtr->insert(face0);
1264 minWeight =
min(minWeight, weight);
1267 reduce(minWeight, minOp<scalar>());
1268 reduce(nWarnWeight, sumOp<label>());
1270 if (minWeight < warnWeight)
1275 << minWeight <<
'.' <<
nl 1276 << nWarnWeight <<
" faces with small weights detected." 1285 Info<<
"Min weight = " << minWeight
1286 <<
". Weights OK.\n" <<
endl;
1296 const scalar warnRatio,
1297 const polyMesh&
mesh,
1300 const List<labelPair>& baffles,
1320 scalar minRatio = GREAT;
1322 label nWarnRatio = 0;
1324 for (
const label facei : checkFaces)
1326 scalar ownVol =
mag(cellVolumes[own[facei]]);
1328 scalar neiVol = -GREAT;
1332 neiVol =
mag(cellVolumes[nei[facei]]);
1346 scalar ratio =
min(ownVol, neiVol) / (
max(ownVol, neiVol) + VSMALL);
1348 if (ratio < warnRatio)
1354 Pout<<
"Small ratio for face " << facei
1355 <<
" ratio = " << ratio <<
endl;
1359 setPtr->insert(facei);
1363 minRatio =
min(minRatio, ratio);
1369 const label face0 = baffle.first();
1370 const label face1 = baffle.second();
1372 scalar ownVol =
mag(cellVolumes[own[face0]]);
1374 scalar neiVol =
mag(cellVolumes[own[face1]]);
1378 scalar ratio =
min(ownVol, neiVol) / (
max(ownVol, neiVol) + VSMALL);
1380 if (ratio < warnRatio)
1386 Pout<<
"Small ratio for face " << face0
1387 <<
" ratio = " << ratio <<
endl;
1391 setPtr->insert(face0);
1395 minRatio =
min(minRatio, ratio);
1399 reduce(minRatio, minOp<scalar>());
1400 reduce(nWarnRatio, sumOp<label>());
1402 if (minRatio < warnRatio)
1407 << minRatio <<
'.' <<
nl 1408 << nWarnRatio <<
" faces with small ratios detected." 1417 Info<<
"Min ratio = " << minRatio
1418 <<
". Ratios OK.\n" <<
endl;
1432 const scalar maxDeg,
1440 if (maxDeg < -SMALL || maxDeg > 180+SMALL)
1443 <<
"maxDeg should be [0..180] but is now " << maxDeg
1451 scalar maxEdgeSin = 0.0;
1455 label errorFacei = -1;
1457 for (
const label facei : checkFaces)
1459 const face&
f = fcs[facei];
1465 scalar magEPrev =
mag(ePrev);
1466 ePrev /= magEPrev + VSMALL;
1471 vector e10(
p[
f.nextLabel(fp0)] -
p[
f.thisLabel(fp0)]);
1472 scalar magE10 =
mag(e10);
1473 e10 /= magE10 + VSMALL;
1475 if (magEPrev > SMALL && magE10 > SMALL)
1477 vector edgeNormal = ePrev ^ e10;
1478 scalar magEdgeNormal =
mag(edgeNormal);
1480 if (magEdgeNormal < maxSin)
1487 edgeNormal /= magEdgeNormal;
1489 if ((edgeNormal & faceNormal) < SMALL)
1491 if (facei != errorFacei)
1498 maxEdgeSin =
max(maxEdgeSin, magEdgeNormal);
1518 if (maxEdgeSin > SMALL)
1520 scalar maxConcaveDegr =
1523 Info<<
"There are " << nConcave
1524 <<
" faces with concave angles between consecutive" 1525 <<
" edges. Max concave angle = " << maxConcaveDegr
1526 <<
" degrees.\n" <<
endl;
1530 Info<<
"All angles in faces are convex or less than " << maxDeg
1531 <<
" degrees concave.\n" <<
endl;
1540 << nConcave <<
" face points with severe concave angle (> " 1541 << maxDeg <<
" deg) found.\n" 1557 const scalar minTwist,
1567 if (minTwist < -1-SMALL || minTwist > 1+SMALL)
1570 <<
"minTwist should be [-1..1] but is now " << minTwist
1592 for (
const label facei : checkFaces)
1594 const face&
f = fcs[facei];
1605 cellCentres[nei[facei]]
1606 - cellCentres[own[facei]]
1615 - cellCentres[own[facei]]
1624 - cellCentres[own[facei]]
1628 if (nf != vector::zero)
1630 const point& fc = faceCentres[facei];
1639 p[
f.nextLabel(fpI)],
1644 scalar magTri =
mag(triArea);
1646 if (magTri > VSMALL && ((nf & triArea/magTri) < minTwist))
1662 reduce(nWarped, sumOp<label>());
1668 Info<<
"There are " << nWarped
1669 <<
" faces with cosine of the angle" 1670 <<
" between triangle normal and face normal less than " 1671 << minTwist <<
nl <<
endl;
1675 Info<<
"All faces are flat in that the cosine of the angle" 1676 <<
" between triangle normal and face normal less than " 1677 << minTwist <<
nl <<
endl;
1686 << nWarped <<
" faces with severe warpage " 1687 <<
"(cosine of the angle between triangle normal and " 1688 <<
"face normal < " << minTwist <<
") found.\n" 1703 const scalar minTwist,
1712 if (minTwist < -1-SMALL || minTwist > 1+SMALL)
1715 <<
"minTwist should be [-1..1] but is now " << minTwist
1723 for (
const label facei : checkFaces)
1725 const face&
f = fcs[facei];
1729 const point& fc = faceCentres[facei];
1744 scalar magTri =
mag(prevN);
1746 if (magTri > VSMALL)
1771 scalar magTri =
mag(triN);
1773 if (magTri > VSMALL)
1777 if ((prevN & triN) < minTwist)
1791 else if (minTwist > 0)
1803 while (fp != startFp);
1809 reduce(nWarped, sumOp<label>());
1815 Info<<
"There are " << nWarped
1816 <<
" faces with cosine of the angle" 1817 <<
" between consecutive triangle normals less than " 1818 << minTwist <<
nl <<
endl;
1822 Info<<
"All faces are flat in that the cosine of the angle" 1823 <<
" between consecutive triangle normals is less than " 1824 << minTwist <<
nl <<
endl;
1833 << nWarped <<
" faces with severe warpage " 1834 <<
"(cosine of the angle between consecutive triangle normals" 1835 <<
" < " << minTwist <<
") found.\n" 1849 const scalar minFlatness,
1850 const polyMesh&
mesh,
1858 if (minFlatness < -SMALL || minFlatness > 1+SMALL)
1861 <<
"minFlatness should be [0..1] but is now " << minFlatness
1869 for (
const label facei : checkFaces)
1871 const face&
f = fcs[facei];
1875 const point& fc = faceCentres[facei];
1878 scalar sumArea = 0.0;
1890 if (sumArea/
mag(faceAreas[facei]) < minFlatness)
1895 setPtr->insert(facei);
1901 reduce(nWarped, sumOp<label>());
1907 Info<<
"There are " << nWarped
1908 <<
" faces with area of individual triangles" 1909 <<
" compared to overall area less than " 1910 << minFlatness <<
nl <<
endl;
1914 Info<<
"All faces are flat in that the area of individual triangles" 1915 <<
" compared to overall area is less than " 1916 << minFlatness <<
nl <<
endl;
1925 << nWarped <<
" non-flat faces " 1926 <<
"(area of individual triangles" 1927 <<
" compared to overall area" 1928 <<
" < " << minFlatness <<
") found.\n" 1942 const scalar minArea,
1943 const polyMesh&
mesh,
1949 label nZeroArea = 0;
1951 for (
const label facei : checkFaces)
1953 if (
mag(faceAreas[facei]) < minArea)
1958 setPtr->insert(facei);
1964 reduce(nZeroArea, sumOp<label>());
1970 Info<<
"There are " << nZeroArea
1971 <<
" faces with area < " << minArea <<
'.' <<
nl <<
endl;
1975 Info<<
"All faces have area > " << minArea <<
'.' <<
nl <<
endl;
1984 << nZeroArea <<
" faces with area < " << minArea
1999 const scalar warnDet,
2000 const polyMesh&
mesh,
2009 scalar minDet = GREAT;
2010 scalar sumDet = 0.0;
2014 for (
const label celli : affectedCells)
2016 const cell& cFaces =
cells[celli];
2019 scalar magAreaSum = 0;
2021 for (
const label facei : cFaces)
2023 scalar magArea =
mag(faceAreas[facei]);
2025 magAreaSum += magArea;
2026 areaSum += faceAreas[facei]*(faceAreas[facei]/(magArea+VSMALL));
2029 scalar scaledDet =
det(areaSum/(magAreaSum+VSMALL))/0.037037037037037;
2031 minDet =
min(minDet, scaledDet);
2032 sumDet += scaledDet;
2035 if (scaledDet < warnDet)
2040 setPtr->insert(cFaces);
2045 reduce(minDet, minOp<scalar>());
2046 reduce(sumDet, sumOp<scalar>());
2047 reduce(nSumDet, sumOp<label>());
2048 reduce(nWarnDet, sumOp<label>());
2054 Info<<
"Cell determinant (1 = uniform cube) : average = " 2055 << sumDet / nSumDet <<
" min = " << minDet <<
endl;
2060 Info<<
"There are " << nWarnDet
2061 <<
" cells with determinant < " << warnDet <<
'.' <<
nl 2066 Info<<
"All faces have determinant > " << warnDet <<
'.' <<
nl 2076 << nWarnDet <<
" cells with determinant < " << warnDet
2091 const scalar minEdgeLength,
2092 const polyMesh&
mesh,
2097 const scalar reportLenSqr(
Foam::sqr(minEdgeLength));
2102 scalar minLenSqr =
sqr(GREAT);
2103 scalar maxLenSqr = -
sqr(GREAT);
2107 for (
const label facei : checkFaces)
2109 const face&
f = faces[facei];
2117 if (setPtr && magSqrE < reportLenSqr)
2119 if (setPtr->insert(
f[fp]) || setPtr->insert(
f[fp1]))
2125 minLenSqr =
min(minLenSqr, magSqrE);
2126 maxLenSqr =
max(maxLenSqr, magSqrE);
2130 reduce(minLenSqr, minOp<scalar>());
2131 reduce(maxLenSqr, maxOp<scalar>());
2133 reduce(nSmall, sumOp<label>());
2139 Info<<
" *Edges too small, min/max edge length = " 2140 <<
sqrt(minLenSqr) <<
" " <<
sqrt(maxLenSqr)
2141 <<
", number too small: " << nSmall <<
endl;
2149 Info<<
" Min/max edge length = " 2150 <<
sqrt(minLenSqr) <<
" " <<
sqrt(maxLenSqr) <<
" OK." <<
endl;
2160 const scalar orthWarn,
2162 const List<labelPair>& baffles,
2166 return checkFaceDotProduct
2183 const scalar minPyrVol,
2190 return checkFacePyramids
2207 const scalar minTetQuality,
2214 return checkFaceTets
2258 const scalar warnWeight,
2264 return checkFaceWeights
2282 const scalar warnRatio,
2288 return checkVolRatio
2304 const scalar maxDeg,
2310 return checkFaceAngles
2326 const scalar minTwist,
2332 return checkFaceTwist
2350 const scalar minTwist,
2356 return checkTriangleTwist
2373 const scalar minFlatness,
2379 return checkFaceFlatness
2396 const scalar minArea,
2401 return checkFaceArea
2416 const scalar warnDet,
2422 return checkCellDeterminant
2438 const scalar minEdgeLength,
2443 return checkEdgeLength
static bool checkFacePyramids(const bool report, const scalar minPyrVol, const polyMesh &, const vectorField &cellCentres, const pointField &p, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet *)
See primitiveMesh.
static 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 *)
See primitiveMesh.
void size(const label n)
Older name for setAddressableSize.
dimensionedScalar acos(const dimensionedScalar &ds)
static bool checkTriangleTwist(const bool report, const scalar minTwist, const polyMesh &, const vectorField &faceAreas, const vectorField &faceCentres, const pointField &p, const labelList &checkFaces, labelHashSet *setPtr)
Consecutive triangle (from face-centre decomposition) normals.
List< cell > cellList
List of cell.
A face is a list of labels corresponding to mesh vertices.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual const labelList & faceNeighbour() const
Return face neighbour.
tetrahedron< point, const point & > tetPointRef
A tetrahedron using referred points.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Unit conversion functions.
static 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)
Triangle (from face-centre decomposition) normal v.s.
constexpr char nl
The newline '\n' character (0x0a)
T & first()
Access first element of the list, position [0].
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const cellList & cells() const
dimensionedScalar det(const dimensionedSphericalTensor &dt)
quaternion normalised(const quaternion &q)
Return the normalised (unit) quaternion of the given quaternion.
label nFaces() const noexcept
Number of mesh faces.
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
static 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)
dimensionedScalar asin(const dimensionedScalar &ds)
static bool checkFaceFlatness(const bool report, const scalar minFlatness, const polyMesh &, const vectorField &faceAreas, const vectorField &faceCentres, const pointField &p, const labelList &checkFaces, labelHashSet *setPtr)
Area of faces v.s. sum of triangle areas.
bool isInternalFace(const label faceIndex) const noexcept
Return true if given face label is internal to the mesh.
static label findBasePoint(const polyMesh &mesh, label fI, scalar tol, bool report=false)
Find the base point to use for a minimum triangle.
#define SeriousErrorInFunction
Report an error message using Foam::SeriousError.
virtual const pointField & points() const
Return raw points.
#define forAll(list, i)
Loop across all elements in list.
label fcIndex(const label i) const noexcept
The forward circular index. The next index in the list which returns to the first at the end of the l...
pyramid< point, const point &, const face & > pyramidPointFaceRef
A pyramid using referred point and face.
Vector< solveScalar > solveVector
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
List< face > faceList
List of faces.
vectorField pointField
pointField is a vectorField.
dimensionedScalar cos(const dimensionedScalar &ds)
static bool checkEdgeLength(const bool report, const scalar minEdgeLength, const polyMesh &mesh, const labelList &checkFaces, labelHashSet *pointSetPtr)
Small edges. Optionally collects points of small edges.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
static label findSharedBasePoint(const polyMesh &mesh, label fI, const point &nCc, scalar tol, bool report=false)
Find the first suitable base point to use for a minimum.
virtual const labelList & faceOwner() const
Return face owner.
Point centre() const
Return centre (centroid)
constexpr scalar pi(M_PI)
label nInternalFaces() const noexcept
Number of internal faces.
virtual const faceList & faces() const
Return raw faces.
label whichPatch(const label meshFacei) const
Return patch index for a given mesh face index. Uses binary search.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
errorManip< error > abort(error &err)
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO...
dimensionedScalar sin(const dimensionedScalar &ds)
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
static bool checkFaceArea(const bool report, const scalar minArea, const polyMesh &, const vectorField &faceAreas, const labelList &checkFaces, labelHashSet *setPtr)
Small faces.
Pair< label > labelPair
A pair of labels.
Info<< "Predicted p max-min : "<< max(p).value()<< " "<< min(p).value()<< endl;rho==max(psi *p+alphal *rhol0+((alphav *psiv+alphal *psil) - psi) *pSat, rhoMin);# 1 "/home/chef2/andy/OpenFOAM/release/v2406/OpenFOAM-v2406/applications/solvers/multiphase/cavitatingFoam/alphavPsi.H" 1{ alphav=clamp((rho - rholSat)/(rhovSat - rholSat), zero_one{});alphal=1.0 - alphav;Info<< "max-min alphav: "<< max(alphav).value()<< " "<< min(alphav).value()<< endl;psiModel-> correct()
defineTypeNameAndDebug(combustionModel, 0)
T & last()
Access last element of the list, position [size()-1].
static bool checkFaceAngles(const bool report, const scalar maxDeg, const polyMesh &mesh, const vectorField &faceAreas, const pointField &p, const labelList &checkFaces, labelHashSet *setPtr)
See primitiveMesh.
vector point
Point is a vector.
#define WarningInFunction
Report a warning using Foam::Warning.
constexpr scalar radToDeg(const scalar rad) noexcept
Conversion from radians to degrees.
static 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)
See primitiveMesh.
const dimensionedScalar c
Speed of light in a vacuum.
const polyBoundaryMesh & patches
triangle< point, const point & > triPointRef
A triangle using referred points.
void correct()
Take over properties from mesh.
static labelList affectedCells(const polyMesh &, const labelList &changedFaces)
Helper function: get affected cells from faces.
messageStream Info
Information stream (stdout output on master, null elsewhere)
static 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)
Interpolation weights (0.5 for regular mesh)
Field< vector > vectorField
Specialisation of Field<T> for vector.
Mesh consisting of general polyhedral cells.
static 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)
See primitiveMesh.
List< label > labelList
A List of labels.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.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))
label nBoundaryFaces() const noexcept
Number of boundary faces (== nFaces - nInternalFaces)
constexpr scalar degToRad(const scalar deg) noexcept
Conversion from degrees to radians.
static bool checkCellDeterminant(const bool report, const scalar minDet, const polyMesh &, const vectorField &faceAreas, const labelList &checkFaces, const labelList &affectedCells, labelHashSet *setPtr)
Area of internal faces v.s. boundary faces.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
void reduce(T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce) using linear/tree communication schedule.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
polyMeshGeometry(const polyMesh &)
Construct from mesh.
vector areaNormal() const
The area normal - with magnitude equal to area of triangle.
static constexpr const zero Zero
Global zero (0)