78void Foam::snappyLayerDriver::dumpDisplacement
80 const fileName& prefix,
81 const indirectPrimitivePatch&
pp,
82 const vectorField& patchDisp,
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]);
110Foam::tmp<Foam::scalarField> Foam::snappyLayerDriver::avgPointData
117 auto& faceFld = tfaceFld.ref();
126 faceFld[facei] += pointFld[
f[fp]];
128 faceFld[facei] /=
f.
size();
137void Foam::snappyLayerDriver::checkManifold
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]]);
164void Foam::snappyLayerDriver::checkMeshManifold()
const
168 Info<<
nl <<
"Checking mesh manifoldness ..." <<
endl;
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
214bool Foam::snappyLayerDriver::unmarkExtrusion
216 const label patchPointi,
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;
242bool Foam::snappyLayerDriver::unmarkExtrusion
244 const face& localFace,
250 bool unextruded =
false;
272Foam::label Foam::snappyLayerDriver::constrainFp(
const label sz,
const label fp)
289void Foam::snappyLayerDriver::countCommonPoints
300 const face&
f = localFaces[facei];
302 nCommonPoints.
clear();
306 label pointi =
f[fp];
311 label nbFacei =
pFaces[pFacei];
316 ++(nCommonPoints(nbFacei, 0));
323bool 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])
418void Foam::snappyLayerDriver::checkCommonOrder
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);
469void Foam::snappyLayerDriver::handleNonStringConnected
486 oldExtrudeStatus = extrudeStatus;
491 meshRefiner_.mesh().time().path()
492 /
"nonStringConnected.obj"
495 Pout<<
"Dumping string edges to " << str().name();
504 countCommonPoints(
pp, facei, nCommonPoints);
527 forAll(extrudeStatus, pointi)
529 if (extrudeStatus[pointi] != oldExtrudeStatus[pointi])
542void Foam::snappyLayerDriver::handleNonManifolds
554 Info<<
nl <<
"Handling non-manifold points ..." <<
endl;
557 Info<<
nl <<
"Checking patch manifoldness ..." <<
endl;
572 const labelList& eFaces = edgeFaces[edgei];
573 if (eFaces.size() > 2)
583 forAll(edgeGlobalFaces, edgei)
585 if (edgeGlobalFaces[edgei].size() > 2)
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
689 Info<<
"Set displacement to zero for all points on " << nBaffleFaces
690 <<
" baffle faces" <<
endl;
697void Foam::snappyLayerDriver::handleFeatureAngle
701 const scalar minAngle,
711 Info<<
nl <<
"Handling feature edges (angle < " << minAngle
714 if (minCos < 1-SMALL && minCos > -1+SMALL)
725 label meshEdgei = meshEdges[edgei];
731 edgeNormal[meshEdgei],
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;
817void Foam::snappyLayerDriver::handleWarpedFaces
820 const scalar faceRatio,
822 const scalar edge0Len,
832 Info<<
nl <<
"Handling cells with warped patch faces ..." <<
nl;
840 label nWarpedFaces = 0;
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;
1001void Foam::snappyLayerDriver::setNumLayers
1014 Info<<
nl <<
"Handling points with inconsistent layer specification ..."
1028 label wantedLayers = patchToNLayers[patchi];
1030 forAll(meshPoints, patchPointi)
1034 maxLayers[ppPointi] =
max(wantedLayers, maxLayers[ppPointi]);
1035 minLayers[ppPointi] =
min(wantedLayers, minLayers[ppPointi]);
1067 <<
" maxLayers:" << maxLayers
1068 <<
" minLayers:" << minLayers
1071 else if (maxLayers[i] == minLayers[i])
1074 patchNLayers[i] = maxLayers[i];
1092 patchNLayers[i] = maxLayers[i];
1107 nCells =
max(nCells, patchNLayers[
f[fp]]);
1110 nAddedCells += nCells;
1124Foam::tmp<Foam::pointVectorField>
1125Foam::snappyLayerDriver::makeLayerDisplacementField
1136 pointPatches.size(),
1137 slipPointPatchVectorField::typeName
1139 wordList actualPatchTypes(patchFieldTypes.size());
1140 forAll(pointPatches, patchi)
1142 actualPatchTypes[patchi] = pointPatches[patchi].type();
1145 forAll(numLayers, patchi)
1149 if (numLayers[patchi] == 0)
1151 patchFieldTypes[patchi] = zeroValuePointPatchVectorField::typeName;
1153 else if (numLayers[patchi] > 0)
1155 patchFieldTypes[patchi] = fixedValuePointPatchVectorField::typeName;
1159 forAll(pointPatches, patchi)
1163 patchFieldTypes[patchi] = calculatedPointPatchVectorField::typeName;
1167 patchFieldTypes[patchi] = cyclicSlipPointPatchVectorField::typeName;
1181 "pointDisplacement",
1195void Foam::snappyLayerDriver::growNoExtrusion
1203 Info<<
nl <<
"Growing non-extrusion points by one layer ..." <<
endl;
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;
1280 Info<<
"Set displacement to zero for an additional " << nGrown
1281 <<
" points." <<
endl;
1333 label nOldPatches =
mesh.boundaryMesh().size();
1335 Info<<
nl <<
"Adding in total " << nAdded/2 <<
" inter-processor patches to"
1336 <<
" handle extrusion of non-manifold processor boundaries."
1345 for (label patchi = nOldPatches; patchi <
nPatches; patchi++)
1347 label nbrProci = patchToNbrProc[patchi];
1354 patchDict.
add(
"type", processorPolyPatch::typeName);
1356 patchDict.
add(
"neighbProcNo", nbrProci);
1357 patchDict.
add(
"nFaces", 0);
1358 patchDict.
add(
"startFace",
mesh.nFaces());
1368 mesh.boundaryMesh().size(),
1372 wantedToAddedPatch.
insert(patchi, procPatchi);
1378 label patchi = edgePatchID[i];
1379 const auto fnd = wantedToAddedPatch.
cfind(patchi);
1382 edgePatchID[i] = fnd.val();
1392void Foam::snappyLayerDriver::calculateLayerThickness
1399 const scalar edge0Len,
1420 minThickness = GREAT;
1426 expansionRatio = GREAT;
1428 for (
const label patchi :
patchIDs)
1432 forAll(meshPoints, patchPointi)
1436 firstLayerThickness[ppPointi] =
min
1438 firstLayerThickness[ppPointi],
1439 layerParams.firstLayerThickness()[patchi]
1441 finalLayerThickness[ppPointi] =
min
1443 finalLayerThickness[ppPointi],
1444 layerParams.finalLayerThickness()[patchi]
1446 totalThickness[ppPointi] =
min
1448 totalThickness[ppPointi],
1449 layerParams.thickness()[patchi]
1451 expRatio[ppPointi] =
min
1454 layerParams.expansionRatio()[patchi]
1456 minThickness[ppPointi] =
min
1458 minThickness[ppPointi],
1459 layerParams.minThickness()[patchi]
1468 firstLayerThickness,
1476 finalLayerThickness,
1522 maxPointLevel[
f[fp]] =
max(maxPointLevel[
f[fp]], ownLevel);
1550 for (
const label patchi :
patchIDs)
1554 layerParams.layerModels()[patchi];
1555 const bool relSize = layerParams.relativeSizes()[patchi];
1557 for (
const label meshPointi : meshPoints)
1564 edgeLen[ppPointi] =
min
1567 edge0Len/(1<<maxPointLevel[ppPointi])
1569 spec[ppPointi] =
max(spec[ppPointi], patchSpec);
1570 isRelativePoint[meshPointi] =
1571 isRelativePoint[meshPointi]
1613 finalLayerThickness[pointi] *= edgeLen[pointi];
1614 if (isRelativePoint[meshPointi])
1616 totalThickness[pointi] *= edgeLen[pointi];
1617 minThickness[pointi] *= edgeLen[pointi];
1620 else if (isRelativePoint[meshPointi])
1622 firstLayerThickness[pointi] *= edgeLen[pointi];
1623 finalLayerThickness[pointi] *= edgeLen[pointi];
1624 totalThickness[pointi] *= edgeLen[pointi];
1625 minThickness[pointi] *= edgeLen[pointi];
1628 thickness[pointi] =
min
1634 patchNLayers[pointi],
1635 firstLayerThickness[pointi],
1636 finalLayerThickness[pointi],
1637 totalThickness[pointi],
1641 expansionRatio[pointi] =
min
1643 expansionRatio[pointi],
1644 layerParameters::layerExpansionRatio
1647 patchNLayers[pointi],
1648 firstLayerThickness[pointi],
1649 finalLayerThickness[pointi],
1650 totalThickness[pointi],
1684 const int oldPrecision =
Info.stream().precision();
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]
1742 scalar avgThickness = 0;
1743 scalar avgNearWallThickness = 0;
1750 avgNearWallThickness =
1759 <<
" " <<
setw(6) << layerParams.numLayers()[patchi]
1760 <<
" " <<
setw(8) << avgNearWallThickness
1761 <<
" " <<
setw(8) << avgThickness
1770void Foam::snappyLayerDriver::syncPatchDisplacement
1802 if (
mag(patchDisp[i]) < minThickness[i])
1820 labelList syncPatchNLayers(patchNLayers);
1833 forAll(syncPatchNLayers, i)
1835 if (syncPatchNLayers[i] != patchNLayers[i])
1864 forAll(syncPatchNLayers, i)
1866 if (syncPatchNLayers[i] != patchNLayers[i])
1902void Foam::snappyLayerDriver::getPatchDisplacement
1914 Info<<
nl <<
"Determining displacement for added points"
1915 <<
" according to pointNormal ..." <<
endl;
1932 patchDisp = thickness*pointNormals;
1935 label nNoVisNormal = 0;
1936 label nExtrudeRemove = 0;
2021 forAll(pointNormals, patchPointi)
2025 if (extrudeStatus[patchPointi] == NOEXTRUDE)
2028 patchNLayers[patchPointi] = 0;
2029 patchDisp[patchPointi] =
Zero;
2034 const vector&
n = pointNormals[patchPointi];
2040 Pout<<
"No valid normal for point " << meshPointi
2042 <<
"; setting displacement to "
2043 << patchDisp[patchPointi]
2047 extrudeStatus[patchPointi] = EXTRUDEREMOVE;
2054 forAll(extrudeStatus, patchPointi)
2056 if (extrudeStatus[patchPointi] == EXTRUDEREMOVE)
2065 label edgei = pEdges[i];
2067 label otherPointi =
pp.
edges()[edgei].otherVertex(patchPointi);
2069 if (extrudeStatus[otherPointi] != NOEXTRUDE)
2071 avg += localPoints[otherPointi] + patchDisp[otherPointi];
2080 Pout<<
"Displacement at illegal point "
2081 << localPoints[patchPointi]
2083 << (avg /
nPoints - localPoints[patchPointi])
2087 patchDisp[patchPointi] =
2089 - localPoints[patchPointi];
2102 <<
" points with point normal pointing through faces." <<
nl
2103 <<
"Reset displacement at "
2105 <<
" points to average of surrounding points." <<
endl;
2108 syncPatchDisplacement
2122bool Foam::snappyLayerDriver::sameEdgeNeighbour
2125 const label myGlobalFacei,
2126 const label nbrGlobFacei,
2130 const labelList& eFaces = globalEdgeFaces[edgei];
2131 if (eFaces.size() == 2)
2133 return edge(myGlobalFacei, nbrGlobFacei) ==
edge(eFaces[0], eFaces[1]);
2140void Foam::snappyLayerDriver::getVertexString
2146 const label myGlobFacei,
2147 const label nbrGlobFacei,
2152 label fp = fEdges.
find(edgei);
2165 label prevFp = fEdges.rcIndex(startFp);
2185 label nextFp = fEdges.fcIndex(endFp);
2219Foam::label Foam::snappyLayerDriver::truncateDisplacement
2225 const faceSet& illegalPatchFaces,
2237 for (
const label facei : illegalPatchFaces)
2242 <<
"Faceset " << illegalPatchFaces.name()
2243 <<
" contains internal face " << facei <<
nl
2252 const auto fnd = meshPointMap.cfind(
f[fp]);
2255 const label patchPointi = fnd.val();
2257 if (extrudeStatus[patchPointi] != NOEXTRUDE)
2272 forAll(patchDisp, patchPointi)
2274 if (
mag(patchDisp[patchPointi]) < minThickness[patchPointi])
2290 else if (extrudeStatus[patchPointi] == NOEXTRUDE)
2293 patchDisp[patchPointi] =
Zero;
2294 patchNLayers[patchPointi] = 0;
2303 syncPatchDisplacement
2325 const face& localF = localFaces[i];
2330 extrudeMode prevMode = extrudeStatus[localF.prevLabel(0)];
2334 extrudeMode fpMode = extrudeStatus[localF[fp]];
2336 if (prevMode == NOEXTRUDE && fpMode != NOEXTRUDE)
2365 Info<<
"truncateDisplacement : Unextruded " << nPinched
2366 <<
" faces due to non-consecutive vertices being extruded." <<
endl;
2389 label nButterFly = 0;
2394 const labelList& globFaces = edgeGlobalFaces[edgei];
2396 if (globFaces.size() == 2)
2399 label myGlobalFacei = globalFaces.toGlobal
2403 label nbrGlobalFacei =
2405 globFaces[0] != myGlobalFacei
2422 extrudeStatus[stringedVerts[0]] != NOEXTRUDE
2423 || extrudeStatus[stringedVerts.last()] != NOEXTRUDE
2428 for (label i = 1; i < stringedVerts.size()-1; i++)
2430 if (extrudeStatus[stringedVerts[i]] == NOEXTRUDE)
2463 Info<<
"truncateDisplacement : Unextruded " << nButterFly
2464 <<
" faces due to stringed edges with inconsistent extrusion."
2475 label nDiffering = 0;
2519 if (nPinched+nButterFly+nDiffering == 0)
2531void Foam::snappyLayerDriver::setupLayerInfoTruncation
2536 const label nBufferCellsNoExtrude,
2541 Info<<
nl <<
"Setting up information for layer truncation ..." <<
endl;
2545 if (nBufferCellsNoExtrude < 0)
2547 Info<<
nl <<
"Performing no layer truncation."
2548 <<
" nBufferCellsNoExtrude set to less than 0 ..." <<
endl;
2557 const label nPointLayers = patchNLayers[
f[fp]];
2558 if (nPointLayers > 0)
2560 if (nPatchFaceLayers[patchFacei] == -1)
2562 nPatchFaceLayers[patchFacei] = nPointLayers;
2566 nPatchFaceLayers[patchFacei] =
min
2568 nPatchFaceLayers[patchFacei],
2575 nPatchPointLayers = patchNLayers;
2578 forAll(nPatchFaceLayers, patchFacei)
2580 if (nPatchFaceLayers[patchFacei] == -1)
2582 nPatchFaceLayers[patchFacei] = 0;
2598 bool noExtrude =
false;
2603 if (extrudeStatus[
f[fp]] == NOEXTRUDE)
2607 mLevel =
max(mLevel, patchNLayers[
f[fp]]);
2617 nPatchFaceLayers[patchFacei] = 1;
2618 maxLevel[patchFacei] = mLevel;
2622 maxLevel[patchFacei] = mLevel;
2634 label nLevels =
gMax(patchNLayers);
2637 for (label ilevel = 1; ilevel < nLevels; ilevel++)
2643 nBuffer = nBufferCellsNoExtrude - 1;
2647 nBuffer = nBufferCellsNoExtrude;
2650 for (label ibuffer = 0; ibuffer < nBuffer + 1; ibuffer++)
2652 labelList tempCounter(nPatchFaceLayers);
2658 forAll(pointFaces[patchPointi], pointFacei)
2660 label facei = pointFaces[patchPointi][pointFacei];
2664 nPatchFaceLayers[facei] != -1
2665 && maxLevel[facei] > 0
2668 foundNeighbour[patchPointi] =
true;
2685 if (foundNeighbour[patchPointi])
2687 forAll(pointFaces[patchPointi], pointFacei)
2689 label facei = pointFaces[patchPointi][pointFacei];
2692 nPatchFaceLayers[facei] == -1
2693 && maxLevel[facei] > 0
2694 && ilevel < maxLevel[facei]
2697 tempCounter[facei] = ilevel;
2702 nPatchFaceLayers = tempCounter;
2708 if (nPatchFaceLayers[patchFacei] == -1)
2710 nPatchFaceLayers[patchFacei] = maxLevel[patchFacei];
2716 if (extrudeStatus[patchPointi] != NOEXTRUDE)
2718 forAll(pointFaces[patchPointi], pointFacei)
2720 label
face = pointFaces[patchPointi][pointFacei];
2721 nPatchPointLayers[patchPointi] =
max
2723 nPatchPointLayers[patchPointi],
2724 nPatchFaceLayers[
face]
2730 nPatchPointLayers[patchPointi] = 0;
2746bool Foam::snappyLayerDriver::cellsUseFace
2759 if (faces.found(cFaces[cFacei]))
2773Foam::label Foam::snappyLayerDriver::checkAndUnmark
2777 const bool additionalReporting,
2788 Info<<
nl <<
"Checking mesh with layer ..." <<
endl;
2789 faceSet wrongFaces(newMesh,
"wrongFaces", newMesh.nFaces()/1000);
2802 <<
" (concave, zero area or negative cell pyramid volume)"
2816 addLayer.layerFaces()
2824 const label nReportMax = 10;
2827 forAll(addedCells, oldPatchFacei)
2831 const labelList& fCells = addedCells[oldPatchFacei];
2833 if (cellsUseFace(newMesh, fCells, wrongFaces))
2847 if (additionalReporting && (nChanged < nReportMax))
2849 disabledFaceCentres.append
2863 if (additionalReporting)
2872 label nReportLocal = nChanged;
2873 if (nChangedTotal > nReportMax)
2888 Pout<<
"Checked mesh with layers. Disabled extrusion at " <<
endl;
2889 for (label i=0; i < nReportLocal; i++)
2891 Pout<<
" " << disabledFaceCentres[i] <<
endl;
2897 if (nReportTotal < nChangedTotal)
2899 Info<<
"Suppressed disabled extrusion message for other "
2900 << nChangedTotal - nReportTotal <<
" faces." <<
endl;
2904 return nChangedTotal;
2909Foam::label Foam::snappyLayerDriver::countExtrusion
2916 label nExtruded = 0;
2922 const face& localFace = localFaces[i];
2926 if (extrudeStatus[localFace[fp]] != NOEXTRUDE)
2939Foam::List<Foam::labelPair> Foam::snappyLayerDriver::getBafflesOnAddedMesh
2955 baffleSet.insert(baffles[bafflei][0], bafflei);
2956 baffleSet.insert(baffles[bafflei][1], bafflei);
2968 label oldFacei = newToOldFaces[facei];
2970 const auto faceFnd = baffleSet.find(oldFacei);
2973 label bafflei = faceFnd();
2979 else if (
p[1] == -1)
2986 <<
"Problem:" << facei <<
" at:"
2988 <<
" is on same baffle as " <<
p[0]
3001void Foam::snappyLayerDriver::getLayerCellsFaces
3014 faceRealThickness = 0;
3022 forAll(addedCells, oldPatchFacei)
3024 const labelList& added = addedCells[oldPatchFacei];
3026 const labelList& layer = layerFaces[oldPatchFacei];
3033 cellNLayers[added[i]] = layer.size()-1;
3038 forAll(layerFaces, oldPatchFacei)
3040 const labelList& layer = layerFaces[oldPatchFacei];
3041 const scalar realThickness = oldRealThickness[oldPatchFacei];
3047 for (label i = 1; i < layer.size(); i++)
3049 faceRealThickness[layer[i]] = realThickness;
3056void Foam::snappyLayerDriver::printLayerData
3068 const int oldPrecision =
Info.stream().precision();
3071 label maxPatchNameLen = 0;
3076 maxPatchNameLen =
max(maxPatchNameLen, label(patchName.size()));
3080 meshRefiner_.printMeshInfo(
false,
"Mesh with layers",
false);
3083 <<
setf(ios_base::left) <<
setw(maxPatchNameLen) <<
"patch"
3084 <<
setw(0) <<
" faces layers overall thickness" <<
nl
3085 <<
setf(ios_base::left) <<
setw(maxPatchNameLen) <<
" "
3086 <<
setw(0) <<
" target mesh [m] [%]" <<
nl
3087 <<
setf(ios_base::left) <<
setw(maxPatchNameLen) <<
"-----"
3088 <<
setw(0) <<
" ----- ----- ---- --- ---" <<
endl;
3096 label sumSize =
pp.
size();
3100 label sumNLayers = 0;
3103 sumNLayers += cellNLayers[
faceCells[i]];
3116 scalar sumRealThickness =
sum(patchReal);
3117 scalar sumFraction = 0;
3120 if (patchWanted[i] > VSMALL)
3122 sumFraction += (patchReal[i]/patchWanted[i]);
3133 scalar avgLayers = 0;
3135 scalar avgFraction = 0;
3138 avgLayers = scalar(sumNLayers)/sumSize;
3139 avgReal = sumRealThickness/sumSize;
3140 avgFraction = sumFraction/sumSize;
3145 <<
" " <<
setw(8) << sumSize
3146 <<
" " <<
setw(8) << layerParams.numLayers()[patchi]
3147 <<
" " <<
setw(8) << avgLayers
3148 <<
" " <<
setw(8) << avgReal
3149 <<
" " <<
setw(8) << 100*avgFraction
3156bool Foam::snappyLayerDriver::writeLayerSets
3166 forAll(cellNLayers, celli)
3168 if (cellNLayers[celli] > 0)
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;
3219bool Foam::snappyLayerDriver::writeLayerData
3232 bool ok = writeLayerSets(
mesh, cellNLayers, faceRealThickness);
3233 allOk = allOk && ok;
3254 fixedValueFvPatchScalarField::typeName
3258 fld[celli] = cellNLayers[celli];
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;
3397 label nIdealTotAddedCells = 0;
3414 syncPatchDisplacement
3429 forAll(extrudeStatus, patchPointi)
3432 minPatchState[pointi] = extrudeStatus[patchPointi];
3450 forAll(minPatchState, pointi)
3452 label state = minPatchState[pointi];
3453 if (state == EXTRUDE || state == EXTRUDEREMOVE)
3460 forAll(minPatchState, pointi)
3462 label state = minPatchState[pointi];
3463 if (state == EXTRUDE || state == EXTRUDEREMOVE)
3465 candidatePoints[
n++] = pointi;
3476 DynamicList<label> nonDupZones(
mesh.faceZones().size());
3485 mesh.faceZones()[zonei].name(),
3490 if (hasInfo && !layerIDs.found(mpi) && !layerIDs.found(spi))
3492 nonDupZones.append(zonei);
3516 const labelList& pointMap = map().pointMap();
3517 const labelList& reversePointMap = map().reversePointMap();
3521 label oldPointi = pointMap[pointi];
3522 label newMasterPointi = reversePointMap[oldPointi];
3524 if (newMasterPointi != pointi)
3527 pointToMaster[pointi] = newMasterPointi;
3528 pointToMaster[newMasterPointi] = newMasterPointi;
3534 const labelList& reverseFaceMap = map().reverseFaceMap();
3537 label f0 = reverseFaceMap[baffles[i].
first()];
3538 label f1 = reverseFaceMap[baffles[i].second()];
3547 Info<<
"Writing point-duplicate mesh to time "
3564 /
"duplicatePoints_"
3568 Info<<
"Writing point-duplicates to " << str.name() <<
endl;
3572 label newMasteri = reversePointMap[pointMap[pointi]];
3574 if (newMasteri != pointi)
3576 str.writeLine(
p[pointi],
p[newMasteri]);
3585void Foam::snappyLayerDriver::mergeFaceZonePoints
3599 label nPointPairs = 0;
3600 forAll(pointToMaster, pointi)
3602 label otherPointi = pointToMaster[pointi];
3603 if (otherPointi != -1)
3609 if (nPointPairs > 0)
3612 Info<<
"Merging " << nPointPairs <<
" duplicated points ..." <<
endl;
3620 + meshRefiner_.timeName()
3623 Info<<
"Points to be merged to " << str.name() <<
endl;
3624 forAll(pointToMaster, pointi)
3626 label otherPointi = pointToMaster[pointi];
3627 if (otherPointi != -1)
3631 str.writeLine(pt, otherPt);
3642 const labelList& reverseFaceMap = map().reverseFaceMap();
3646 Info<<
"Merged points in = "
3654 Info<<
"Converting baffles back into zoned faces ..."
3672 forAll(newFaceRealThickness, facei)
3674 label oldFacei =
faceMap[facei];
3677 scalar& realThick = newFaceRealThickness[facei];
3678 realThick =
max(realThick, faceRealThickness[oldFacei]);
3679 scalar& wanted = newFaceWantedThickness[facei];
3680 wanted =
max(wanted, faceWantedThickness[oldFacei]);
3683 faceRealThickness.transfer(newFaceRealThickness);
3684 faceWantedThickness.transfer(newFaceWantedThickness);
3687 Info<<
"Converted baffles in = "
3688 << meshRefiner_.mesh().time().cpuTimeIncrement()
3694Foam::label Foam::snappyLayerDriver::setPointNumLayers
3711 patchDisp =
vector(GREAT, GREAT, GREAT);
3716 patchNLayers =
Zero;
3719 label nIdealTotAddedCells = 0;
3723 extrudeStatus = EXTRUDE;
3748 handleNonStringConnected
3778 layerParams.featureAngle(),
3789 if (!layerParams.relativeSizes().found(
false))
3792 const scalar edge0Len =
3793 meshRefiner_.meshCutter().level0EdgeLength();
3794 const labelList& cellLevel = meshRefiner_.meshCutter().cellLevel();
3799 layerParams.maxFaceThicknessRatio(),
3800 layerParams.relativeSizes(),
3825 for (label i = 0; i < layerParams.nGrow(); i++)
3835 return nIdealTotAddedCells;
3839Foam::autoPtr<Foam::externalDisplacementMeshMover>
3840Foam::snappyLayerDriver::makeMeshMover
3857 combinedDict.merge(motionDict);
3859 combinedDict.add(
"minThicknessName", minThickness.name());
3877 layerParams.meshShrinker(),
3890 if (errorMsg.size() || IOerrorMsg.size())
3899 <<
"Missing/incorrect required dictionary entries:"
3901 << IOerrorMsg.c_str() <<
nl
3902 << errorMsg.c_str() <<
nl <<
nl
3903 <<
"Exiting dry-run" <<
nl <<
endl;
3907 Perr<<
"\nFOAM parallel run exiting\n" <<
endl;
3917 return medialAxisMoverPtr;
3924 const label nLayerIter,
3928 const label nRelaxedIter,
3929 const label nAllowableErrors,
3935 const label nIdealTotAddedCells,
3976 makeLayerDisplacementField
4000 for (label iteration = 0; iteration < nLayerIter; iteration++)
4003 <<
"Layer addition iteration " << iteration <<
nl
4004 <<
"--------------------------" <<
endl;
4010 iteration < nRelaxedIter
4012 : motionDict.
subDict(
"relaxed")
4015 if (iteration >= nRelaxedIter)
4017 Info<<
"Switched to relaxed meshQuality constraints." <<
endl;
4026 syncPatchDisplacement
4037 getPatchDisplacement
4058 patchDisp = -patchDisp;
4077 combinedDict.
merge(motionDict);
4079 combinedDict.
merge(meshQualityDict);
4081 combinedDict.
add(
"minThicknessName", minThickness.
name());
4084 medialAxisMoverPtr().move
4091 pp.movePoints(
mesh.points());
4097 patchDisp = oldPatchPos -
pp.localPoints();
4104 truncateDisplacement
4122 mesh.time().path()/
"layer_" + meshRefiner_.timeName(),
4129 Info<<
"Writing shrunk mesh to time "
4130 << meshRefiner_.timeName() <<
endl;
4143 mesh.time().path()/meshRefiner_.timeName()
4160 setupLayerInfoTruncation
4174 forAll(nPatchPointLayers, i)
4178 nPatchPointLayers[i],
4181 finalDisp[i] = ratio*patchDisp[i];
4185 const scalarField invExpansionRatio(1.0/expansionRatio);
4220 savedMeshMod = meshMod;
4242 fvMesh& newMesh = *newMeshPtr;
4246 addProfiling(grow,
"snappyHexMesh::layers::updateMesh");
4279 avgPointData(
pp,
mag(patchDisp))(),
4287 label nAddedCells = 0;
4288 forAll(cellNLayers, celli)
4290 if (cellNLayers[celli] > 0)
4299 Info<<
"Writing layer mesh to time " << meshRefiner_.timeName()
4302 writeLayerSets(newMesh, cellNLayers, faceRealThickness);
4308 mesh.setInstance(meshRefiner_.timeName());
4321 facei < newMesh.
nFaces();
4325 label newMeshFacei = map.
faceMap()[facei];
4326 if (newMeshFacei != -1)
4328 meshToNewMesh[newMeshFacei] = facei;
4339 meshToNewMesh[
p[0]],
4342 if (newMeshBaffle[0] != -1 && newMeshBaffle[1] != -1)
4344 newMeshBaffles[newi++] = newMeshBaffle;
4358 <<
" baffles across faceZones of type internal" <<
nl
4362 label nTotChanged = checkAndUnmark
4376 label nTotExtruded = countExtrusion(
pp, extrudeStatus);
4380 Info<<
"Extruding " << nTotExtruded
4381 <<
" out of " << nTotFaces
4382 <<
" faces (" << 100.0*nTotExtruded/nTotFaces <<
"%)."
4383 <<
" Removed extrusion at " << nTotChanged <<
" faces."
4385 <<
"Added " << nTotAddedCells <<
" out of "
4386 << nIdealTotAddedCells
4387 <<
" cells (" << 100.0*nTotAddedCells/nIdealTotAddedCells
4390 if (nTotChanged == 0)
4396 mesh.movePoints(oldPoints);
4397 pp.movePoints(
mesh.points());
4398 medialAxisMoverPtr().movePoints(
mesh.points());
4404 for (label i = 0; i < layerParams.
nGrow(); i++)
4449 oldFaceToBaffle.
insert(baffle[0], i);
4450 oldFaceToBaffle.
insert(baffle[1], i);
4457 label facei =
mesh.nInternalFaces();
4458 facei <
mesh.nFaces();
4462 const label oldFacei = map.
faceMap()[facei];
4463 const auto iter = oldFaceToBaffle.
find(oldFacei);
4464 if (oldFacei != -1 && iter.good())
4466 const label bafflei = iter();
4467 auto& newBaffle = newBaffles[bafflei];
4468 if (newBaffle[0] == -1)
4470 newBaffle[0] = facei;
4472 else if (newBaffle[1] == -1)
4474 newBaffle[1] = facei;
4479 <<
" at:" <<
mesh.faceCentres()[facei]
4480 <<
" already maps to baffle faces:"
4482 <<
" at:" <<
mesh.faceCentres()[newBaffle[0]]
4483 <<
" and " << newBaffle[1]
4484 <<
" at:" <<
mesh.faceCentres()[newBaffle[1]]
4491 label pointi =
f[fp];
4492 label oldPointi = map.
pointMap()[pointi];
4494 if (pointToMaster[oldPointi] != -1)
4496 candidates.
append(pointi);
4508 const labelPair& newBaffle = newBaffles[i];
4509 if (newBaffle[0] != -1 && newBaffle[1] != -1)
4511 newBaffles[
n++] = newBaffle;
4546 const labelList& oldPoints = newToOld[newi];
4547 if (oldPoints.
size() > 1)
4553 label masteri =
min(meshPoints);
4556 pointToMaster[meshPoints[i]] = masteri;
4564void Foam::snappyLayerDriver::updatePatch
4587 newToOldPatchPoints = -1;
4590 const labelList& newMeshPoints = newPp().meshPoints();
4594 const label newMeshPointi = newMeshPoints[
newPointi];
4595 const label oldMeshPointi =
4597 const auto iter = baseMap.
find(oldMeshPointi);
4600 newToOldPatchPoints[
newPointi] = iter();
4609 pp = std::move(newPp);
4619Foam::snappyLayerDriver::snappyLayerDriver
4627 meshRefiner_(meshRefiner),
4628 globalToMasterPatch_(globalToMasterPatch),
4629 globalToSlavePatch_(globalToSlavePatch),
4651 <<
"Merging all faces of a cell" <<
nl
4652 <<
"---------------------------" <<
nl
4653 <<
" - which are on the same patch" <<
nl
4654 <<
" - which make an angle < " << planarAngle
4656 <<
" (cos:" << minCos <<
')' <<
nl
4657 <<
" - as long as the resulting face doesn't become concave"
4660 <<
" (0=straight, 180=fully concave)" <<
nl
4671 duplicateFace[cpl[0]] = cpl[1];
4672 duplicateFace[cpl[1]] = cpl[0];
4675 label nChanged = meshRefiner_.mergePatchFacesUndo
4679 meshRefiner_.meshedPatches(),
4685 nChanged += meshRefiner_.mergeEdgesUndo(minCos, motionDict);
4696 const label nAllowableErrors,
4704 const scalar edge0Len = meshRefiner_.meshCutter().level0EdgeLength();
4712 internalOrBaffleFaceZones = meshRefiner_.getZones(fzTypes);
4719 meshRefiner_.getZones
4734 meshRefiner_.createZoneBaffles
4744 Info<<
"Writing baffled mesh to time "
4745 << meshRefiner_.timeName() <<
endl;
4754 mesh.time().path()/meshRefiner_.timeName()
4766 const labelList& reverseFaceMap = map->reverseFaceMap();
4769 label f0 = reverseFaceMap[baffles[i].
first()];
4770 label f1 = reverseFaceMap[baffles[i].second()];
4789 bool hasInfo = meshRefiner_.getFaceZoneInfo
4791 mesh.faceZones()[zonei].name(),
4799 if (layerIDs.
found(mpi) && !layerIDs.
found(spi))
4802 Info<<
"On faceZone " <<
mesh.faceZones()[zonei].name()
4803 <<
" adding layers to master patch " <<
pbm[mpi].name()
4804 <<
" only. Freezing points on slave patch "
4808 else if (!layerIDs.
found(mpi) && layerIDs.
found(spi))
4811 Info<<
"On faceZone " <<
mesh.faceZones()[zonei].name()
4812 <<
" adding layers to slave patch " <<
pbm[spi].name()
4813 <<
" only. Freezing points on master patch "
4889 const label nIdealTotAddedCells = setPointNumLayers
4911 meshRefiner_.timeName(),
4919 calculateLayerThickness
4924 meshRefiner_.meshCutter().cellLevel(),
4942 avgPointData(
pp(), baseThickness);
4950 (basePatchNLayers+layerParams.
nOuterIter()-1)
4958 for (label layeri = 0; layeri < layerParams.
nOuterIter(); layeri++)
4970 const label nToAdd =
gSum(deltaNLayers);
4972 <<
"Outer iteration : " << layeri <<
nl
4973 <<
"-------------------" <<
endl;
4976 Info<<
"Layers to add in current iteration : " << nToAdd <<
endl;
5029 forAll(baseThickness, pointi)
5033 basePatchNLayers[pointi],
5034 baseThickness[pointi],
5035 baseExpansionRatio[pointi],
5036 basePatchNLayers[pointi]
5037 -nAddedLayers[pointi]
5038 -patchNLayers[pointi],
5039 patchNLayers[pointi]
5067 nIdealTotAddedCells,
5093 sliceFaceRealThickness
5098 const label nTotalAdded =
gSum(patchNLayers);
5101 Info<<
nl <<
"Added in current iteration : " << nTotalAdded
5102 <<
" out of : " <<
gSum(deltaNLayers) <<
endl;
5104 if (nTotalAdded == 0)
5111 forAll(patchNLayers, pointi)
5113 nAddedLayers[pointi] += patchNLayers[pointi];
5115 if (patchNLayers[pointi] == 0)
5126 basePatchNLayers[pointi] = nAddedLayers[pointi];
5127 deltaNLayers[pointi] = 0;
5135 deltaNLayers[pointi] =
max
5140 deltaNLayers[pointi],
5141 basePatchNLayers[pointi] - nAddedLayers[pointi]
5162 mesh.updateMesh(map);
5176 mesh.setInstance(meshRefiner_.timeName());
5178 meshRefiner_.updateMesh(map,
labelList(0));
5190 cellNLayers[i] += sliceCellNLayers[i];
5200 faceRealThickness += sliceFaceRealThickness;
5216 faceWantedThickness,
5226 Info<<
"Writing mesh with layers but disconnected to time "
5227 << meshRefiner_.timeName() <<
endl;
5236 mesh.time().path()/meshRefiner_.timeName()
5246 updatePatch(
patchIDs, map,
pp, newToOldPatchPoints);
5262 newToOldPatchPoints,
5268 newToOldPatchPoints,
5274 newToOldPatchPoints,
5280 newToOldPatchPoints,
5286 newToOldPatchPoints,
5292 newToOldPatchPoints,
5298 newToOldPatchPoints,
5304 newToOldPatchPoints,
5328 <<
"Doing final balancing" <<
nl
5329 <<
"---------------------" <<
nl
5349 map().distributeCellData(cellNLayers);
5350 map().distributeFaceData(faceWantedThickness);
5351 map().distributeFaceData(faceRealThickness);
5365 faceWantedThickness,
5378 const bool preBalance,
5387 <<
"Shrinking and layer addition phase" <<
nl
5388 <<
"----------------------------------" <<
nl
5392 Info<<
"Using mesh parameters " << motionDict <<
nl <<
endl;
5410 label nFacesWithLayers = 0;
5411 forAll(numLayers, patchi)
5413 if (numLayers[patchi] > 0)
5420 nFacesWithLayers +=
mesh.boundaryMesh()[patchi].size();
5425 <<
"Ignoring layers on coupled patch " <<
pp.name()
5437 meshRefiner_.getFaceZoneInfo(fZones[zonei].
name(), mpi, spi, fzType);
5439 if (numLayers[mpi] > 0)
5441 nFacesWithLayers += fZones[zonei].
size();
5443 if (numLayers[spi] > 0)
5445 nFacesWithLayers += fZones[zonei].
size();
5454 Info<<
nl <<
"No layers to generate ..." <<
endl;
5459 checkMeshManifold();
5462 Info<<
"Checking initial mesh ..." <<
endl;
5471 Info<<
"Detected " << nInitErrors <<
" illegal faces"
5472 <<
" (concave, zero area or negative cell pyramid volume)"
5476 bool faceZoneOnCoupledFace =
false;
5490 const faceZone& fZone = fZones[zonei];
5495 meshRefiner_.getFaceZoneInfo(fzName, mpi, spi, fzType);
5497 if (numLayers[mpi] > 0 || numLayers[spi])
5499 isExtrudedZoneFace.
set(fZone);
5511 label facei =
mesh.nInternalFaces();
5512 facei <
mesh.nFaces();
5516 if (intOrCoupled[facei] && isExtrudedZoneFace.
test(facei))
5518 faceZoneOnCoupledFace =
true;
5533 forAll(numLayers, patchi)
5535 if (numLayers[patchi] > 0)
5538 for (
const label celli :
pp.faceCells())
5540 cellWeights[celli] += numLayers[patchi];
5549 const faceZone& fZone = fZones[zonei];
5554 meshRefiner_.getFaceZoneInfo(fzName, mpi, spi, fzType);
5556 if (numLayers[mpi] > 0)
5563 if (cellIDs[i] >= 0)
5565 cellWeights[cellIDs[i]] += numLayers[mpi];
5569 if (numLayers[spi] > 0)
5574 if (cellIDs[i] >= 0)
5576 cellWeights[cellIDs[i]] += numLayers[mpi];
5585 meshRefiner_.printMeshInfo
5588 "Before layer addition",
5594 const scalar nNewCells =
sum(cellWeights);
5595 const scalar nNewCellsAll =
5600 mag(1.0-nNewCells/nIdealNewCells),
5604 Info<<
"Ideal layer addition"
5605 <<
" : cells:" << nNewCellsAll
5606 <<
" unbalance:" << unbalance
5611 if (preBalance || faceZoneOnCoupledFace)
5614 <<
"Doing initial balancing" <<
nl
5615 <<
"-----------------------" <<
nl
Istream and Ostream manipulators taking arguments.
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edges")));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
const polyBoundaryMesh & pbm
Dynamically sized Field. Similar to DynamicList, but inheriting from a Field instead of a List.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void append(const T &val)
Copy append an element to the end of this list.
SubField< scalar > subField
GeometricBoundaryField< scalar, fvPatchField, volMesh > Boundary
bool found(const Key &key) const
Same as contains().
const_iterator cfind(const Key &key) const
Find and return an const_iterator set at the hashed entry.
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
iterator find(const Key &key)
Find and return an iterator set at the hashed entry.
label size() const noexcept
The number of elements in table.
@ NO_REGISTER
Do not request registration (bool: false).
writeOption writeOpt() const noexcept
Get the write option.
@ NO_READ
Nothing to be read.
@ READ_IF_PRESENT
Reading is optional [identical to LAZY_READ].
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
@ AUTO_WRITE
Automatically write from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const word & name() const noexcept
Return the object name.
const fileName & instance() const noexcept
Read access to instance path component.
const Addr & addressing() const noexcept
The addressing used for the list.
label size() const noexcept
The number of elements in the list.
A List with indirect addressing.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
void setSize(label n)
Alias for resize().
void clear()
Clear the list, i.e. set size to zero.
static const List< label > & null() noexcept
A HashTable to objects of type <T> with a label key.
static FOAM_NO_DANGLING_REFERENCE const pointMesh & New(const polyMesh &mesh, Args &&... args)
An OFstream that keeps track of vertices and provides convenience output methods for OBJ files.
Ostream & writeLine(const point &p0, const point &p1)
Write line joining two points.
virtual const fileName & name() const override
Read/write access to the name of the stream.
label nPoints() const
Number of points supporting patch faces.
const labelListList & pointEdges() const
Return point-edge addressing.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
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.
const Map< label > & meshPointMap() const
Mesh point map.
const labelList & meshPoints() const
Return labelList of mesh points in patch.
const Field< point_type > & localPoints() const
Return pointField of points in patch.
const Field< point_type > & faceNormals() const
Return face unit normals for patch.
const Field< point_type > & points() const noexcept
Return reference to global points.
const Field< point_type > & faceCentres() const
Return face centres for patch.
const labelListList & pointFaces() const
Return point-face addressing.
const labelListList & edgeFaces() const
Return edge-face addressing.
const labelListList & faceEdges() const
Return face-edge addressing.
const List< face_type > & localFaces() const
Return patch faces addressing into local point list.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value formatted with the given precision.
fileName path() const
The path for the case = rootPath/caseName.
A List with indirect addressing. Like IndirectList but does not store addressing.
T & first()
Access first element of the list, position [0].
void size(const label n)
Older name for setAddressableSize.
label find(const T &val) const
Find index of the first occurrence of the value.
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...
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Negative if the process is not a...
static bool parRun(const bool on) noexcept
Set as parallel run on/off.
static void reduceOr(bool &value, const int communicator=worldComm)
Logical (or) reduction (MPI_AllReduce).
static void exit(int errNo=1)
Shutdown (finalize) MPI as required and exit program with errNo.
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator). It is 1 for serial run.
label size() const noexcept
The number of entries in the list.
static Form uniform(const Cmpt &s)
Return a VectorSpace with all elements = s.
static const Form rootMax
Adds layers of cells to outside (or inside) of polyMesh. Can optionally create stand-alone extruded m...
static labelListList addedCells(const polyMesh &, const labelListList &layerFaces)
Helper: get added cells per patch face.
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.
static labelListList globalEdgeFaces(const polyMesh &, const globalIndex &globalFaces, const indirectPrimitivePatch &pp, const bitSet &orientation)
Per patch edge the pp faces (in global indices) using it.
void updateMesh(const mapPolyMesh &, const labelList &faceMap, const labelList &pointMap)
Update any locally stored mesh information. Gets additional.
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:
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
void set(const bitSet &bitset)
Set specified bits from another bitset.
bool test(const label pos) const
Test for True value at specified position, never auto-vivify entries.
A collection of cell labels.
A cell is defined as a list of faces with extra functionality.
double cpuTimeIncrement() const
Return CPU time [seconds] since last call to cpuTimeIncrement(), resetCpuTimeIncrement().
Abstract base class for domain decomposition.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
bool merge(const dictionary &dict)
Merge entries from the given dictionary.
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
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.
Smooth ATC in cells next to a set of patches supplied by type.
A subset of mesh faces organised as a primitive patch.
const labelList & slaveCells() const
Deprecated(2023-09) same as backCells.
const labelList & masterCells() const
Deprecated(2023-09) same as frontCells.
A face is a list of labels corresponding to mesh vertices.
Sends/receives parts of mesh+fvfields to neighbouring processors. Used in load balancing.
Mesh data needed to do the Finite Volume discretisation.
const Time & time() const
Return the top-level database.
virtual void updateMesh(const mapPolyMesh &mpm)
Update mesh corresponding to the given map.
virtual bool write(const bool writeOnProc=true) const
Write mesh using IO settings from time.
virtual void movePoints(const pointField &)
Move points, returns volumes swept by faces in motion.
void clearOut(const bool isMeshUpdate=false)
Clear all geometry and addressing.
Calculates a non-overlapping list of offsets based on an input size (eg, number of cells) from differ...
void reset(label localSize, const label comm=UPstream::worldComm, const bool parallel=UPstream::parRun())
Reset from local size, using gather/broadcast with default/specified communicator if parallel.
Simple container to keep together layer specific information.
const List< thicknessModelType > & layerModels() const
Specification of layer thickness.
scalar mergePatchFacesAngle() const
const scalarField & finalLayerThickness() const
Wanted thickness of the layer furthest away.
const scalarField & minThickness() const
Minimum overall thickness of cell layer. If for any reason layer.
label nRelaxedIter() const
Number of iterations after which relaxed motion rules.
const scalarField & expansionRatio() const
bool additionalReporting() const
Any additional reporting requested?
const scalarField & thickness() const
Wanted overall thickness of all layers.
thicknessModelType
Enumeration defining the layer specification:
@ FIRST_AND_RELATIVE_FINAL
scalar concaveAngle() const
label nGrow() const
If points get not extruded do nGrow layers of connected faces.
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.
const scalarField & firstLayerThickness() const
Wanted thickness of the layer nearest to the wall.
label nOuterIter() const
Outer loop to add layer by layer. Can be set to >= max layers.
label nBufferCellsNoExtrude() const
Create buffer region for new layer terminations.
label nLayerIter() const
Number of overall layer addition iterations.
static scalar finalLayerThicknessRatio(const label nLayers, const scalar expansionRatio)
Determine ratio of final layer thickness to.
const dictionary & dict() const
const boolList & relativeSizes() const
Are size parameters relative to inner cell size or.
const labelList & numLayers() const
How many layers to add.
Takes mesh with 'baffles' (= boundary faces sharing points). Determines for selected points on bounda...
static labelPairList findDuplicateFacePairs(const polyMesh &)
Helper routine to find all baffles (two boundary faces.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
const pointField & preMotionPoints() const noexcept
Pre-motion point positions.
label nOldCells() const noexcept
Number of old cells.
const labelList & faceMap() const noexcept
Old face map.
bool hasMotionPoints() const noexcept
Has valid preMotionPoints?
label nOldFaces() const noexcept
Number of old faces.
const labelList & cellMap() const noexcept
Old cell map.
const labelList & pointMap() const noexcept
Old point map.
Helper class which maintains intersections of (changing) mesh with (static) surfaces.
bool getFaceZoneInfo(const word &fzName, label &masterPatchID, label &slavePatchID, surfaceZonesInfo::faceZoneType &fzType) const
Lookup faceZone information. Return false if no information.
static List< labelPair > subsetBaffles(const polyMesh &mesh, const labelList &zoneIDs, const List< labelPair > &baffles)
Subset baffles according to zones.
writeType
Enumeration for what to write. Used as a bit-pattern.
word timeName() const
Replacement for Time::timeName() that returns oldInstance (if overwrite_).
debugType
Enumeration for what to debug. Used as a bit-pattern.
autoPtr< mapPolyMesh > dupNonManifoldPoints(const localPointRegion &)
Find boundary points that connect to more than one cell.
const fvMesh & mesh() const
Reference to mesh.
scalar mergeDistance() const
FaceMergeType
Enumeration for what to do with co-planar patch faces on a single.
static autoPtr< indirectPrimitivePatch > makePatch(const polyMesh &, const labelList &)
Create patch from set of patches.
static void updateList(const labelList &newToOld, const T &nullValue, List< T > &elems)
Helper: reorder list according to map.
bool write() const
Write mesh and all data.
static label appendPatch(fvMesh &, const label insertPatchi, const word &, const dictionary &)
Helper:append patch to end of mesh.
static writeType writeLevel()
Get/set write level.
static void setDisplacement(const labelList &patchIDs, const indirectPrimitivePatch &pp, pointField &patchDisp, pointVectorField &displacement)
Set displacement field from displacement on patch points.
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.
A pointBoundaryMesh is a pointPatch list with registered IO, a reference to the associated pointMesh,...
Mesh representing a set of points created from polyMesh.
A polyBoundaryMesh is a polyPatch list with registered IO, a reference to the associated polyMesh,...
labelRange range() const noexcept
The face range for all boundary faces.
const labelList & patchID() const
Per boundary face label the patch index.
void updateMesh()
Correct polyBoundaryMesh after topology update.
Mesh consisting of general polyhedral cells.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
void setInstance(const fileName &instance, const IOobjectOption::writeOption wOpt=IOobject::AUTO_WRITE)
Set the instance for mesh files.
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
virtual const faceList & faces() const
Return raw faces.
virtual const labelList & faceOwner() const
Return face owner.
virtual const pointField & points() const
Return raw points.
A patch is a list of labels that address the faces in the global face list.
Direct mesh changes based on v1.3 polyTopoChange syntax.
void shrink()
Shrink storage (does not remove any elements; just compacts dynamic lists.
autoPtr< mapPolyMesh > changeMesh(polyMesh &mesh, const labelUList &patchMap, const bool inflate, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
Inplace changes mesh without change of patches.
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.
bool isInternalFace(const label faceIndex) const noexcept
Return true if given face label is internal to the mesh.
const labelListList & pointEdges() const
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
const vectorField & faceCentres() const
label nInternalFaces() const noexcept
Number of internal faces.
label nPoints() const noexcept
Number of mesh points.
label nCells() const noexcept
Number of mesh cells.
label nFaces() const noexcept
Number of mesh faces.
const cellList & cells() const
label nEdges() const
Number of mesh edges.
static word newName(const label myProcNo, const label neighbProcNo)
Return the name of a processorPolyPatch ("procBoundary..") constructed from the pair of processor IDs...
Determines the 'side' for every face and connected to a singly-connected (through edges) region of fa...
All to do with adding layers.
void addLayersSinglePass(const layerParameters &layerParams, const dictionary &motionDict, const labelList &patchIDs, const label nAllowableErrors, decompositionMethod &decomposer, fvMeshDistribute &distributor)
For debugging. Can be removed.
static autoPtr< mapPolyMesh > dupFaceZonePoints(meshRefinement &meshRefiner, const labelList &patchIDs, const labelList &numLayers, List< labelPair > baffles, labelList &pointToMaster)
Duplicate points on faceZones with layers. Re-used when adding buffer layers. Can be made private aga...
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)
static void determineSidePatches(meshRefinement &meshRefiner, const globalIndex &globalFaces, const labelListList &edgeGlobalFaces, const indirectPrimitivePatch &pp, labelList &edgePatchID, labelList &edgeZoneID, boolList &edgeFlip, labelList &inflateFaceID)
Helper: see what zones and patches edges should be extruded into.
static void mapFaceZonePoints(meshRefinement &meshRefiner, const mapPolyMesh &map, labelPairList &baffles, labelList &pointToMaster)
Map numbering after adding cell layers.
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.
label mergePatchFacesUndo(const layerParameters &layerParams, const dictionary &motionDict, const meshRefinement::FaceMergeType mergeType)
Merge patch faces on same cell. Return total number of faces/edges changed.
@ NOEXTRUDE
Do not extrude. No layers added.
faceZoneType
What to do with faceZone faces.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
A class for handling words, derived from Foam::string.
const word & name() const noexcept
The zone name.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const polyBoundaryMesh & patches
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
#define WarningInFunction
Report a warning using Foam::Warning.
Namespace for handling debugging switches.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
Pair< label > labelPair
A pair of labels.
List< word > wordList
List of word.
bool returnReduceOr(const bool value, const int communicator=UPstream::worldComm)
Perform logical (or) MPI Allreduce on a copy. Uses UPstream::reduceOr.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Type gSum(const FieldField< Field, Type > &f)
const dimensionSet dimless
Dimensionless.
List< labelPair > labelPairList
List of labelPair.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
prefixOSstream Perr
OSstream wrapped stderr (std::cerr) with parallel prefix.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
UIndirectList< label > labelUIndList
UIndirectList of labels.
Smanip< std::ios_base::fmtflags > setf(std::ios_base::fmtflags flags)
messageStream Info
Information stream (stdout output on master, null elsewhere).
ZoneMesh< faceZone, polyMesh > faceZoneMesh
A ZoneMesh with faceZone content on a polyMesh.
List< face > faceList
List of faces.
GeometricField< vector, pointPatchField, pointMesh > pointVectorField
Omanip< int > setprecision(const int i)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
T returnReduce(const T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
Omanip< int > setw(const int i)
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...
Ostream & incrIndent(Ostream &os)
Increment the indent level.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ostream & indent(Ostream &os)
Indent stream.
constexpr scalar degToRad() noexcept
Multiplication factor for degrees to radians conversion.
void inplaceReorder(const labelUList &oldToNew, ListType &input, const bool prune=false)
Inplace reorder the elements of a list.
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
void reduce(T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce).
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
A PrimitivePatch with an IndirectList for the faces, const reference for the point field.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i), works like std::iota() but returning a...
pointField vertices(const blockVertexList &bvl)
errorManip< error > abort(error &err)
Field< vector > vectorField
Specialisation of Field<T> for vector.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
vector point
Point is a vector.
List< bool > boolList
A List of bools.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1, const label comm)
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
vectorField pointField
pointField is a vectorField.
labelListList invertOneToMany(const label len, const labelUList &map)
Invert one-to-many map. Unmapped elements will be size 0.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
errorManipArg< error, int > exit(error &err, const int errNo=1)
UList< label > labelUList
A UList of labels.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
Type gMax(const FieldField< Field, Type > &f)
dimensionedScalar cos(const dimensionedScalar &ds)
IOField< scalar > scalarIOField
IO for a Field of scalar.
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
constexpr char nl
The newline '\n' character (0x0a).
#define addProfiling(Name,...)
Define profiling trigger with specified name and description string. The description is generated by ...
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];} pointMap[start]=pointMap[end]=Foam::min(start, end);} } 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};constexpr 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< DynamicList< face > > pFaces[nBCs]
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIters(container, iter)
Iterate across all elements of the container object with const access.
Unit conversion functions.