78 void Foam::snappyLayerDriver::dumpDisplacement
80 const fileName& prefix,
83 const List<extrudeMode>& extrudeStatus
86 OBJstream dispStr(prefix +
"_disp.obj");
87 Info<<
"Writing all displacements to " << dispStr.name() <<
endl;
89 forAll(patchDisp, patchPointi)
91 const point& pt =
pp.localPoints()[patchPointi];
92 dispStr.writeLine(pt, pt + patchDisp[patchPointi]);
96 OBJstream illStr(prefix +
"_illegal.obj");
97 Info<<
"Writing invalid displacements to " << illStr.name() <<
endl;
99 forAll(patchDisp, patchPointi)
101 if (extrudeStatus[patchPointi] !=
EXTRUDE)
103 const point& pt =
pp.localPoints()[patchPointi];
104 illStr.writeLine(pt, pt + patchDisp[patchPointi]);
126 faceFld[facei] += pointFld[
f[fp]];
128 faceFld[facei] /=
f.
size();
137 void Foam::snappyLayerDriver::checkManifold
140 pointSet& nonManifoldPoints
144 fp.checkPointManifold(
false, &nonManifoldPoints);
151 const labelList& eFaces = edgeFaces[edgei];
153 if (eFaces.size() > 2)
155 const edge&
e = fp.edges()[edgei];
157 nonManifoldPoints.insert(fp.meshPoints()[
e[0]]);
158 nonManifoldPoints.insert(fp.meshPoints()[
e[1]]);
164 void Foam::snappyLayerDriver::checkMeshManifold()
const 166 const fvMesh&
mesh = meshRefiner_.mesh();
168 Info<<
nl <<
"Checking mesh manifoldness ..." <<
endl;
170 pointSet nonManifoldPoints
192 label nNonManif =
returnReduce(nonManifoldPoints.size(), sumOp<label>());
196 Info<<
"Outside of mesh is multiply connected across edges or" 198 <<
"This is not a fatal error but might cause some unexpected" 199 <<
" behaviour." <<
nl 214 bool Foam::snappyLayerDriver::unmarkExtrusion
216 const label patchPointi,
219 List<extrudeMode>& extrudeStatus
222 if (extrudeStatus[patchPointi] == EXTRUDE)
224 extrudeStatus[patchPointi] = NOEXTRUDE;
225 patchNLayers[patchPointi] = 0;
226 patchDisp[patchPointi] =
Zero;
229 else if (extrudeStatus[patchPointi] == EXTRUDEREMOVE)
231 extrudeStatus[patchPointi] = NOEXTRUDE;
232 patchNLayers[patchPointi] = 0;
233 patchDisp[patchPointi] =
Zero;
242 bool Foam::snappyLayerDriver::unmarkExtrusion
244 const face& localFace,
247 List<extrudeMode>& extrudeStatus
250 bool unextruded =
false;
272 Foam::label Foam::snappyLayerDriver::constrainFp(
const label sz,
const label fp)
289 void Foam::snappyLayerDriver::countCommonPoints
294 Map<label>& nCommonPoints
300 const face&
f = localFaces[facei];
302 nCommonPoints.
clear();
306 label pointi =
f[fp];
311 label nbFacei =
pFaces[pFacei];
316 ++(nCommonPoints(nbFacei, 0));
323 bool Foam::snappyLayerDriver::checkCommonOrder
333 const label nb = nbFace.find(curFace[fp]);
347 label fpPlus1 = curFace.fcIndex(fp);
348 label fpMin1 = curFace.rcIndex(fp);
351 label nbPlus1 = nbFace.fcIndex(nb);
352 label nbMin1 = nbFace.rcIndex(nb);
359 if (nbFace[nbPlus1] == curFace[fpPlus1])
364 else if (nbFace[nbPlus1] == curFace[fpMin1])
369 else if (nbFace[nbMin1] == curFace[fpMin1])
387 curFp = constrainFp(curFace.size(), curFp+curInc);
388 curNb = constrainFp(nbFace.size(), curNb+nbInc);
389 }
while (curFace[curFp] == nbFace[curNb]);
397 for (label commonI = 0; commonI < nCommon; commonI++)
399 curFp = constrainFp(curFace.size(), curFp+curInc);
400 curNb = constrainFp(nbFace.size(), curNb+nbInc);
402 if (curFace[curFp] != nbFace[curNb])
418 void Foam::snappyLayerDriver::checkCommonOrder
422 const Map<label>& nCommonPoints,
425 List<extrudeMode>& extrudeStatus
430 const label nbFacei = iter.key();
431 const label nCommon = iter.val();
433 const face& curFace =
pp[facei];
434 const face& nbFace =
pp[nbFacei];
439 && nCommon != nbFace.size()
440 && nCommon != curFace.size()
443 bool stringOk = checkCommonOrder(nCommon, curFace, nbFace);
469 void Foam::snappyLayerDriver::handleNonStringConnected
474 List<extrudeMode>& extrudeStatus
482 List<extrudeMode> oldExtrudeStatus;
483 autoPtr<OBJstream> str;
486 oldExtrudeStatus = extrudeStatus;
491 meshRefiner_.mesh().time().path()
492 /
"nonStringConnected.obj" 495 Pout<<
"Dumping string edges to " << str().
name();
500 Map<label> nCommonPoints(128);
504 countCommonPoints(
pp, facei, nCommonPoints);
527 forAll(extrudeStatus, pointi)
529 if (extrudeStatus[pointi] != oldExtrudeStatus[pointi])
542 void Foam::snappyLayerDriver::handleNonManifolds
549 List<extrudeMode>& extrudeStatus
552 const fvMesh&
mesh = meshRefiner_.mesh();
554 Info<<
nl <<
"Handling non-manifold points ..." <<
endl;
557 Info<<
nl <<
"Checking patch manifoldness ..." <<
endl;
559 pointSet nonManifoldPoints(
mesh,
"nonManifoldPoints",
pp.
nPoints());
572 const labelList& eFaces = edgeFaces[edgei];
573 if (eFaces.size() > 2)
583 forAll(edgeGlobalFaces, edgei)
585 if (edgeGlobalFaces[edgei].size() > 2)
597 label nNonManif =
returnReduce(nonManifoldPoints.size(), sumOp<label>());
599 Info<<
"Outside of local patch is multiply connected across edges or" 600 <<
" points at " << nNonManif <<
" points." <<
endl;
607 nonManifoldPoints.sync(
mesh);
611 forAll(meshPoints, patchPointi)
613 if (nonManifoldPoints.found(meshPoints[patchPointi]))
626 Info<<
"Set displacement to zero for all " << nNonManif
627 <<
" non-manifold points" <<
endl;
637 label nBaffleFaces = 0;
642 const labelList& fEdges = faceEdges[facei];
644 const labelList& globFaces0 = edgeGlobalFaces[fEdges[0]];
645 if (globFaces0.size() == 2)
647 const edge e0(globFaces0[0], globFaces0[1]);
648 bool isBaffle =
true;
649 for (label fp = 1; fp < fEdges.size(); fp++)
651 const labelList& globFaces = edgeGlobalFaces[fEdges[fp]];
654 (globFaces.size() != 2)
655 || (edge(globFaces[0], globFaces[1]) != e0)
665 bool unextrude = unmarkExtrusion
685 reduce(nBaffleFaces, sumOp<label>());
689 Info<<
"Set displacement to zero for all points on " << nBaffleFaces
690 <<
" baffle faces" <<
endl;
697 void Foam::snappyLayerDriver::handleFeatureAngle
701 const scalar minAngle,
704 List<extrudeMode>& extrudeStatus
707 const fvMesh&
mesh = meshRefiner_.mesh();
711 Info<<
nl <<
"Handling feature edges (angle < " << minAngle
714 if (minCos < 1-SMALL && minCos > -1+SMALL)
725 label meshEdgei = meshEdges[edgei];
731 edgeNormal[meshEdgei],
745 autoPtr<OBJstream> str;
754 + meshRefiner_.timeName()
758 Info<<
"Writing feature edges to " << str().name() <<
endl;
769 label meshEdgei = meshEdges[edgei];
771 const vector&
n = edgeNormal[meshEdgei];
806 Info<<
"Set displacement to zero for points on " 808 <<
" feature edges" <<
endl;
817 void Foam::snappyLayerDriver::handleWarpedFaces
820 const scalar faceRatio,
822 const scalar edge0Len,
826 List<extrudeMode>& extrudeStatus
829 const fvMesh&
mesh = meshRefiner_.mesh();
832 Info<<
nl <<
"Handling cells with warped patch faces ..." <<
nl;
840 label nWarpedFaces = 0;
844 const face&
f =
pp[i];
845 label faceI =
pp.addressing()[i];
851 if (relativeSizes[patchI] &&
f.
size() > 3)
854 scalar edgeLen = edge0Len/(1<<ownLevel);
857 const point& fc = faceCentres[faceI];
865 vProj[fp] = (
n & fn);
869 scalar minVal =
min(vProj);
870 scalar maxVal =
max(vProj);
872 if ((maxVal - minVal) > faceRatio * edgeLen)
891 Info<<
"Set displacement to zero on " 893 <<
" warped faces since layer would be > " << faceRatio
894 <<
" of the size of the bounding box." <<
endl;
1001 void Foam::snappyLayerDriver::setNumLayers
1007 List<extrudeMode>& extrudeStatus,
1011 const fvMesh&
mesh = meshRefiner_.mesh();
1013 Info<<
nl <<
"Handling points with inconsistent layer specification ..." 1027 label wantedLayers = patchToNLayers[patchi];
1029 forAll(meshPoints, patchPointi)
1033 maxLayers[ppPointi] =
max(wantedLayers, maxLayers[ppPointi]);
1034 minLayers[ppPointi] =
min(wantedLayers, minLayers[ppPointi]);
1066 <<
" maxLayers:" << maxLayers
1067 <<
" minLayers:" << minLayers
1070 else if (maxLayers[i] == minLayers[i])
1073 patchNLayers[i] = maxLayers[i];
1091 patchNLayers[i] = maxLayers[i];
1106 nCells =
max(nCells, patchNLayers[
f[fp]]);
1109 nAddedCells += nCells;
1111 reduce(nAddedCells, sumOp<label>());
1124 Foam::snappyLayerDriver::makeLayerDisplacementField
1126 const pointMesh& pMesh,
1131 const pointBoundaryMesh& pointPatches = pMesh.boundary();
1135 pointPatches.size(),
1136 slipPointPatchVectorField::typeName
1138 wordList actualPatchTypes(patchFieldTypes.size());
1139 forAll(pointPatches, patchi)
1141 actualPatchTypes[patchi] = pointPatches[patchi].type();
1144 forAll(numLayers, patchi)
1148 if (numLayers[patchi] == 0)
1150 patchFieldTypes[patchi] =
1151 zeroFixedValuePointPatchVectorField::typeName;
1153 else if (numLayers[patchi] > 0)
1155 patchFieldTypes[patchi] = fixedValuePointPatchVectorField::typeName;
1159 forAll(pointPatches, patchi)
1161 if (isA<processorPointPatch>(pointPatches[patchi]))
1163 patchFieldTypes[patchi] = calculatedPointPatchVectorField::typeName;
1165 else if (isA<cyclicPointPatch>(pointPatches[patchi]))
1167 patchFieldTypes[patchi] = cyclicSlipPointPatchVectorField::typeName;
1172 const polyMesh&
mesh = pMesh();
1181 "pointDisplacement",
1195 void Foam::snappyLayerDriver::growNoExtrusion
1200 List<extrudeMode>& extrudeStatus
1203 Info<<
nl <<
"Growing non-extrusion points by one layer ..." <<
endl;
1205 List<extrudeMode> grownExtrudeStatus(extrudeStatus);
1211 forAll(localFaces, facei)
1213 const face&
f = localFaces[facei];
1215 bool hasSqueeze =
false;
1218 if (extrudeStatus[
f[fp]] == NOEXTRUDE)
1232 extrudeStatus[
f[fp]] == EXTRUDE
1233 && grownExtrudeStatus[
f[fp]] != NOEXTRUDE
1236 grownExtrudeStatus[
f[fp]] = NOEXTRUDE;
1243 extrudeStatus.transfer(grownExtrudeStatus);
1252 status[i] = extrudeStatus[i];
1256 meshRefiner_.mesh(),
1264 extrudeStatus[i] = extrudeMode(status[i]);
1269 forAll(extrudeStatus, patchPointi)
1271 if (extrudeStatus[patchPointi] == NOEXTRUDE)
1273 patchDisp[patchPointi] =
Zero;
1274 patchNLayers[patchPointi] = 0;
1278 reduce(nGrown, sumOp<label>());
1280 Info<<
"Set displacement to zero for an additional " << nGrown
1281 <<
" points." <<
endl;
1285 void Foam::snappyLayerDriver::determineSidePatches
1287 const globalIndex& globalFaces,
1303 fvMesh&
mesh = meshRefiner_.mesh();
1312 Map<label> nbrProcToPatch;
1313 Map<label> patchToNbrProc;
1334 Info<<
nl <<
"Adding in total " << nAdded/2 <<
" inter-processor patches to" 1335 <<
" handle extrusion of non-manifold processor boundaries." 1342 Map<label> wantedToAddedPatch;
1344 for (label patchi = nOldPatches; patchi <
nPatches; patchi++)
1346 label nbrProci = patchToNbrProc[patchi];
1352 dictionary patchDict;
1353 patchDict.add(
"type", processorPolyPatch::typeName);
1355 patchDict.add(
"neighbProcNo", nbrProci);
1356 patchDict.add(
"nFaces", 0);
1364 label procPatchi = meshRefiner_.appendPatch
1371 wantedToAddedPatch.insert(patchi, procPatchi);
1377 label patchi = edgePatchID[i];
1378 const auto fnd = wantedToAddedPatch.cfind(patchi);
1381 edgePatchID[i] = fnd.val();
1391 void Foam::snappyLayerDriver::calculateLayerThickness
1395 const layerParameters& layerParams,
1398 const scalar edge0Len,
1405 const fvMesh&
mesh = meshRefiner_.mesh();
1419 minThickness = GREAT;
1425 expansionRatio = GREAT;
1427 for (
const label patchi :
patchIDs)
1431 forAll(meshPoints, patchPointi)
1435 firstLayerThickness[ppPointi] =
min 1437 firstLayerThickness[ppPointi],
1438 layerParams.firstLayerThickness()[patchi]
1440 finalLayerThickness[ppPointi] =
min 1442 finalLayerThickness[ppPointi],
1443 layerParams.finalLayerThickness()[patchi]
1445 totalThickness[ppPointi] =
min 1447 totalThickness[ppPointi],
1448 layerParams.thickness()[patchi]
1450 expRatio[ppPointi] =
min 1453 layerParams.expansionRatio()[patchi]
1455 minThickness[ppPointi] =
min 1457 minThickness[ppPointi],
1458 layerParams.minThickness()[patchi]
1467 firstLayerThickness,
1475 finalLayerThickness,
1521 maxPointLevel[
f[fp]] =
max(maxPointLevel[
f[fp]], ownLevel);
1549 for (
const label patchi :
patchIDs)
1553 layerParams.layerModels()[patchi];
1554 const bool relSize = layerParams.relativeSizes()[patchi];
1556 for (
const label meshPointi : meshPoints)
1563 edgeLen[ppPointi] =
min 1566 edge0Len/(1<<maxPointLevel[ppPointi])
1568 spec[ppPointi] =
max(spec[ppPointi], patchSpec);
1569 isRelativePoint[meshPointi] =
1570 isRelativePoint[meshPointi]
1595 orEqOp<unsigned int>(),
1612 finalLayerThickness[pointi] *= edgeLen[pointi];
1613 if (isRelativePoint[meshPointi])
1615 totalThickness[pointi] *= edgeLen[pointi];
1616 minThickness[pointi] *= edgeLen[pointi];
1619 else if (isRelativePoint[meshPointi])
1621 firstLayerThickness[pointi] *= edgeLen[pointi];
1622 finalLayerThickness[pointi] *= edgeLen[pointi];
1623 totalThickness[pointi] *= edgeLen[pointi];
1624 minThickness[pointi] *= edgeLen[pointi];
1627 thickness[pointi] =
min 1633 patchNLayers[pointi],
1634 firstLayerThickness[pointi],
1635 finalLayerThickness[pointi],
1636 totalThickness[pointi],
1640 expansionRatio[pointi] =
min 1642 expansionRatio[pointi],
1643 layerParameters::layerExpansionRatio
1646 patchNLayers[pointi],
1647 firstLayerThickness[pointi],
1648 finalLayerThickness[pointi],
1649 totalThickness[pointi],
1687 label maxPatchNameLen = 0;
1692 maxPatchNameLen =
max(maxPatchNameLen, label(patchName.size()));
1696 <<
setf(ios_base::left) <<
setw(maxPatchNameLen) <<
"patch" 1697 <<
setw(0) <<
" faces layers avg thickness[m]" <<
nl 1698 <<
setf(ios_base::left) <<
setw(maxPatchNameLen) <<
" " 1699 <<
setw(0) <<
" near-wall overall" <<
nl 1700 <<
setf(ios_base::left) <<
setw(maxPatchNameLen) <<
"-----" 1701 <<
setw(0) <<
" ----- ------ --------- -------" <<
endl;
1712 layerParams.layerModels()[patchi];
1714 scalar sumThickness = 0;
1715 scalar sumNearWallThickness = 0;
1716 label nMasterPoints = 0;
1718 forAll(meshPoints, patchPointi)
1720 label meshPointi = meshPoints[patchPointi];
1721 if (isMasterPoint[meshPointi])
1725 sumThickness += thickness[ppPointi];
1726 sumNearWallThickness += layerParams.firstLayerThickness
1729 patchNLayers[ppPointi],
1730 firstLayerThickness[ppPointi],
1731 finalLayerThickness[ppPointi],
1732 thickness[ppPointi],
1733 expansionRatio[ppPointi]
1739 label totNPoints =
returnReduce(nMasterPoints, sumOp<label>());
1742 scalar avgThickness = 0;
1743 scalar avgNearWallThickness = 0;
1750 avgNearWallThickness =
1759 <<
" " <<
setw(6) << layerParams.numLayers()[patchi]
1760 <<
" " <<
setw(8) << avgNearWallThickness
1761 <<
" " <<
setw(8) << avgThickness
1770 void Foam::snappyLayerDriver::syncPatchDisplacement
1776 List<extrudeMode>& extrudeStatus
1779 const fvMesh&
mesh = meshRefiner_.mesh();
1794 minMagSqrEqOp<vector>(),
1801 if (
mag(patchDisp[i]) < minThickness[i])
1819 labelList syncPatchNLayers(patchNLayers);
1832 forAll(syncPatchNLayers, i)
1834 if (syncPatchNLayers[i] != patchNLayers[i])
1863 forAll(syncPatchNLayers, i)
1865 if (syncPatchNLayers[i] != patchNLayers[i])
1901 void Foam::snappyLayerDriver::getPatchDisplacement
1910 List<extrudeMode>& extrudeStatus
1913 Info<<
nl <<
"Determining displacement for added points" 1914 <<
" according to pointNormal ..." <<
endl;
1916 const fvMesh&
mesh = meshRefiner_.mesh();
1931 patchDisp = thickness*pointNormals;
1934 label nNoVisNormal = 0;
1935 label nExtrudeRemove = 0;
2028 forAll(pointNormals, patchPointi)
2032 if (extrudeStatus[patchPointi] == NOEXTRUDE)
2035 patchNLayers[patchPointi] = 0;
2036 patchDisp[patchPointi] =
Zero;
2041 const vector&
n = pointNormals[patchPointi];
2047 Pout<<
"No valid normal for point " << meshPointi
2049 <<
"; setting displacement to " 2050 << patchDisp[patchPointi]
2054 extrudeStatus[patchPointi] = EXTRUDEREMOVE;
2061 forAll(extrudeStatus, patchPointi)
2063 if (extrudeStatus[patchPointi] == EXTRUDEREMOVE)
2072 label edgei = pEdges[i];
2074 label otherPointi =
pp.
edges()[edgei].otherVertex(patchPointi);
2076 if (extrudeStatus[otherPointi] != NOEXTRUDE)
2078 avg += localPoints[otherPointi] + patchDisp[otherPointi];
2087 Pout<<
"Displacement at illegal point " 2088 << localPoints[patchPointi]
2090 << (avg /
nPoints - localPoints[patchPointi])
2094 patchDisp[patchPointi] =
2096 - localPoints[patchPointi];
2109 <<
" points with point normal pointing through faces." <<
nl 2110 <<
"Reset displacement at " 2112 <<
" points to average of surrounding points." <<
endl;
2115 syncPatchDisplacement
2128 bool Foam::snappyLayerDriver::sameEdgeNeighbour
2131 const label myGlobalFacei,
2132 const label nbrGlobFacei,
2136 const labelList& eFaces = globalEdgeFaces[edgei];
2137 if (eFaces.size() == 2)
2139 return edge(myGlobalFacei, nbrGlobFacei) == edge(eFaces[0], eFaces[1]);
2146 void Foam::snappyLayerDriver::getVertexString
2152 const label myGlobFacei,
2153 const label nbrGlobFacei,
2158 label fp = fEdges.
find(edgei);
2171 label prevFp = fEdges.rcIndex(startFp);
2191 label nextFp = fEdges.fcIndex(endFp);
2225 Foam::label Foam::snappyLayerDriver::truncateDisplacement
2227 const globalIndex& globalFaces,
2231 const faceSet& illegalPatchFaces,
2234 List<extrudeMode>& extrudeStatus
2237 const fvMesh&
mesh = meshRefiner_.mesh();
2243 for (
const label facei : illegalPatchFaces)
2248 <<
"Faceset " << illegalPatchFaces.name()
2249 <<
" contains internal face " << facei <<
nl 2258 const auto fnd = meshPointMap.cfind(
f[fp]);
2261 const label patchPointi = fnd.val();
2263 if (extrudeStatus[patchPointi] != NOEXTRUDE)
2278 forAll(patchDisp, patchPointi)
2280 if (
mag(patchDisp[patchPointi]) < minThickness[patchPointi])
2296 else if (extrudeStatus[patchPointi] == NOEXTRUDE)
2299 patchDisp[patchPointi] =
Zero;
2300 patchNLayers[patchPointi] = 0;
2309 syncPatchDisplacement
2330 const face& localF = localFaces[i];
2335 extrudeMode prevMode = extrudeStatus[localF.prevLabel(0)];
2339 extrudeMode fpMode = extrudeStatus[localF[fp]];
2341 if (prevMode == NOEXTRUDE && fpMode != NOEXTRUDE)
2368 reduce(nPinched, sumOp<label>());
2370 Info<<
"truncateDisplacement : Unextruded " << nPinched
2371 <<
" faces due to non-consecutive vertices being extruded." <<
endl;
2394 label nButterFly = 0;
2396 DynamicList<label> stringedVerts;
2399 const labelList& globFaces = edgeGlobalFaces[edgei];
2401 if (globFaces.size() == 2)
2404 label myGlobalFacei = globalFaces.toGlobal
2406 pp.addressing()[myFacei]
2408 label nbrGlobalFacei =
2410 globFaces[0] != myGlobalFacei
2427 extrudeStatus[stringedVerts[0]] != NOEXTRUDE
2428 || extrudeStatus[stringedVerts.last()] != NOEXTRUDE
2433 for (label i = 1; i < stringedVerts.size()-1; i++)
2435 if (extrudeStatus[stringedVerts[i]] == NOEXTRUDE)
2466 reduce(nButterFly, sumOp<label>());
2468 Info<<
"truncateDisplacement : Unextruded " << nButterFly
2469 <<
" faces due to stringed edges with inconsistent extrusion." 2480 label nDiffering = 0;
2524 if (nPinched+nButterFly+nDiffering == 0)
2536 void Foam::snappyLayerDriver::setupLayerInfoTruncation
2540 const List<extrudeMode>& extrudeStatus,
2541 const label nBufferCellsNoExtrude,
2546 Info<<
nl <<
"Setting up information for layer truncation ..." <<
endl;
2548 const fvMesh&
mesh = meshRefiner_.mesh();
2550 if (nBufferCellsNoExtrude < 0)
2552 Info<<
nl <<
"Performing no layer truncation." 2553 <<
" nBufferCellsNoExtrude set to less than 0 ..." <<
endl;
2562 const label nPointLayers = patchNLayers[
f[fp]];
2563 if (nPointLayers > 0)
2565 if (nPatchFaceLayers[patchFacei] == -1)
2567 nPatchFaceLayers[patchFacei] = nPointLayers;
2571 nPatchFaceLayers[patchFacei] =
min 2573 nPatchFaceLayers[patchFacei],
2580 nPatchPointLayers = patchNLayers;
2583 forAll(nPatchFaceLayers, patchFacei)
2585 if (nPatchFaceLayers[patchFacei] == -1)
2587 nPatchFaceLayers[patchFacei] = 0;
2603 bool noExtrude =
false;
2608 if (extrudeStatus[
f[fp]] == NOEXTRUDE)
2612 mLevel =
max(mLevel, patchNLayers[
f[fp]]);
2622 nPatchFaceLayers[patchFacei] = 1;
2623 maxLevel[patchFacei] = mLevel;
2627 maxLevel[patchFacei] = mLevel;
2639 label nLevels =
gMax(patchNLayers);
2642 for (label ilevel = 1; ilevel < nLevels; ilevel++)
2648 nBuffer = nBufferCellsNoExtrude - 1;
2652 nBuffer = nBufferCellsNoExtrude;
2655 for (label ibuffer = 0; ibuffer < nBuffer + 1; ibuffer++)
2657 labelList tempCounter(nPatchFaceLayers);
2663 forAll(pointFaces[patchPointi], pointFacei)
2665 label facei = pointFaces[patchPointi][pointFacei];
2669 nPatchFaceLayers[facei] != -1
2670 && maxLevel[facei] > 0
2673 foundNeighbour[patchPointi] =
true;
2690 if (foundNeighbour[patchPointi])
2692 forAll(pointFaces[patchPointi], pointFacei)
2694 label facei = pointFaces[patchPointi][pointFacei];
2697 nPatchFaceLayers[facei] == -1
2698 && maxLevel[facei] > 0
2699 && ilevel < maxLevel[facei]
2702 tempCounter[facei] = ilevel;
2707 nPatchFaceLayers = tempCounter;
2713 if (nPatchFaceLayers[patchFacei] == -1)
2715 nPatchFaceLayers[patchFacei] = maxLevel[patchFacei];
2721 if (extrudeStatus[patchPointi] != NOEXTRUDE)
2723 forAll(pointFaces[patchPointi], pointFacei)
2725 label face = pointFaces[patchPointi][pointFacei];
2726 nPatchPointLayers[patchPointi] =
max 2728 nPatchPointLayers[patchPointi],
2729 nPatchFaceLayers[face]
2735 nPatchPointLayers[patchPointi] = 0;
2751 bool Foam::snappyLayerDriver::cellsUseFace
2753 const polyMesh&
mesh,
2760 const cell& cFaces =
mesh.
cells()[cellLabels[i]];
2764 if (faces.found(cFaces[cFacei]))
2778 Foam::label Foam::snappyLayerDriver::checkAndUnmark
2780 const addPatchCellLayer& addLayer,
2781 const dictionary& meshQualityDict,
2782 const bool additionalReporting,
2783 const List<labelPair>& baffles,
2785 const fvMesh& newMesh,
2789 List<extrudeMode>& extrudeStatus
2793 Info<<
nl <<
"Checking mesh with layer ..." <<
endl;
2794 faceSet wrongFaces(newMesh,
"wrongFaces", newMesh.nFaces()/1000);
2807 <<
" (concave, zero area or negative cell pyramid volume)" 2821 addLayer.layerFaces()
2829 const label nReportMax = 10;
2830 DynamicField<point> disabledFaceCentres(nReportMax);
2832 forAll(addedCells, oldPatchFacei)
2836 const labelList& fCells = addedCells[oldPatchFacei];
2838 if (cellsUseFace(newMesh, fCells, wrongFaces))
2852 if (additionalReporting && (nChanged < nReportMax))
2854 disabledFaceCentres.
append 2866 label nChangedTotal =
returnReduce(nChanged, sumOp<label>());
2868 if (additionalReporting)
2877 label nReportLocal = nChanged;
2878 if (nChangedTotal > nReportMax)
2893 Pout<<
"Checked mesh with layers. Disabled extrusion at " <<
endl;
2894 for (label i=0; i < nReportLocal; i++)
2896 Pout<<
" " << disabledFaceCentres[i] <<
endl;
2900 label nReportTotal =
returnReduce(nReportLocal, sumOp<label>());
2902 if (nReportTotal < nChangedTotal)
2904 Info<<
"Suppressed disabled extrusion message for other " 2905 << nChangedTotal - nReportTotal <<
" faces." <<
endl;
2909 return nChangedTotal;
2914 Foam::label Foam::snappyLayerDriver::countExtrusion
2917 const List<extrudeMode>& extrudeStatus
2921 label nExtruded = 0;
2927 const face& localFace = localFaces[i];
2931 if (extrudeStatus[localFace[fp]] != NOEXTRUDE)
2946 const polyMesh&
mesh,
2948 const List<labelPair>& baffles
2957 Map<label> baffleSet(4*baffles.size());
2960 baffleSet.insert(baffles[bafflei][0], bafflei);
2961 baffleSet.insert(baffles[bafflei][1], bafflei);
2965 List<labelPair> newBaffles(baffles.size(),
labelPair(-1, -1));
2973 label oldFacei = newToOldFaces[facei];
2975 const auto faceFnd = baffleSet.find(oldFacei);
2978 label bafflei = faceFnd();
2984 else if (
p[1] == -1)
2991 <<
"Problem:" << facei <<
" at:" 2993 <<
" is on same baffle as " <<
p[0]
3006 void Foam::snappyLayerDriver::getLayerCellsFaces
3008 const polyMesh&
mesh,
3009 const addPatchCellLayer& addLayer,
3019 faceRealThickness = 0;
3027 forAll(addedCells, oldPatchFacei)
3029 const labelList& added = addedCells[oldPatchFacei];
3031 const labelList& layer = layerFaces[oldPatchFacei];
3038 cellNLayers[added[i]] = layer.size()-1;
3043 forAll(layerFaces, oldPatchFacei)
3045 const labelList& layer = layerFaces[oldPatchFacei];
3046 const scalar realThickness = oldRealThickness[oldPatchFacei];
3052 for (label i = 1; i < layer.size(); i++)
3054 faceRealThickness[layer[i]] = realThickness;
3061 void Foam::snappyLayerDriver::printLayerData
3075 label maxPatchNameLen = 0;
3079 word patchName =
pbm[patchi].
name();
3080 maxPatchNameLen =
max(maxPatchNameLen, label(patchName.size()));
3084 <<
setf(ios_base::left) <<
setw(maxPatchNameLen) <<
"patch" 3085 <<
setw(0) <<
" faces layers overall thickness" <<
nl 3086 <<
setf(ios_base::left) <<
setw(maxPatchNameLen) <<
" " 3087 <<
setw(0) <<
" [m] [%]" <<
nl 3088 <<
setf(ios_base::left) <<
setw(maxPatchNameLen) <<
"-----" 3089 <<
setw(0) <<
" ----- ------ --- ---" <<
endl;
3095 const polyPatch&
pp =
pbm[patchi];
3097 label sumSize =
pp.size();
3101 label sumNLayers = 0;
3104 sumNLayers += cellNLayers[faceCells[i]];
3117 scalar sumRealThickness =
sum(patchReal);
3118 scalar sumFraction = 0;
3121 if (patchWanted[i] > VSMALL)
3123 sumFraction += (patchReal[i]/patchWanted[i]);
3128 reduce(sumSize, sumOp<label>());
3129 reduce(sumNLayers, sumOp<label>());
3130 reduce(sumRealThickness, sumOp<scalar>());
3131 reduce(sumFraction, sumOp<scalar>());
3134 scalar avgLayers = 0;
3136 scalar avgFraction = 0;
3139 avgLayers = scalar(sumNLayers)/sumSize;
3140 avgReal = sumRealThickness/sumSize;
3141 avgFraction = sumFraction/sumSize;
3146 <<
" " <<
setw(8) << sumSize
3147 <<
" " <<
setw(8) << avgLayers
3148 <<
" " <<
setw(8) << avgReal
3149 <<
" " <<
setw(8) << 100*avgFraction
3156 bool Foam::snappyLayerDriver::writeLayerSets
3166 forAll(cellNLayers, celli)
3168 if (cellNLayers[celli] > 0)
3173 cellSet addedCellSet(
mesh,
"addedCells", nAdded);
3174 forAll(cellNLayers, celli)
3176 if (cellNLayers[celli] > 0)
3178 addedCellSet.insert(celli);
3181 addedCellSet.instance() = meshRefiner_.timeName();
3184 <<
" added cells to cellSet " 3185 << addedCellSet.name() <<
endl;
3186 bool ok = addedCellSet.
write();
3187 allOk = allOk && ok;
3193 if (faceRealThickness[facei] > 0)
3199 faceSet layerFacesSet(
mesh,
"layerFaces", nAdded);
3202 if (faceRealThickness[facei] > 0)
3204 layerFacesSet.insert(facei);
3207 layerFacesSet.instance() = meshRefiner_.timeName();
3210 <<
" faces inside added layer to faceSet " 3211 << layerFacesSet.name() <<
endl;
3212 bool ok = layerFacesSet.
write();
3213 allOk = allOk && ok;
3219 bool Foam::snappyLayerDriver::writeLayerData
3232 bool ok = writeLayerSets(
mesh, cellNLayers, faceRealThickness);
3233 allOk = allOk && ok;
3254 fixedValueFvPatchScalarField::typeName
3258 fld[celli] = cellNLayers[celli];
3266 const polyPatch&
pp =
pbm[patchi];
3271 pfld[i] = cellNLayers[faceCells[i]];
3273 fldBf[patchi] == pfld;
3277 bool ok =
fld.write();
3278 allOk = allOk && ok;
3294 fixedValueFvPatchScalarField::typeName
3301 fldBf[patchi] ==
pbm[patchi].patchSlice(faceRealThickness);
3305 bool ok =
fld.write();
3306 allOk = allOk && ok;
3313 "thicknessFraction",
3322 fixedValueFvPatchScalarField::typeName
3343 if (patchWanted[i] > VSMALL)
3345 pfld[i] = patchReal[i]/patchWanted[i];
3349 fldBf[patchi] == pfld;
3352 <<
" : overall layer thickness (fraction" 3353 <<
" of desired thickness)" <<
endl;
3354 bool ok =
fld.write();
3355 allOk = allOk && ok;
3364 void Foam::snappyLayerDriver::dupFaceZonePoints
3368 List<labelPair> baffles,
3373 fvMesh&
mesh = meshRefiner_.mesh();
3382 autoPtr<indirectPrimitivePatch>
pp 3396 label nIdealTotAddedCells = 0;
3397 List<extrudeMode> extrudeStatus(
pp().
nPoints(), EXTRUDE);
3412 syncPatchDisplacement
3426 forAll(extrudeStatus, patchPointi)
3429 minPatchState[pointi] = extrudeStatus[patchPointi];
3447 forAll(minPatchState, pointi)
3449 label state = minPatchState[pointi];
3450 if (state == EXTRUDE || state == EXTRUDEREMOVE)
3455 candidatePoints.setSize(
n);
3457 forAll(minPatchState, pointi)
3459 label state = minPatchState[pointi];
3460 if (state == EXTRUDE || state == EXTRUDEREMOVE)
3462 candidatePoints[
n++] = pointi;
3480 bool hasInfo = meshRefiner_.getFaceZoneInfo
3487 if (hasInfo && !layerIDs.found(mpi) && !layerIDs.found(spi))
3489 nonDupZones.append(zonei);
3501 const localPointRegion regionSide(
mesh, nonDupBaffles, candidatePoints);
3503 autoPtr<mapPolyMesh> map = meshRefiner_.dupNonManifoldPoints
3513 const labelList& pointMap = map().pointMap();
3514 const labelList& reversePointMap = map().reversePointMap();
3518 label oldPointi = pointMap[pointi];
3519 label newMasterPointi = reversePointMap[oldPointi];
3521 if (newMasterPointi != pointi)
3524 pointToMaster[pointi] = newMasterPointi;
3525 pointToMaster[newMasterPointi] = newMasterPointi;
3531 const labelList& reverseFaceMap = map().reverseFaceMap();
3534 label f0 = reverseFaceMap[baffles[i].first()];
3535 label f1 = reverseFaceMap[baffles[i].second()];
3544 Info<<
"Writing point-duplicate mesh to time " 3545 << meshRefiner_.timeName() <<
endl;
3561 /
"duplicatePoints_" 3562 + meshRefiner_.timeName()
3565 Info<<
"Writing point-duplicates to " << str.name() <<
endl;
3569 label newMasteri = reversePointMap[pointMap[pointi]];
3571 if (newMasteri != pointi)
3573 str.writeLine(
p[pointi],
p[newMasteri]);
3581 void Foam::snappyLayerDriver::mergeFaceZonePoints
3592 fvMesh&
mesh = meshRefiner_.mesh();
3595 label nPointPairs = 0;
3596 forAll(pointToMaster, pointi)
3598 label otherPointi = pointToMaster[pointi];
3599 if (otherPointi != -1)
3604 reduce(nPointPairs, sumOp<label>());
3605 if (nPointPairs > 0)
3608 Info<<
"Merging " << nPointPairs <<
" duplicated points ..." <<
endl;
3616 + meshRefiner_.timeName()
3619 Info<<
"Points to be merged to " << str.name() <<
endl;
3620 forAll(pointToMaster, pointi)
3622 label otherPointi = pointToMaster[pointi];
3623 if (otherPointi != -1)
3627 str.writeLine(pt, otherPt);
3633 autoPtr<mapPolyMesh> map = meshRefiner_.mergePoints(pointToMaster);
3638 const labelList& reverseFaceMap = map().reverseFaceMap();
3642 Info<<
"Merged points in = " 3650 Info<<
"Converting baffles back into zoned faces ..." 3653 autoPtr<mapPolyMesh> map = meshRefiner_.mergeZoneBaffles
3668 forAll(newFaceRealThickness, facei)
3670 label oldFacei =
faceMap[facei];
3673 scalar& realThick = newFaceRealThickness[facei];
3674 realThick =
max(realThick, faceRealThickness[oldFacei]);
3675 scalar& wanted = newFaceWantedThickness[facei];
3676 wanted =
max(wanted, faceWantedThickness[oldFacei]);
3679 faceRealThickness.transfer(newFaceRealThickness);
3680 faceWantedThickness.transfer(newFaceWantedThickness);
3683 Info<<
"Converted baffles in = " 3684 << meshRefiner_.mesh().time().cpuTimeIncrement()
3690 Foam::label Foam::snappyLayerDriver::setPointNumLayers
3692 const layerParameters& layerParams,
3701 List<extrudeMode>& extrudeStatus
3704 fvMesh&
mesh = meshRefiner_.mesh();
3707 patchDisp =
vector(GREAT, GREAT, GREAT);
3712 patchNLayers =
Zero;
3715 label nIdealTotAddedCells = 0;
3719 extrudeStatus = EXTRUDE;
3743 handleNonStringConnected
3773 layerParams.featureAngle(),
3784 if (!layerParams.relativeSizes().found(
false))
3787 const scalar edge0Len =
3788 meshRefiner_.meshCutter().level0EdgeLength();
3789 const labelList& cellLevel = meshRefiner_.meshCutter().cellLevel();
3794 layerParams.maxFaceThicknessRatio(),
3795 layerParams.relativeSizes(),
3820 for (label i = 0; i < layerParams.nGrow(); i++)
3830 return nIdealTotAddedCells;
3835 Foam::snappyLayerDriver::makeMeshMover
3837 const layerParameters& layerParams,
3838 const dictionary& motionDict,
3846 fvMesh&
mesh = meshRefiner_.mesh();
3850 dictionary combinedDict(layerParams.dict());
3852 combinedDict.
merge(motionDict);
3854 combinedDict.add(
"minThicknessName", minThickness.name());
3856 const List<labelPair> internalBaffles
3868 autoPtr<Foam::externalDisplacementMeshMover> medialAxisMoverPtr
3872 layerParams.meshShrinker(),
3885 if (errorMsg.size() || IOerrorMsg.size())
3894 <<
"Missing/incorrect required dictionary entries:" 3896 << IOerrorMsg.c_str() <<
nl 3897 << errorMsg.c_str() <<
nl <<
nl 3898 <<
"Exiting dry-run" <<
nl <<
endl;
3902 Perr<<
"\nFOAM parallel run exiting\n" <<
endl;
3912 return medialAxisMoverPtr;
3919 const label nLayerIter,
3923 const label nRelaxedIter,
3924 const label nAllowableErrors,
3930 const label nIdealTotAddedCells,
3971 makeLayerDisplacementField
3995 for (label iteration = 0; iteration < nLayerIter; iteration++)
3998 <<
"Layer addition iteration " << iteration <<
nl 3999 <<
"--------------------------" <<
endl;
4005 iteration < nRelaxedIter
4007 : motionDict.
subDict(
"relaxed")
4010 if (iteration >= nRelaxedIter)
4012 Info<<
"Switched to relaxed meshQuality constraints." <<
endl;
4021 syncPatchDisplacement
4031 getPatchDisplacement
4052 patchDisp = -patchDisp;
4071 combinedDict.
merge(motionDict);
4073 combinedDict.merge(meshQualityDict);
4075 combinedDict.add(
"minThicknessName", minThickness.
name());
4078 medialAxisMoverPtr().move
4098 truncateDisplacement
4123 Info<<
"Writing shrunk mesh to time " 4124 << meshRefiner_.timeName() <<
endl;
4154 setupLayerInfoTruncation
4168 forAll(nPatchPointLayers, i)
4172 nPatchPointLayers[i],
4175 finalDisp[i] = ratio*patchDisp[i];
4179 const scalarField invExpansionRatio(1.0/expansionRatio);
4214 savedMeshMod = meshMod;
4236 fvMesh& newMesh = *newMeshPtr;
4240 addProfiling(grow,
"snappyHexMesh::layers::updateMesh");
4273 avgPointData(
pp,
mag(patchDisp))(),
4281 label nAddedCells = 0;
4282 forAll(cellNLayers, celli)
4284 if (cellNLayers[celli] > 0)
4293 Info<<
"Writing layer mesh to time " << meshRefiner_.timeName()
4296 writeLayerSets(newMesh, cellNLayers, faceRealThickness);
4315 facei < newMesh.
nFaces();
4319 label newMeshFacei = map.
faceMap()[facei];
4320 if (newMeshFacei != -1)
4322 meshToNewMesh[newMeshFacei] = facei;
4333 meshToNewMesh[
p[0]],
4336 if (newMeshBaffle[0] != -1 && newMeshBaffle[1] != -1)
4338 newMeshBaffles[newi++] = newMeshBaffle;
4352 <<
" baffles across faceZones of type internal" <<
nl 4356 label nTotChanged = checkAndUnmark
4370 label nTotExtruded = countExtrusion(
pp, extrudeStatus);
4374 Info<<
"Extruding " << nTotExtruded
4375 <<
" out of " << nTotFaces
4376 <<
" faces (" << 100.0*nTotExtruded/nTotFaces <<
"%)." 4377 <<
" Removed extrusion at " << nTotChanged <<
" faces." 4379 <<
"Added " << nTotAddedCells <<
" out of " 4380 << nIdealTotAddedCells
4381 <<
" cells (" << 100.0*nTotAddedCells/nIdealTotAddedCells
4384 if (nTotChanged == 0)
4392 medialAxisMoverPtr().movePoints(
mesh.
points());
4398 for (label i = 0; i < layerParams.
nGrow(); i++)
4414 void Foam::snappyLayerDriver::mapFaceZonePoints
4416 const mapPolyMesh& map,
4421 fvMesh&
mesh = meshRefiner_.mesh();
4429 DynamicList<label> candidates(baffles.size()*4);
4438 Map<label> oldFaceToBaffle(2*baffles.size());
4442 oldFaceToBaffle.insert(baffle[0], i);
4443 oldFaceToBaffle.insert(baffle[1], i);
4455 const label oldFacei = map.faceMap()[facei];
4456 const auto iter = oldFaceToBaffle.find(oldFacei);
4457 if (oldFacei != -1 && iter.good())
4459 const label bafflei = iter();
4460 auto& newBaffle = newBaffles[bafflei];
4461 if (newBaffle[0] == -1)
4463 newBaffle[0] = facei;
4465 else if (newBaffle[1] == -1)
4467 newBaffle[1] = facei;
4473 <<
" already maps to baffle faces:" 4476 <<
" and " << newBaffle[1]
4484 label pointi =
f[fp];
4485 label oldPointi = map.pointMap()[pointi];
4487 if (pointToMaster[oldPointi] != -1)
4489 candidates.
append(pointi);
4501 const labelPair& newBaffle = newBaffles[i];
4502 if (newBaffle[0] != -1 && newBaffle[1] != -1)
4504 newBaffles[
n++] = newBaffle;
4509 baffles.transfer(newBaffles);
4522 UIndirectList<point>(
mesh.
points(), candidates),
4523 meshRefiner_.mergeDistance(),
4539 const labelList& oldPoints = newToOld[newi];
4540 if (oldPoints.size() > 1)
4546 label masteri =
min(meshPoints);
4549 pointToMaster[meshPoints[i]] = masteri;
4557 void Foam::snappyLayerDriver::updatePatch
4560 const mapPolyMesh& map,
4561 autoPtr<indirectPrimitivePatch>&
pp,
4567 fvMesh&
mesh = meshRefiner_.mesh();
4569 autoPtr<indirectPrimitivePatch> newPp
4579 newToOldPatchPoints.setSize(newPp().
nPoints());
4580 newToOldPatchPoints = -1;
4583 const labelList& newMeshPoints = newPp().meshPoints();
4587 const label newMeshPointi = newMeshPoints[
newPointi];
4588 const label oldMeshPointi =
4589 map.pointMap()[newMeshPointi];
4590 const auto iter = baseMap.find(oldMeshPointi);
4593 newToOldPatchPoints[
newPointi] = iter();
4602 pp = std::move(newPp);
4612 Foam::snappyLayerDriver::snappyLayerDriver
4620 meshRefiner_(meshRefiner),
4621 globalToMasterPatch_(globalToMasterPatch),
4622 globalToSlavePatch_(globalToSlavePatch),
4644 <<
"Merging all faces of a cell" <<
nl 4645 <<
"---------------------------" <<
nl 4646 <<
" - which are on the same patch" <<
nl 4647 <<
" - which make an angle < " << planarAngle
4649 <<
" (cos:" << minCos <<
')' <<
nl 4650 <<
" - as long as the resulting face doesn't become concave" 4653 <<
" (0=straight, 180=fully concave)" <<
nl 4664 duplicateFace[cpl[0]] = cpl[1];
4665 duplicateFace[cpl[1]] = cpl[0];
4668 label nChanged = meshRefiner_.mergePatchFacesUndo
4672 meshRefiner_.meshedPatches(),
4678 nChanged += meshRefiner_.mergeEdgesUndo(minCos, motionDict);
4687 const label nAllowableErrors,
4695 const scalar edge0Len = meshRefiner_.meshCutter().level0EdgeLength();
4703 internalOrBaffleFaceZones = meshRefiner_.getZones(fzTypes);
4710 meshRefiner_.getZones
4725 meshRefiner_.createZoneBaffles
4735 Info<<
"Writing baffled mesh to time " 4736 << meshRefiner_.timeName() <<
endl;
4760 label f0 = reverseFaceMap[baffles[i].first()];
4761 label f1 = reverseFaceMap[baffles[i].second()];
4780 bool hasInfo = meshRefiner_.getFaceZoneInfo
4790 if (layerIDs.
found(mpi) && !layerIDs.
found(spi))
4794 <<
" adding layers to master patch " <<
pbm[mpi].
name()
4795 <<
" only. Freezing points on slave patch " 4799 else if (!layerIDs.
found(mpi) && layerIDs.
found(spi))
4803 <<
" adding layers to slave patch " <<
pbm[spi].
name()
4804 <<
" only. Freezing points on master patch " 4879 const label nIdealTotAddedCells = setPointNumLayers
4901 meshRefiner_.timeName(),
4909 calculateLayerThickness
4914 meshRefiner_.meshCutter().cellLevel(),
4932 avgPointData(
pp(), baseThickness);
4940 (basePatchNLayers+layerParams.
nOuterIter()-1)
4948 for (label layeri = 0; layeri < layerParams.
nOuterIter(); layeri++)
4960 const label nToAdd =
gSum(deltaNLayers);
4963 Info<<
"Outer iteration : " << layeri
4964 <<
" to add in current iteration : " << nToAdd <<
endl;
4979 determineSidePatches
5016 forAll(baseThickness, pointi)
5020 basePatchNLayers[pointi],
5021 baseThickness[pointi],
5022 baseExpansionRatio[pointi],
5023 basePatchNLayers[pointi]
5024 -nAddedLayers[pointi]
5025 -patchNLayers[pointi],
5026 patchNLayers[pointi]
5054 nIdealTotAddedCells,
5080 sliceFaceRealThickness
5085 const label nTotalAdded =
gSum(patchNLayers);
5088 Info<<
"Outer iteration : " << layeri
5089 <<
" added in current iteration : " << nTotalAdded
5090 <<
" out of : " <<
gSum(deltaNLayers) <<
endl;
5092 if (nTotalAdded == 0)
5099 forAll(patchNLayers, pointi)
5101 nAddedLayers[pointi] += patchNLayers[pointi];
5103 if (patchNLayers[pointi] == 0)
5114 basePatchNLayers[pointi] = nAddedLayers[pointi];
5115 deltaNLayers[pointi] = 0;
5123 deltaNLayers[pointi] =
max 5128 deltaNLayers[pointi],
5129 basePatchNLayers[pointi] - nAddedLayers[pointi]
5166 meshRefiner_.updateMesh(map,
labelList(0));
5169 cellNLayers.setSize(map.
nOldCells(), 0);
5178 cellNLayers[i] += sliceCellNLayers[i];
5188 faceRealThickness += sliceFaceRealThickness;
5204 faceWantedThickness,
5213 Info<<
"Writing mesh with layers but disconnected to time " 5214 << meshRefiner_.timeName() <<
endl;
5229 mapFaceZonePoints(map, baffles, pointToMaster);
5233 updatePatch(
patchIDs, map,
pp, newToOldPatchPoints);
5249 newToOldPatchPoints,
5250 vector::uniform(-1),
5255 newToOldPatchPoints,
5261 newToOldPatchPoints,
5262 extrudeMode::NOEXTRUDE,
5267 newToOldPatchPoints,
5273 newToOldPatchPoints,
5279 newToOldPatchPoints,
5285 newToOldPatchPoints,
5291 newToOldPatchPoints,
5315 <<
"Doing final balancing" <<
nl 5316 <<
"---------------------" <<
nl 5335 map().distributeCellData(cellNLayers);
5336 map().distributeFaceData(faceWantedThickness);
5337 map().distributeFaceData(faceRealThickness);
5351 faceWantedThickness,
5364 const bool preBalance,
5373 <<
"Shrinking and layer addition phase" <<
nl 5374 <<
"----------------------------------" <<
nl 5378 Info<<
"Using mesh parameters " << motionDict <<
nl <<
endl;
5383 mergeType == meshRefinement::FaceMergeType::GEOMETRIC
5384 || mergeType == meshRefinement::FaceMergeType::IGNOREPATCH
5387 mergePatchFacesUndo(layerParams, motionDict, mergeType);
5396 label nFacesWithLayers = 0;
5397 forAll(numLayers, patchi)
5399 if (numLayers[patchi] > 0)
5411 <<
"Ignoring layers on coupled patch " <<
pp.name()
5423 meshRefiner_.getFaceZoneInfo(fZones[zonei].
name(), mpi, spi, fzType);
5425 if (numLayers[mpi] > 0)
5427 nFacesWithLayers += fZones[zonei].
size();
5429 if (numLayers[spi] > 0)
5431 nFacesWithLayers += fZones[zonei].
size();
5440 Info<<
nl <<
"No layers to generate ..." <<
endl;
5445 checkMeshManifold();
5448 Info<<
"Checking initial mesh ..." <<
endl;
5457 Info<<
"Detected " << nInitErrors <<
" illegal faces" 5458 <<
" (concave, zero area or negative cell pyramid volume)" 5462 bool faceZoneOnCoupledFace =
false;
5476 const faceZone& fZone = fZones[zonei];
5481 meshRefiner_.getFaceZoneInfo(fzName, mpi, spi, fzType);
5483 if (numLayers[mpi] > 0 || numLayers[spi])
5485 isExtrudedZoneFace.set(fZone);
5502 if (intOrCoupled[facei] && isExtrudedZoneFace.
test(facei))
5504 faceZoneOnCoupledFace =
true;
5519 <<
"Doing initial balancing" <<
nl 5520 <<
"-----------------------" <<
nl 5524 forAll(numLayers, patchi)
5526 if (numLayers[patchi] > 0)
5531 cellWeights[
pp.faceCells()[i]] += numLayers[patchi];
5540 const faceZone& fZone = fZones[zonei];
5545 meshRefiner_.getFaceZoneInfo(fzName, mpi, spi, fzType);
5547 if (numLayers[mpi] > 0)
5556 cellWeights[
cellIDs[i]] += numLayers[mpi];
5560 if (numLayers[spi] > 0)
5567 cellWeights[
cellIDs[i]] += numLayers[mpi];
const labelListList & pointEdges() const
Return point-edge addressing.
static bool checkMesh(const bool report, const polyMesh &mesh, const dictionary &dict, labelHashSet &wrongFaces, const bool dryRun=false)
Check mesh with mesh settings in dict. Collects incorrect faces.
virtual const fileName & name() const
Get the name of the output serial stream. (eg, the name of the Fstream file name) ...
const polyBoundaryMesh & pbm
prefixOSstream Perr
OSstream wrapped stderr (std::cerr) with parallel prefix.
void clearOut()
Clear all geometry and addressing.
label nPoints() const
Number of points supporting patch faces.
const List< face_type > & localFaces() const
Return patch faces addressing into local point list.
void size(const label n)
Older name for setAddressableSize.
const labelList patchIDs(pbm.patchSet(polyPatchNames, false, true).sortedToc())
#define addProfiling(name, descr)
Define profiling trigger with specified name and description string.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1)
fileName path() const
Return path.
Simple container to keep together layer specific information.
Ostream & indent(Ostream &os)
Indent stream.
label nOldCells() const
Number of old cells.
const labelList & cellMap() const
Old cell map.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
virtual int precision() const
Get precision of output field.
const Field< point_type > & localPoints() const
Return pointField of points in patch.
label nPoints() const noexcept
Number of mesh points.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
scalar concaveAngle() const
void append(const T &val)
Append an element at the end of the list.
label find(const T &val, label pos=0) const
Find index of the first occurrence of the value.
bool found(const Key &key) const
Same as contains()
const word & name() const noexcept
Return the object name.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const labelListList & pointEdges() const
static const pointMesh & New(const polyMesh &mesh, Args &&... args)
Get existing or create a new MeshObject. Registered with typeName.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Unit conversion functions.
constexpr char nl
The newline '\n' character (0x0a)
void inplaceReorder(const labelUList &oldToNew, ListType &input, const bool prune=false)
Inplace reorder the elements of a list.
UIndirectList< label > labelUIndList
UIndirectList of labels.
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
static word newName(const label myProcNo, const label neighbProcNo)
Return the name of a processorPolyPatch.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const labelList & patchID() const
Per boundary face label the patch index.
virtual void movePoints(const pointField &)
Move points, returns volumes swept by faces in motion.
static void calcExtrudeInfo(const bool zoneFromAnyFace, const polyMesh &, const globalIndex &globalFaces, const labelListList &globalEdgeFaces, const indirectPrimitivePatch &pp, labelList &edgePatchID, label &nPatches, Map< label > &nbrProcToPatch, Map< label > &patchToNbrProc, labelList &edgeZoneID, boolList &edgeFlip, labelList &inflateFaceID)
Determine extrude information per patch edge:
static bool & parRun() noexcept
Test if this a parallel run.
scalar mergePatchFacesAngle() const
const labelList & masterCells() const
Return labels of master cells (cells next to the master face zone in the prescribed direction) ...
static writeType writeLevel()
Get/set write level.
static void reduceOr(bool &value, const label communicator=worldComm)
Logical (or) reduction (MPI_AllReduce)
GeometricField< vector, pointPatchField, pointMesh > pointVectorField
label nBufferCellsNoExtrude() const
Create buffer region for new layer terminations.
labelRange range() const noexcept
The face range for all boundary faces.
List< labelPair > labelPairList
List of labelPair.
const cellList & cells() const
GeometricBoundaryField< scalar, fvPatchField, volMesh > Boundary
Type of boundary fields.
const dictionary & dict() const
static List< labelPair > subsetBaffles(const polyMesh &mesh, const labelList &zoneIDs, const List< labelPair > &baffles)
Subset baffles according to zones.
Ignore writing from objectRegistry::writeObject()
IOField< scalar > scalarIOField
IO for a Field of scalar.
const dimensionSet dimless
Dimensionless.
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
const Time & time() const
Return the top-level database.
label nFaces() const noexcept
Number of mesh faces.
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
A PrimitivePatch with an IndirectList for the faces, const reference for the point field...
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
List< labelList > labelListList
List of labelList.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
bool hasMotionPoints() const
Has valid preMotionPoints?
const labelList & numLayers() const
How many layers to add.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
bool isInternalFace(const label faceIndex) const noexcept
Return true if given face label is internal to the mesh.
void setSize(const label n)
Dummy function, to make FixedList consistent with List.
const labelList & meshPoints() const
Return labelList of mesh points in patch.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
static labelPairList findDuplicateFacePairs(const polyMesh &)
Helper routine to find all baffles (two boundary faces.
virtual const pointField & points() const
Return raw points.
label nRelaxedIter() const
Number of iterations after which relaxed motion rules.
#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...
label mergePoints(const PointList &points, labelList &pointToUnique, labelList &uniquePoints, const scalar mergeTol=SMALL, const bool verbose=false)
Calculate merge mapping, preserving the original point order. All points closer/equal mergeTol are to...
GeometricField< scalar, fvPatchField, volMesh > volScalarField
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
virtual void movePoints(const Field< point_type > &)
Correct patch after moving points.
const Field< point_type > & faceNormals() const
Return face unit normals for patch.
List< face > faceList
List of faces.
pointField vertices(const blockVertexList &bvl)
static void updateList(const labelList &newToOld, const T &nullValue, List< T > &elems)
Helper: reorder list according to map.
bool merge(const dictionary &dict)
Merge entries from the given dictionary.
A list of faces which address into the list of points.
Omanip< int > setprecision(const int i)
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator). It is 1 for serial run. ...
Sends/receives parts of mesh+fvfields to neighbouring processors. Used in load balancing.
bool additionalReporting() const
Any additional reporting requested?
const Map< label > & meshPointMap() const
Mesh point map.
vectorField pointField
pointField is a vectorField.
const dimensionedScalar e
Elementary charge.
void setSize(const label n)
Alias for resize()
virtual void updateMesh(const mapPolyMesh &mpm)
Update mesh corresponding to the given map.
FaceMergeType
Enumeration for what to do with co-planar patch faces on a single.
static void exit(int errNo=1)
Shutdown (finalize) MPI as required and exit program with errNo.
Type gSum(const FieldField< Field, Type > &f)
dimensionedScalar cos(const dimensionedScalar &ds)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
autoPtr< mapPolyMesh > makeMesh(autoPtr< Type > &newMesh, const IOobject &io, const polyMesh &mesh, const labelUList &patchMap, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
Create new mesh with old mesh patches. Additional dictionaries.
labelListList invertOneToMany(const label len, const labelUList &map)
Invert one-to-many map. Unmapped elements will be size 0.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
void clear()
Clear the list, i.e. set size to zero.
Adds layers of cells to outside of polyPatch. Can optionally create stand-alone extruded mesh (addToM...
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
label size() const noexcept
The number of entries in the list.
string message() const
The accumulated error message.
const Field< point_type > & faceCentres() const
Return face centres for patch.
virtual const labelList & faceOwner() const
Return face owner.
Reading is optional [identical to LAZY_READ].
static void setDisplacement(const labelList &patchIDs, const indirectPrimitivePatch &pp, pointField &patchDisp, pointVectorField &displacement)
Set displacement field from displacement on patch points.
label nOuterIter() const
Outer loop to add layer by layer. Can be set to >= max layers.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
const labelListList & edgeFaces() const
Return edge-face addressing.
Smanip< ios_base::fmtflags > setf(const ios_base::fmtflags flags)
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
Abstract base class for domain decomposition.
label nInternalFaces() const noexcept
Number of internal faces.
const Field< point_type > & points() const noexcept
Return reference to global points.
void shrink()
Shrink storage (does not remove any elements; just compacts dynamic lists.
virtual const faceList & faces() const
Return raw faces.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
void setRefinement(const globalIndex &globalFaces, const labelListList &globalEdgeFaces, const scalarField &expansionRatio, const indirectPrimitivePatch &pp, const bitSet &flip, const labelList &sidePatchID, const labelList &sideZoneID, const boolList &sideFlip, const labelList &inflateFaceID, const labelList &exposedPatchID, const labelList &nFaceLayers, const labelList &nPointLayers, const vectorField &firstLayerDisp, polyTopoChange &meshMod)
Play commands into polyTopoChange to create layers on top.
errorManip< error > abort(error &err)
label nEdges() const
Number of mesh edges.
bool test(const label pos) const
Test for True value at specified position, never auto-vivify entries.
virtual bool write(const bool writeOnProc=true) const
Write mesh using IO settings from time.
label nLayerIter() const
Number of overall layer addition iterations.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO...
OSstream & stream(OSstream *alternative=nullptr)
Return OSstream for output operations. Use the alternative stream for serial-only output if it is a v...
const labelListList & pointFaces() const
Return point-face addressing.
Istream and Ostream manipulators taking arguments.
static scalar finalLayerThicknessRatio(const label nLayers, const scalar expansionRatio)
Determine ratio of final layer thickness to.
static word timeName(const scalar t, const int precision=precision_)
Return time name of given scalar time formatted with the given precision.
int debug
Static debugging option.
Pair< label > labelPair
A pair of labels.
Type gMax(const FieldField< Field, Type > &f)
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
void doLayers(const dictionary &shrinkDict, const dictionary &motionDict, const layerParameters &layerParams, const meshRefinement::FaceMergeType mergeType, const bool preBalance, decompositionMethod &decomposer, fvMeshDistribute &distributor)
Add layers according to the dictionary settings.
defineTypeNameAndDebug(combustionModel, 0)
void mergePatchFacesUndo(const layerParameters &layerParams, const dictionary &motionDict, const meshRefinement::FaceMergeType mergeType)
Merge patch faces on same cell.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
const labelList & slaveCells() const
Return labels of slave cells.
static autoPtr< indirectPrimitivePatch > makePatch(const polyMesh &, const labelList &)
Create patch from set of patches.
Info<< "Finished reading KIVA file"<< endl;cellShapeList cellShapes(nPoints);labelList cellZoning(nPoints, -1);const cellModel &hex=cellModel::ref(cellModel::HEX);labelList hexLabels(8);label activeCells=0;labelList pointMap(nPoints);forAll(pointMap, i){ pointMap[i]=i;}for(label i=0;i< nPoints;i++){ if(f[i] > 0.0) { hexLabels[0]=i;hexLabels[1]=i1tab[i];hexLabels[2]=i3tab[i1tab[i]];hexLabels[3]=i3tab[i];hexLabels[4]=i8tab[i];hexLabels[5]=i1tab[i8tab[i]];hexLabels[6]=i3tab[i1tab[i8tab[i]]];hexLabels[7]=i3tab[i8tab[i]];cellShapes[activeCells].reset(hex, hexLabels);edgeList edges=cellShapes[activeCells].edges();forAll(edges, ei) { if(edges[ei].mag(points)< SMALL) { label start=pointMap[edges[ei].start()];while(start !=pointMap[start]) { start=pointMap[start];} label end=pointMap[edges[ei].end()];while(end !=pointMap[end]) { end=pointMap[end];} label minLabel=min(start, end);pointMap[start]=pointMap[end]=minLabel;} } cellZoning[activeCells]=idreg[i];activeCells++;}}cellShapes.setSize(activeCells);cellZoning.setSize(activeCells);forAll(cellShapes, celli){ cellShape &cs=cellShapes[celli];forAll(cs, i) { cs[i]=pointMap[cs[i]];} cs.collapse();}label bcIDs[11]={-1, 0, 2, 4, -1, 5, -1, 6, 7, 8, 9};const label nBCs=12;const word *kivaPatchTypes[nBCs]={ &wallPolyPatch::typeName, &wallPolyPatch::typeName, &wallPolyPatch::typeName, &wallPolyPatch::typeName, &symmetryPolyPatch::typeName, &wedgePolyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &symmetryPolyPatch::typeName, &oldCyclicPolyPatch::typeName};enum patchTypeNames{ PISTON, VALVE, LINER, CYLINDERHEAD, AXIS, WEDGE, INFLOW, OUTFLOW, PRESIN, PRESOUT, SYMMETRYPLANE, CYCLIC};const char *kivaPatchNames[nBCs]={ "piston", "valve", "liner", "cylinderHead", "axis", "wedge", "inflow", "outflow", "presin", "presout", "symmetryPlane", "cyclic"};List< SLList< face > > pFaces[nBCs]
double cpuTimeIncrement() const
Return CPU time (in seconds) since last call to cpuTimeIncrement()
const labelList & faceMap() const
Old face map.
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;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Helper class which maintains intersections of (changing) mesh with (static) surfaces.
void updateMesh(const mapPolyMesh &, const labelList &faceMap, const labelList &pointMap)
Update any locally stored mesh information. Gets additional.
bool moving() const noexcept
Is mesh moving.
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
thicknessModelType
Enumeration defining the layer specification:
const vectorField & faceCentres() const
List< word > wordList
List of word.
label nGrow() const
If points get not extruded do nGrow layers of connected faces.
vector point
Point is a vector.
void setInstance(const fileName &instance, const IOobjectOption::writeOption wOpt=IOobject::AUTO_WRITE)
Set the instance for mesh files.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
#define WarningInFunction
Report a warning using Foam::Warning.
const word & name() const
Return reference to name.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
label nCells() const noexcept
Number of mesh cells.
void merge(HashTable< T, Key, Hash > &source)
Attempts to extract entries from source parameter and insert them into this, does not overwrite exist...
labelList meshEdges(const edgeList &allEdges, const labelListList &cellEdges, const labelList &faceCells) const
Return labels of patch edges in the global edge list using cell addressing.
Mesh data needed to do the Finite Volume discretisation.
A List with indirect addressing. Like IndirectList but does not store addressing. ...
Direct mesh changes based on v1.3 polyTopoChange syntax.
const polyBoundaryMesh & patches
const word & name() const noexcept
The zone name.
static autoPtr< externalDisplacementMeshMover > New(const word &type, const dictionary &dict, const List< labelPair > &baffles, pointVectorField &pointDisplacement, const bool dryRun=false)
Return a reference to the selected meshMover model.
Automatically write from objectRegistry::writeObject()
static scalar layerThickness(const thicknessModelType, const label nLayers, const scalar firstLayerThickness, const scalar finalLayerThickness, const scalar totalThickness, const scalar expansionRatio)
Determine overall thickness. Uses two of the four parameters.
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
Reduce inplace (cf. MPI Allreduce) using specified communication schedule.
messageStream Info
Information stream (stdout output on master, null elsewhere)
const labelListList & faceEdges() const
Return face-edge addressing.
SubField< scalar > subField
Declare type of subField.
writeType
Enumeration for what to write. Used as a bit-pattern.
static labelListList globalEdgeFaces(const polyMesh &, const globalIndex &globalFaces, const indirectPrimitivePatch &pp)
Per patch edge the pp faces (in global indices) using it.
labelListList addedCells() const
Added cells given current mesh & layerfaces.
Field< vector > vectorField
Specialisation of Field<T> for vector.
faceZoneType
What to do with faceZone faces.
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
debugType
Enumeration for what to debug. Used as a bit-pattern.
void addLayers(const layerParameters &layerParams, const label nLayerIter, const dictionary &motionDict, const label nRelaxedIter, const label nAllowableErrors, const labelList &patchIDs, const labelList &internalFaceZones, const List< labelPair > &baffles, const labelList &numLayers, const label nIdealTotAddedCells, const globalIndex &globalFaces, indirectPrimitivePatch &pp, const labelListList &edgeGlobalFaces, const labelList &edgePatchID, const labelList &edgeZoneID, const boolList &edgeFlip, const labelList &inflateFaceID, const scalarField &thickness, const scalarIOField &minThickness, const scalarField &expansionRatio, vectorField &patchDisp, labelList &patchNLayers, List< extrudeMode > &extrudeStatus, polyTopoChange &savedMeshMod, labelList &cellNLayers, scalarField &faceRealThickness)
Mesh consisting of general polyhedral cells.
Omanip< int > setw(const int i)
A subset of mesh faces organised as a primitive patch.
List< label > labelList
A List of labels.
A class for managing temporary objects.
A patch is a list of labels that address the faces in the global face list.
bool returnReduceOr(const bool value, const label comm=UPstream::worldComm)
Perform logical (or) MPI Allreduce on a copy. Uses UPstream::reduceOr.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
constexpr scalar degToRad(const scalar deg) noexcept
Conversion from degrees to radians.
Defines the attributes of an object for which implicit objectRegistry management is supported...
label nOldFaces() const
Number of old faces.
List< bool > boolList
A List of bools.
A primitive field of type <T> with automated input and output.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
Do not request registration (bool: false)
const labelList & reverseFaceMap() const
Reverse face map.
const pointField & preMotionPoints() const
Pre-motion point positions.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
forAllConstIters(mixture.phases(), phase)
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
static constexpr const zero Zero
Global zero (0)