76 void Foam::snappyLayerDriver::dumpDisplacement
78 const fileName& prefix,
84 OBJstream dispStr(prefix +
"_disp.obj");
85 Info<<
"Writing all displacements to " << dispStr.name() <<
endl;
87 forAll(patchDisp, patchPointi)
89 const point& pt = pp.localPoints()[patchPointi];
90 dispStr.write(
linePointRef(pt, pt + patchDisp[patchPointi]));
94 OBJstream illStr(prefix +
"_illegal.obj");
95 Info<<
"Writing invalid displacements to " << illStr.name() <<
endl;
97 forAll(patchDisp, patchPointi)
99 if (extrudeStatus[patchPointi] !=
EXTRUDE)
101 const point& pt = pp.localPoints()[patchPointi];
102 illStr.write(
linePointRef(pt, pt + patchDisp[patchPointi]));
114 tmp<scalarField> tfaceFld(
new scalarField(pp.size(), 0.0));
117 forAll(pp.localFaces(), facei)
119 const face&
f = pp.localFaces()[facei];
124 faceFld[facei] += pointFld[
f[fp]];
126 faceFld[facei] /=
f.
size();
135 void Foam::snappyLayerDriver::checkManifold
138 pointSet& nonManifoldPoints
142 fp.checkPointManifold(
false, &nonManifoldPoints);
149 const labelList& eFaces = edgeFaces[edgei];
151 if (eFaces.size() > 2)
153 const edge&
e = fp.edges()[edgei];
155 nonManifoldPoints.insert(fp.meshPoints()[
e[0]]);
156 nonManifoldPoints.insert(fp.meshPoints()[
e[1]]);
162 void Foam::snappyLayerDriver::checkMeshManifold()
const
164 const fvMesh&
mesh = meshRefiner_.mesh();
166 Info<<
nl <<
"Checking mesh manifoldness ..." <<
endl;
176 pointSet nonManifoldPoints
188 IndirectList<face>(
mesh.
faces(), outsideFaces),
198 Info<<
"Outside of mesh is multiply connected across edges or"
200 <<
"This is not a fatal error but might cause some unexpected"
201 <<
" behaviour." <<
nl
216 bool Foam::snappyLayerDriver::unmarkExtrusion
218 const label patchPointi,
224 if (extrudeStatus[patchPointi] == EXTRUDE)
226 extrudeStatus[patchPointi] = NOEXTRUDE;
227 patchNLayers[patchPointi] = 0;
228 patchDisp[patchPointi] =
Zero;
231 else if (extrudeStatus[patchPointi] == EXTRUDEREMOVE)
233 extrudeStatus[patchPointi] = NOEXTRUDE;
234 patchNLayers[patchPointi] = 0;
235 patchDisp[patchPointi] =
Zero;
246 bool Foam::snappyLayerDriver::unmarkExtrusion
248 const face& localFace,
254 bool unextruded =
false;
277 void Foam::snappyLayerDriver::handleNonManifolds
287 const fvMesh&
mesh = meshRefiner_.mesh();
289 Info<<
nl <<
"Handling non-manifold points ..." <<
endl;
292 Info<<
nl <<
"Checking patch manifoldness ..." <<
endl;
294 pointSet nonManifoldPoints(
mesh,
"nonManifoldPoints", pp.
nPoints());
297 checkManifold(pp, nonManifoldPoints);
300 forAll(edgeGlobalFaces, edgei)
304 pp.edgeFaces()[edgei].size() == 1
305 && edgeGlobalFaces[edgei].size() > 2
311 const edge&
e = pp.edges()[edgei];
312 nonManifoldPoints.insert(pp.meshPoints()[
e[0]]);
313 nonManifoldPoints.insert(pp.meshPoints()[
e[1]]);
324 isCoupledEdge[cpEdges[i]] =
true;
330 orEqOp<unsigned int>(),
334 forAll(edgeGlobalFaces, edgei)
336 label meshEdgeI = meshEdges[edgei];
340 pp.edgeFaces()[edgei].size() == 1
341 && edgeGlobalFaces[edgei].size() == 1
342 && isCoupledEdge[meshEdgeI]
346 const edge&
e = pp.edges()[edgei];
350 nonManifoldPoints.insert(pp.meshPoints()[
e[0]]);
351 nonManifoldPoints.insert(pp.meshPoints()[
e[1]]);
360 Info<<
"Outside of local patch is multiply connected across edges or"
361 <<
" points at " << nNonManif <<
" points." <<
endl;
365 const labelList& meshPoints = pp.meshPoints();
367 forAll(meshPoints, patchPointi)
369 if (nonManifoldPoints.found(meshPoints[patchPointi]))
382 Info<<
"Set displacement to zero for all " << nNonManif
383 <<
" non-manifold points" <<
endl;
388 void Foam::snappyLayerDriver::handleFeatureAngle
398 const fvMesh&
mesh = meshRefiner_.mesh();
400 Info<<
nl <<
"Handling feature edges ..." <<
endl;
402 if (minCos < 1-small)
411 const labelList& eFaces = pp.edgeFaces()[edgei];
413 label meshEdgeI = meshEdges[edgei];
419 edgeNormal[meshEdgeI],
420 pp.faceNormals()[eFaces[i]]
433 autoPtr<OBJstream> str;
442 + meshRefiner_.
name()
446 Info<<
"Writing feature edges to " << str().name() <<
endl;
455 const labelList& eFaces = pp.edgeFaces()[edgei];
457 label meshEdgeI = meshEdges[edgei];
459 const vector&
n = edgeNormal[meshEdgeI];
463 scalar
cos =
n & pp.faceNormals()[eFaces[0]];
467 const edge&
e = pp.edges()[edgei];
488 const point& p0 = pp.localPoints()[
e[0]];
489 const point& p1 = pp.localPoints()[
e[1]];
496 Info<<
"Set displacement to zero for points on "
498 <<
" feature edges" <<
endl;
507 void Foam::snappyLayerDriver::handleWarpedFaces
510 const scalar faceRatio,
511 const scalar edge0Len,
518 const fvMesh&
mesh = meshRefiner_.mesh();
520 Info<<
nl <<
"Handling cells with warped patch faces ..." <<
nl;
524 label nWarpedFaces = 0;
528 const face&
f = pp[i];
532 label facei = pp.addressing()[i];
535 scalar edgeLen = edge0Len/(1<<ownLevel);
539 const vector& fn = pp.faceNormals()[i];
546 vProj[fp] = (
n & fn);
550 scalar minVal =
min(vProj);
551 scalar maxVal =
max(vProj);
553 if ((maxVal - minVal) > faceRatio * edgeLen)
572 Info<<
"Set displacement to zero on "
574 <<
" warped faces since layer would be > " << faceRatio
575 <<
" of the size of the bounding box." <<
endl;
682 void Foam::snappyLayerDriver::setNumLayers
693 const fvMesh&
mesh = meshRefiner_.mesh();
695 Info<<
nl <<
"Handling points with inconsistent layer specification ..."
712 forAll(meshPoints, patchPointi)
714 label ppPointi = pp.meshPointMap()[meshPoints[patchPointi]];
716 maxLayers[ppPointi] =
max(wantedLayers, maxLayers[ppPointi]);
717 minLayers[ppPointi] =
min(wantedLayers, minLayers[ppPointi]);
748 <<
"Patchpoint:" << i <<
" coord:" << pp.localPoints()[i]
749 <<
" maxLayers:" << maxLayers
750 <<
" minLayers:" << minLayers
753 else if (maxLayers[i] == minLayers[i])
756 patchNLayers[i] = maxLayers[i];
774 patchNLayers[i] = maxLayers[i];
781 forAll(pp.localFaces(), facei)
783 const face&
f = pp.localFaces()[facei];
789 nCells =
max(nCells, patchNLayers[
f[fp]]);
792 nAddedCells += nCells;
794 reduce(nAddedCells, sumOp<label>());
807 Foam::snappyLayerDriver::makeLayerDisplacementField
809 const pointMesh& pMesh,
814 const pointBoundaryMesh& pointPatches = pMesh.boundary();
821 wordList actualPatchTypes(patchFieldTypes.size());
831 if (numLayers[
patchi] == 0)
836 else if (numLayers[
patchi] > 0)
844 if (isA<processorPointPatch>(pointPatches[
patchi]))
848 else if (isA<cyclicPointPatch>(pointPatches[
patchi]))
857 tmp<pointVectorField> tfld
872 void Foam::snappyLayerDriver::growNoExtrusion
880 Info<<
nl <<
"Growing non-extrusion points by one layer ..." <<
endl;
884 const faceList& localFaces = pp.localFaces();
890 const face&
f = localFaces[facei];
892 bool hasSqueeze =
false;
895 if (extrudeStatus[
f[fp]] == NOEXTRUDE)
909 extrudeStatus[
f[fp]] == EXTRUDE
910 && grownExtrudeStatus[
f[fp]] != NOEXTRUDE
913 grownExtrudeStatus[
f[fp]] = NOEXTRUDE;
920 extrudeStatus.transfer(grownExtrudeStatus);
929 status[i] = extrudeStatus[i];
941 extrudeStatus[i] = extrudeMode(status[i]);
946 forAll(extrudeStatus, patchPointi)
948 if (extrudeStatus[patchPointi] == NOEXTRUDE)
950 patchDisp[patchPointi] =
Zero;
951 patchNLayers[patchPointi] = 0;
955 reduce(nGrown, sumOp<label>());
957 Info<<
"Set displacement to zero for an additional " << nGrown
958 <<
" points." <<
endl;
962 void Foam::snappyLayerDriver::determineSidePatches
964 const globalIndex& globalFaces,
977 fvMesh&
mesh = meshRefiner_.mesh();
983 Map<label> nbrProcToPatch;
984 Map<label> patchToNbrProc;
1000 Info<<
nl <<
"Adding in total " << nAdded/2 <<
" inter-processor patches to"
1001 <<
" handle extrusion of non-manifold processor boundaries."
1008 Map<label> wantedToAddedPatch;
1014 const processorPolyPatch pp
1024 wantedToAddedPatch.insert(
patchi, procPatchi);
1032 if (fnd != wantedToAddedPatch.end())
1034 sidePatchID[i] = fnd();
1045 void Foam::snappyLayerDriver::calculateLayerThickness
1049 const layerParameters& layerParams,
1052 const scalar edge0Len,
1059 const fvMesh&
mesh = meshRefiner_.mesh();
1067 scalarField firstLayerThickness(pp.nPoints(), great);
1068 scalarField finalLayerThickness(pp.nPoints(), great);
1072 minThickness.setSize(pp.nPoints());
1073 minThickness = great;
1081 forAll(meshPoints, patchPointi)
1083 label ppPointi = pp.meshPointMap()[meshPoints[patchPointi]];
1085 firstLayerThickness[ppPointi] =
min
1087 firstLayerThickness[ppPointi],
1088 layerParams.firstLayerThickness()[
patchi]
1090 finalLayerThickness[ppPointi] =
min
1092 finalLayerThickness[ppPointi],
1093 layerParams.finalLayerThickness()[
patchi]
1095 totalThickness[ppPointi] =
min
1097 totalThickness[ppPointi],
1098 layerParams.thickness()[
patchi]
1100 expRatio[ppPointi] =
min
1103 layerParams.expansionRatio()[
patchi]
1105 minThickness[ppPointi] =
min
1107 minThickness[ppPointi],
1108 layerParams.minThickness()[
patchi]
1117 firstLayerThickness,
1125 finalLayerThickness,
1163 if (layerParams.relativeSizes())
1167 min(layerParams.minThickness()) < 0
1168 ||
max(layerParams.minThickness()) > 2
1172 <<
"Thickness should be factor of local undistorted cell size."
1173 <<
" Valid values are [0..2]." <<
nl
1174 <<
" minThickness:" << layerParams.minThickness()
1188 const face&
f = pp.localFaces()[i];
1192 maxPointLevel[
f[fp]] =
max(maxPointLevel[
f[fp]], ownLevel);
1206 forAll(maxPointLevel, pointi)
1209 scalar edgeLen = edge0Len/(1<<maxPointLevel[pointi]);
1210 firstLayerThickness[pointi] *= edgeLen;
1211 finalLayerThickness[pointi] *= edgeLen;
1212 totalThickness[pointi] *= edgeLen;
1213 minThickness[pointi] *= edgeLen;
1222 forAll(firstLayerThickness, pointi)
1224 thickness[pointi] = layerParams.layerThickness
1226 patchNLayers[pointi],
1227 firstLayerThickness[pointi],
1228 finalLayerThickness[pointi],
1229 totalThickness[pointi],
1233 expansionRatio[pointi] = layerParams.layerExpansionRatio
1235 patchNLayers[pointi],
1236 firstLayerThickness[pointi],
1237 finalLayerThickness[pointi],
1238 totalThickness[pointi],
1250 int oldPrecision =
Info().precision();
1253 label maxPatchNameLen = 0;
1258 maxPatchNameLen =
max(maxPatchNameLen,
label(patchName.size()));
1262 <<
setf(ios_base::left) <<
setw(maxPatchNameLen) <<
"patch"
1263 <<
setw(0) <<
" faces layers avg thickness[m]" <<
nl
1264 <<
setf(ios_base::left) <<
setw(maxPatchNameLen) <<
" "
1265 <<
setw(0) <<
" near-wall overall" <<
nl
1266 <<
setf(ios_base::left) <<
setw(maxPatchNameLen) <<
"-----"
1267 <<
setw(0) <<
" ----- ------ --------- -------" <<
endl;
1278 scalar sumThickness = 0;
1279 scalar sumNearWallThickness = 0;
1280 label nMasterPoints = 0;
1282 forAll(meshPoints, patchPointi)
1284 label meshPointi = meshPoints[patchPointi];
1285 if (isMasterPoint[meshPointi])
1287 label ppPointi = pp.meshPointMap()[meshPointi];
1289 sumThickness += thickness[ppPointi];
1290 sumNearWallThickness += layerParams.firstLayerThickness
1292 patchNLayers[ppPointi],
1293 firstLayerThickness[ppPointi],
1294 finalLayerThickness[ppPointi],
1295 thickness[ppPointi],
1296 expansionRatio[ppPointi]
1305 scalar avgThickness = 0;
1306 scalar avgNearWallThickness = 0;
1313 avgNearWallThickness =
1322 <<
" " <<
setw(6) << layerParams.numLayers()[
patchi]
1323 <<
" " <<
setw(8) << avgNearWallThickness
1324 <<
" " <<
setw(8) << avgThickness
1333 void Foam::snappyLayerDriver::syncPatchDisplacement
1342 const fvMesh&
mesh = meshRefiner_.mesh();
1343 const labelList& meshPoints = pp.meshPoints();
1355 minMagSqrEqOp<vector>(),
1362 if (
mag(patchDisp[i]) < minThickness[i])
1380 labelList syncPatchNLayers(patchNLayers);
1393 forAll(syncPatchNLayers, i)
1395 if (syncPatchNLayers[i] != patchNLayers[i])
1424 forAll(syncPatchNLayers, i)
1426 if (syncPatchNLayers[i] != patchNLayers[i])
1457 void Foam::snappyLayerDriver::getPatchDisplacement
1467 Info<<
nl <<
"Determining displacement for added points"
1468 <<
" according to pointNormal ..." <<
endl;
1470 const fvMesh&
mesh = meshRefiner_.mesh();
1471 const vectorField& faceNormals = pp.faceNormals();
1473 const pointField& localPoints = pp.localPoints();
1485 patchDisp = thickness*pointNormals;
1488 label nNoVisNormal = 0;
1489 label nExtrudeRemove = 0;
1493 forAll(pointNormals, patchPointi)
1495 label meshPointi = pp.meshPoints()[patchPointi];
1497 if (extrudeStatus[patchPointi] == NOEXTRUDE)
1500 patchNLayers[patchPointi] = 0;
1501 patchDisp[patchPointi] =
Zero;
1506 const vector&
n = pointNormals[patchPointi];
1512 Pout<<
"No valid normal for point " << meshPointi
1513 <<
' ' << pp.points()[meshPointi]
1514 <<
"; setting displacement to "
1515 << patchDisp[patchPointi]
1519 extrudeStatus[patchPointi] = EXTRUDEREMOVE;
1526 forAll(extrudeStatus, patchPointi)
1528 if (extrudeStatus[patchPointi] == EXTRUDEREMOVE)
1533 const labelList& pEdges = pp.pointEdges()[patchPointi];
1537 label edgei = pEdges[i];
1539 label otherPointi = pp.edges()[edgei].otherVertex(patchPointi);
1541 if (extrudeStatus[otherPointi] != NOEXTRUDE)
1543 avg += localPoints[otherPointi] + patchDisp[otherPointi];
1552 Pout<<
"Displacement at illegal point "
1553 << localPoints[patchPointi]
1555 << (avg /
nPoints - localPoints[patchPointi])
1559 patchDisp[patchPointi] =
1561 - localPoints[patchPointi];
1574 <<
" points with point normal pointing through faces." <<
nl
1575 <<
"Reset displacement at "
1577 <<
" points to average of surrounding points." <<
endl;
1580 syncPatchDisplacement
1593 bool Foam::snappyLayerDriver::sameEdgeNeighbour
1596 const label myGlobalFacei,
1597 const label nbrGlobFacei,
1601 const labelList& eFaces = globalEdgeFaces[edgei];
1602 if (eFaces.size() == 2)
1604 return edge(myGlobalFacei, nbrGlobFacei) == edge(eFaces[0], eFaces[1]);
1613 void Foam::snappyLayerDriver::getVertexString
1619 const label myGlobFacei,
1620 const label nbrGlobFacei,
1624 const labelList& fEdges = pp.faceEdges()[facei];
1638 label prevFp = fEdges.rcIndex(startFp);
1658 label nextFp = fEdges.fcIndex(endFp);
1675 const face&
f = pp.localFaces()[facei];
1692 Foam::label Foam::snappyLayerDriver::truncateDisplacement
1694 const globalIndex& globalFaces,
1698 const faceSet& illegalPatchFaces,
1704 const fvMesh&
mesh = meshRefiner_.mesh();
1708 const Map<label>& meshPointMap = pp.meshPointMap();
1712 label facei = iter.key();
1717 <<
"Faceset " << illegalPatchFaces.name()
1718 <<
" contains internal face " << facei <<
nl
1727 if (meshPointMap.found(
f[fp]))
1729 label patchPointi = meshPointMap[
f[fp]];
1731 if (extrudeStatus[patchPointi] != NOEXTRUDE)
1746 forAll(patchDisp, patchPointi)
1748 if (
mag(patchDisp[patchPointi]) < minThickness[patchPointi])
1764 else if (extrudeStatus[patchPointi] == NOEXTRUDE)
1767 patchDisp[patchPointi] =
Zero;
1768 patchNLayers[patchPointi] = 0;
1773 const faceList& localFaces = pp.localFaces();
1777 syncPatchDisplacement
1798 const face& localF = localFaces[i];
1803 extrudeMode prevMode = extrudeStatus[localF.prevLabel(0)];
1807 extrudeMode fpMode = extrudeStatus[localF[fp]];
1809 if (prevMode == NOEXTRUDE && fpMode != NOEXTRUDE)
1836 reduce(nPinched, sumOp<label>());
1838 Info<<
"truncateDisplacement : Unextruded " << nPinched
1839 <<
" faces due to non-consecutive vertices being extruded." <<
endl;
1862 label nButterFly = 0;
1864 DynamicList<label> stringedVerts;
1865 forAll(pp.edges(), edgei)
1867 const labelList& globFaces = edgeGlobalFaces[edgei];
1869 if (globFaces.size() == 2)
1871 label myFacei = pp.edgeFaces()[edgei][0];
1872 label myGlobalFacei = globalFaces.toGlobal
1874 pp.addressing()[myFacei]
1876 label nbrGlobalFacei =
1878 globFaces[0] != myGlobalFacei
1895 extrudeStatus[stringedVerts[0]] != NOEXTRUDE
1896 || extrudeStatus[stringedVerts.last()] != NOEXTRUDE
1901 for (
label i = 1; i < stringedVerts.size()-1; i++)
1905 extrudeStatus[stringedVerts[i]] == NOEXTRUDE
1937 reduce(nButterFly, sumOp<label>());
1939 Info<<
"truncateDisplacement : Unextruded " << nButterFly
1940 <<
" faces due to stringed edges with inconsistent extrusion."
1951 label nDiffering = 0;
1995 if (nPinched+nButterFly+nDiffering == 0)
2007 void Foam::snappyLayerDriver::setupLayerInfoTruncation
2012 const label nBufferCellsNoExtrude,
2017 Info<<
nl <<
"Setting up information for layer truncation ..." <<
endl;
2019 const fvMesh&
mesh = meshRefiner_.mesh();
2021 if (nBufferCellsNoExtrude < 0)
2023 Info<<
nl <<
"Performing no layer truncation."
2024 <<
" nBufferCellsNoExtrude set to less than 0 ..." <<
endl;
2027 forAll(pp.localFaces(), patchFacei)
2029 const face&
f = pp.localFaces()[patchFacei];
2033 if (patchNLayers[
f[fp]] > 0)
2035 nPatchFaceLayers[patchFacei] = patchNLayers[
f[fp]];
2040 nPatchPointLayers = patchNLayers;
2043 forAll(nPatchFaceLayers, patchFacei)
2045 if (nPatchFaceLayers[patchFacei] == -1)
2047 nPatchFaceLayers[patchFacei] = 0;
2056 forAll(pp.localFaces(), patchFacei)
2058 const face&
f = pp.localFaces()[patchFacei];
2063 bool noExtrude =
false;
2068 if (extrudeStatus[
f[fp]] == NOEXTRUDE)
2072 mLevel =
max(mLevel, patchNLayers[
f[fp]]);
2082 nPatchFaceLayers[patchFacei] = 1;
2083 maxLevel[patchFacei] = mLevel;
2087 maxLevel[patchFacei] = mLevel;
2102 for (
label ilevel = 1; ilevel < nLevels; ilevel++)
2108 nBuffer = nBufferCellsNoExtrude - 1;
2112 nBuffer = nBufferCellsNoExtrude;
2115 for (
label ibuffer = 0; ibuffer < nBuffer + 1; ibuffer++)
2117 labelList tempCounter(nPatchFaceLayers);
2119 boolList foundNeighbour(pp.nPoints(),
false);
2121 forAll(pp.meshPoints(), patchPointi)
2123 forAll(pointFaces[patchPointi], pointFacei)
2125 label facei = pointFaces[patchPointi][pointFacei];
2129 nPatchFaceLayers[facei] != -1
2130 && maxLevel[facei] > 0
2133 foundNeighbour[patchPointi] =
true;
2148 forAll(pp.meshPoints(), patchPointi)
2150 if (foundNeighbour[patchPointi])
2152 forAll(pointFaces[patchPointi], pointFacei)
2154 label facei = pointFaces[patchPointi][pointFacei];
2157 nPatchFaceLayers[facei] == -1
2158 && maxLevel[facei] > 0
2159 && ilevel < maxLevel[facei]
2162 tempCounter[facei] = ilevel;
2167 nPatchFaceLayers = tempCounter;
2171 forAll(pp.localFaces(), patchFacei)
2173 if (nPatchFaceLayers[patchFacei] == -1)
2175 nPatchFaceLayers[patchFacei] = maxLevel[patchFacei];
2179 forAll(pp.meshPoints(), patchPointi)
2181 if (extrudeStatus[patchPointi] != NOEXTRUDE)
2183 forAll(pointFaces[patchPointi], pointFacei)
2185 label face = pointFaces[patchPointi][pointFacei];
2186 nPatchPointLayers[patchPointi] =
max
2188 nPatchPointLayers[patchPointi],
2189 nPatchFaceLayers[face]
2195 nPatchPointLayers[patchPointi] = 0;
2211 bool Foam::snappyLayerDriver::cellsUseFace
2213 const polyMesh&
mesh,
2224 if (faces.found(cFaces[cFacei]))
2237 Foam::label Foam::snappyLayerDriver::checkAndUnmark
2239 const addPatchCellLayer& addLayer,
2240 const dictionary& meshQualityDict,
2241 const bool additionalReporting,
2244 const fvMesh& newMesh,
2252 Info<<
nl <<
"Checking mesh with layer ..." <<
endl;
2253 faceSet wrongFaces(newMesh,
"wrongFaces", newMesh.nFaces()/1000);
2265 <<
" (concave, zero area or negative cell pyramid volume)"
2279 addLayer.layerFaces()
2287 const label nReportMax = 10;
2288 DynamicField<point> disabledFaceCentres(nReportMax);
2290 forAll(addedCells, oldPatchFacei)
2294 const labelList& fCells = addedCells[oldPatchFacei];
2296 if (cellsUseFace(newMesh, fCells, wrongFaces))
2303 pp.localFaces()[oldPatchFacei],
2310 if (additionalReporting && (nChanged < nReportMax))
2312 disabledFaceCentres.
append
2314 pp.faceCentres()[oldPatchFacei]
2326 if (additionalReporting)
2335 label nReportLocal = nChanged;
2336 if (nChangedTotal > nReportMax)
2351 Pout<<
"Checked mesh with layers. Disabled extrusion at " <<
endl;
2352 for (
label i=0; i < nReportLocal; i++)
2354 Pout<<
" " << disabledFaceCentres[i] <<
endl;
2360 if (nReportTotal < nChangedTotal)
2362 Info<<
"Suppressed disabled extrusion message for other "
2363 << nChangedTotal - nReportTotal <<
" faces." <<
endl;
2367 return nChangedTotal;
2371 Foam::label Foam::snappyLayerDriver::countExtrusion
2378 label nExtruded = 0;
2380 const faceList& localFaces = pp.localFaces();
2384 const face& localFace = localFaces[i];
2388 if (extrudeStatus[localFace[fp]] != NOEXTRUDE)
2402 void Foam::snappyLayerDriver::getLayerCellsFaces
2404 const polyMesh&
mesh,
2405 const addPatchCellLayer& addLayer,
2415 faceRealThickness = 0;
2423 forAll(addedCells, oldPatchFacei)
2425 const labelList& added = addedCells[oldPatchFacei];
2427 const labelList& layer = layerFaces[oldPatchFacei];
2433 cellNLayers[added[i]] = layer.size()-1;
2438 forAll(layerFaces, oldPatchFacei)
2440 const labelList& layer = layerFaces[oldPatchFacei];
2441 const scalar realThickness = oldRealThickness[oldPatchFacei];
2447 for (
label i = 1; i < layer.size(); i++)
2449 faceRealThickness[layer[i]] = realThickness;
2456 void Foam::snappyLayerDriver::printLayerData
2467 int oldPrecision =
Info().precision();
2470 label maxPatchNameLen = 0;
2474 word patchName = pbm[
patchi].name();
2475 maxPatchNameLen =
max(maxPatchNameLen,
label(patchName.size()));
2479 <<
setf(ios_base::left) <<
setw(maxPatchNameLen) <<
"patch"
2480 <<
setw(0) <<
" faces layers overall thickness" <<
nl
2481 <<
setf(ios_base::left) <<
setw(maxPatchNameLen) <<
" "
2482 <<
setw(0) <<
" [m] [%]" <<
nl
2483 <<
setf(ios_base::left) <<
setw(maxPatchNameLen) <<
"-----"
2484 <<
setw(0) <<
" ----- ------ --- ---" <<
endl;
2490 const polyPatch& pp = pbm[
patchi];
2492 label sumSize = pp.size();
2495 const labelList& faceCells = pp.faceCells();
2496 label sumNLayers = 0;
2499 sumNLayers += cellNLayers[faceCells[i]];
2512 scalar sumRealThickness =
sum(patchReal);
2513 scalar sumFraction = 0;
2516 if (patchWanted[i] > vSmall)
2518 sumFraction += (patchReal[i]/patchWanted[i]);
2523 reduce(sumSize, sumOp<label>());
2524 reduce(sumNLayers, sumOp<label>());
2525 reduce(sumRealThickness, sumOp<scalar>());
2526 reduce(sumFraction, sumOp<scalar>());
2529 scalar avgLayers = 0;
2531 scalar avgFraction = 0;
2534 avgLayers = scalar(sumNLayers)/sumSize;
2535 avgReal = sumRealThickness/sumSize;
2536 avgFraction = sumFraction/sumSize;
2541 <<
" " <<
setw(8) << sumSize
2542 <<
" " <<
setw(8) << avgLayers
2543 <<
" " <<
setw(8) << avgReal
2544 <<
" " <<
setw(8) << 100*avgFraction
2551 bool Foam::snappyLayerDriver::writeLayerData
2566 forAll(cellNLayers, celli)
2568 if (cellNLayers[celli] > 0)
2573 cellSet addedCellSet(
mesh,
"addedCells", nAdded);
2574 forAll(cellNLayers, celli)
2576 if (cellNLayers[celli] > 0)
2578 addedCellSet.insert(celli);
2581 addedCellSet.instance() = meshRefiner_.name();
2584 <<
" added cells to cellSet "
2585 << addedCellSet.name() <<
endl;
2586 bool ok = addedCellSet.
write();
2593 if (faceRealThickness[facei] > 0)
2599 faceSet layerFacesSet(
mesh,
"layerFaces", nAdded);
2602 if (faceRealThickness[facei] > 0)
2604 layerFacesSet.insert(facei);
2607 layerFacesSet.instance() = meshRefiner_.name();
2610 <<
" faces inside added layer to faceSet "
2611 << layerFacesSet.name() <<
endl;
2612 bool ok = layerFacesSet.
write();
2640 fld.boundaryFieldRef();
2645 const polyPatch& pp = pbm[
patchi];
2646 const labelList& faceCells = pp.faceCells();
2650 pfld[i] = cellNLayers[faceCells[i]];
2656 bool ok =
fld.write();
2679 fld.boundaryFieldRef();
2691 bool ok =
fld.write();
2699 "thicknessFraction",
2714 fld.boundaryFieldRef();
2733 if (patchWanted[i] > vSmall)
2735 pfld[i] = patchReal[i]/patchWanted[i];
2742 <<
" : overall layer thickness (fraction"
2743 <<
" of desired thickness)" <<
endl;
2744 bool ok =
fld.write();
2757 faceWantedThickness,
2775 meshRefiner_(meshRefiner),
2776 globalToMasterPatch_(globalToMasterPatch),
2777 globalToSlavePatch_(globalToSlavePatch)
2796 <<
"Merging all faces of a cell" <<
nl
2797 <<
"---------------------------" <<
nl
2798 <<
" - which are on the same patch" <<
nl
2799 <<
" - which make an angle < " <<
radToDeg(planarAngle)
2802 <<
" (cos:" << minCos <<
')' <<
nl
2803 <<
" - as long as the resulting face doesn't become concave"
2806 <<
" (0=straight, 180=fully concave)" <<
nl
2817 duplicateFace[cpl[0]] = cpl[1];
2818 duplicateFace[cpl[1]] = cpl[0];
2835 meshRefiner_.mergePatchFacesUndo
2844 meshRefiner_.mergeEdgesUndo(minCos, motionDict);
2853 const label nAllowableErrors,
2863 meshRefiner_.createZoneBaffles
2865 globalToMasterPatch_,
2866 globalToSlavePatch_,
2873 Info<<
"Writing baffled mesh to time "
2874 << meshRefiner_.name() <<
endl;
2918 determineSidePatches
2939 label nIdealTotAddedCells = 0;
2999 const scalar edge0Len =
3000 meshRefiner_.meshCutter().level0EdgeLength();
3001 const labelList& cellLevel = meshRefiner_.meshCutter().cellLevel();
3030 for (
label i = 0; i < layerParams.
nGrow(); i++)
3044 const scalar edge0Len = meshRefiner_.meshCutter().level0EdgeLength();
3045 const labelList& cellLevel = meshRefiner_.meshCutter().cellLevel();
3055 meshRefiner_.name(),
3062 calculateLayerThickness
3090 avgPointData(pp, thickness);
3098 makeLayerDisplacementField
3111 combinedDict.
merge(motionDict);
3113 combinedDict.
add(
"minThicknessName", minThickness.
name());
3132 label iteration = 0;
3138 <<
"Layer addition iteration " << iteration <<
nl
3139 <<
"--------------------------" <<
endl;
3147 : motionDict.
subDict(
"relaxed")
3152 Info<<
"Switched to relaxed meshQuality constraints." <<
endl;
3158 syncPatchDisplacement
3168 getPatchDisplacement
3201 combinedDict.
merge(motionDict);
3203 combinedDict.
merge(meshQualityDict);
3205 combinedDict.
add(
"minThicknessName", minThickness.
name());
3208 medialAxisMoverPtr().move
3218 patchDisp = oldPatchPos - pp().localPoints();
3225 truncateDisplacement
3250 Info<<
"Writing shrunk mesh to time "
3251 << meshRefiner_.name() <<
endl;
3277 labelList nPatchFaceLayers(pp().size(), -1);
3278 setupLayerInfoTruncation
3292 forAll(nPatchPointLayers, i)
3296 nPatchPointLayers[i],
3299 finalDisp[i] = ratio*patchDisp[i];
3303 const scalarField invExpansionRatio(1.0/expansionRatio);
3330 savedMeshMod = meshMod;
3331 savedAddLayer = addLayer;
3353 fvMesh& newMesh = newMeshPtr();
3375 newMeshBaffles[i][0] = map().reverseFaceMap()[
p[0]];
3376 newMeshBaffles[i][1] = map().reverseFaceMap()[
p[1]];
3384 avgPointData(pp,
mag(patchDisp))(),
3392 label nAddedCells = 0;
3393 forAll(cellNLayers, celli)
3395 if (cellNLayers[celli] > 0)
3404 Info<<
"Writing layer mesh to time " << meshRefiner_.name()
3408 cellSet addedCellSet(newMesh,
"addedCells", nAddedCells);
3409 forAll(cellNLayers, celli)
3411 if (cellNLayers[celli] > 0)
3413 addedCellSet.
insert(celli);
3419 <<
" added cells to cellSet " << addedCellSet.
name()
3421 addedCellSet.
write();
3431 if (faceRealThickness[facei] > 0)
3433 layerFacesSet.
insert(facei);
3439 <<
" faces inside added layer to faceSet "
3441 layerFacesSet.
write();
3445 label nTotChanged = checkAndUnmark
3459 label nTotExtruded = countExtrusion(pp, extrudeStatus);
3463 Info<<
"Extruding " << nTotExtruded
3464 <<
" out of " << nTotFaces
3465 <<
" faces (" << 100.0*nTotExtruded/nTotFaces <<
"%)."
3466 <<
" Removed extrusion at " << nTotChanged <<
" faces."
3468 <<
"Added " << nTotAddedCells <<
" out of "
3469 << nIdealTotAddedCells <<
" cells ("
3470 << 100.0*nTotAddedCells/nIdealTotAddedCells <<
"%)."
3473 if (nTotChanged == 0)
3483 for (
label i = 0; i < layerParams.
nGrow(); i++)
3514 meshRefiner_.topoChange(map,
labelList(0));
3523 p[0] = map().reverseFaceMap()[
p[0]];
3524 p[1] = map().reverseFaceMap()[
p[1]];
3532 Info<<
"Converting " << nBaffles
3533 <<
" baffles back into zoned faces ..."
3542 Info<<
"Converted baffles in = "
3543 << meshRefiner_.mesh().time().cpuTimeIncrement()
3554 <<
"Doing final balancing" <<
nl
3555 <<
"---------------------" <<
nl
3574 map().distributeCellData(cellNLayers);
3575 map().distributeFaceData(faceWantedThickness);
3576 map().distributeFaceData(faceRealThickness);
3588 faceWantedThickness,
3599 const bool preBalance,
3607 <<
"Shrinking and layer addition phase" <<
nl
3608 <<
"----------------------------------" <<
nl
3611 Info<<
"Using mesh parameters " << motionDict <<
nl <<
endl;
3614 mergePatchFacesUndo(layerParams, motionDict);
3621 label nFacesWithLayers = 0;
3624 if (numLayers[
patchi] > 0)
3636 <<
"Ignoring layers on coupled patch " << pp.
name()
3645 Info<<
nl <<
"No layers to generate ..." <<
endl;
3650 checkMeshManifold();
3653 Info<<
"Checking initial mesh ..." <<
endl;
3662 Info<<
"Detected " << nInitErrors <<
" illegal faces"
3663 <<
" (concave, zero area or negative cell pyramid volume)"
3671 <<
"Doing initial balancing" <<
nl
3672 <<
"-----------------------" <<
nl
3678 if (numLayers[
patchi] > 0)
Istream and Ostream manipulators taking arguments.
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
static pointMesh & New(const word &name, const polyMesh &mesh)
Construct and return the named DemandDrivenMeshObject.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & shrink()
Shrink the allocated space to the number of elements used.
SubField< scalar > subField
Declare type of subField.
GeometricBoundaryField< Type, GeoMesh, PrimitiveField > Boundary
Type of the boundary field.
static tmp< GeometricField< Type, pointMesh, Field > > New(const word &name, const Internal &, const PtrList< Patch > &, const HashPtrTable< Source > &=HashPtrTable< Source >())
Return a temporary field constructed from name,.
bool insert(const Key &key)
Insert a new entry.
bool unset(const Key &key)
Unset the specified key - same as erase.
bool set(const Key &key)
Same as insert (cannot overwrite nil content)
label size() const
Return number of elements in table.
friend class const_iterator
Declare friendship with the const_iterator.
A primitive field of type <Type> with automated input and output.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
fileName & instance() const
Return the instance directory, constant, system, <time> etc.
writeOption & writeOpt() const
const word & name() const
Return name.
void append(const T &)
Append an element at the end of the list.
void size(const label)
Override size to be inconsistent with allocated storage.
void clear()
Clear the list, i.e. set size to zero.
static const List< label > & null()
Return a null List.
virtual Ostream & write(const token &)
Write token.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
fileName path() const
Explicitly inherit path from TimePaths to disambiguate from.
label fcIndex(const label i) const
Return the forward circular index, i.e. the next index.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
static bool & parRun()
Is this a parallel run?
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
label size() const
Return the number of elements in the UPtrList.
static const Form rootMax
Adds layers of cells to outside of polyPatch. Can optionally create stand-alone extruded mesh (addToM...
static void calcSidePatch(const polyMesh &, const globalIndex &globalFaces, const labelListList &globalEdgeFaces, const indirectPrimitivePatch &pp, labelList &sidePatchID, label &nPatches, Map< label > &nbrProcToPatch, Map< label > &patchToNbrProc)
Boundary edges get extruded into boundary faces. Determine patch.
static labelListList addedCells(const polyMesh &, const labelListList &layerFaces)
Helper: get added cells per patch face.
void updateZones(polyMesh &mesh)
Update the mesh zones.
void topoChange(const polyTopoChangeMap &, const labelList &faceMap, const labelList &pointMap)
Update any locally stored mesh information. Gets additional.
void setRefinement(const polyMesh &mesh, const globalIndex &globalFaces, const labelListList &globalEdgeFaces, const scalarField &expansionRatio, const indirectPrimitivePatch &pp, const labelList &sidePatchID, const labelList &exposedPatchID, const labelList &nFaceLayers, const labelList &nPointLayers, const vectorField &firstLayerDisp, const labelList &faceCellZones, polyTopoChange &meshMod)
Play commands into polyTopoChange to create layers on top.
static labelListList globalEdgeFaces(const polyMesh &, const globalIndex &globalFaces, const indirectPrimitivePatch &pp)
Per patch edge the pp faces (in global indices) using it. Uses.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
A collection of cell labels.
Abstract base class for decomposition.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
bool add(entry *, bool mergeEntry=false)
Add a new entry.
bool merge(const dictionary &)
Merge entries from the given dictionary.
const word & name() const
Return const reference to name.
static autoPtr< externalDisplacementMeshMover > New(const word &type, const dictionary &dict, const List< labelPair > &baffles, pointVectorField &pointDisplacement)
Return a reference to the selected meshMover model.
word name() const
Return file name (part beyond last /)
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.
const word & name() const
Return reference to name.
virtual void topoChange(const polyTopoChangeMap &map)
Update mesh corresponding to the given map.
virtual void addPatch(const label insertPatchi, const polyPatch &patch)
Add/insert single patch.
void clearOut()
Clear all geometry and addressing.
virtual void setPoints(const pointField &)
Reset the points.
const polyMesh & poly() const
Return reference to polyMesh.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
const labelList & coupledPatchMeshEdges() const
Return map from coupledPatch edges to mesh edges.
Simple container to keep together layer specific information.
scalar finalLayerThicknessRatio(const label nLayers, const scalar expansionRatio) const
Determine ratio of final layer thickness to.
const dictionary & dict() const
const labelList & numLayers() const
How many layers to add:
scalar featureAngle() const
label nRelaxedIter() const
Number of iterations after which relaxed motion rules.
const Switch & additionalReporting() const
scalar concaveAngle() const
label nGrow() const
If points get not extruded do nGrow layers of connected faces.
const List< mergeFace > & mergeFaces() const
Whether to merge boundary faces of the same layer cell.
label nBufferCellsNoExtrude() const
Create buffer region for new layer terminations.
bool relativeSizes() const
Are size parameters relative to inner cell size or.
scalar maxFaceThicknessRatio() const
Stop layer growth on highly warped cells.
label nLayerIter() const
Number of overall layer addition iterations.
const word & meshShrinker() const
Type of mesh shrinker.
static labelPairList findDuplicateFacePairs(const polyMesh &)
Helper routine to find all baffles (two boundary faces.
Helper class which maintains intersections of (changing) mesh with (static) surfaces.
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.
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.
const word & name() const
Return name.
Motion of the mesh specified as a list of pointMeshMovers.
Mesh consisting of general polyhedral cells.
const polyBoundaryMesh & boundary() const
Return boundary mesh.
virtual const faceList & faces() const
Return raw faces.
virtual const labelList & faceOwner() const
Return face owner.
const globalMeshData & globalData() const
Return parallel info.
virtual const pointField & points() const
Return raw points.
void setInstance(const fileName &)
Set the instance for mesh files.
A patch is a list of labels that address the faces in the global face list.
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
const labelUList & faceCells() const
Return face-cell addressing.
Direct mesh changes based on v1.3 polyTopoChange syntax.
autoPtr< polyTopoChangeMap > makeMesh(autoPtr< fvMesh > &newMesh, const IOobject &io, const polyMesh &mesh, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
Create new mesh with old mesh patches.
autoPtr< polyTopoChangeMap > changeMesh(polyMesh &mesh, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
Inplace changes mesh without change of patches.
const labelListList & pointEdges() const
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
const vectorField & faceCentres() const
label nInternalFaces() const
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
const cellList & cells() const
virtual bool write(const bool write=true) const
Write using setting from DB.
All to do with adding layers.
snappyLayerDriver(meshRefinement &meshRefiner, const labelList &globalToMasterPatch, const labelList &globalToSlavePatch)
Construct from components.
void doLayers(const dictionary &shrinkDict, const dictionary &motionDict, const layerParameters &layerParams, const bool preBalance, decompositionMethod &decomposer, fvMeshDistribute &distributor)
Add layers according to the dictionary settings.
void addLayers(const layerParameters &layerParams, const dictionary &motionDict, const labelList &patchIDs, const label nAllowableErrors, decompositionMethod &decomposer, fvMeshDistribute &distributor)
Add cell layers.
void mergePatchFacesUndo(const layerParameters &layerParams, const dictionary &motionDict)
Merge patch faces on same cell.
A class for managing temporary objects.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
volVectorField vectorField(fieldObject, mesh)
gmvFile<< "tracers "<< particles.size()<< nl;{ pointField positions(particles.size());label particlei=0;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter) { positions[particlei++]=iter().position(mesh);} for(i=0;i< pTraits< point >::nComponents;i++) { forAll(positions, particlei) { gmvFile<< component(positions[particlei], i)<< ' ';} gmvFile<< nl;}}forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.name(), lagrangian::cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const fvPatchList & patches
Functions for checking mesh topology and geometry.
#define WarningInFunction
Report a warning using Foam::Warning.
bool checkMesh(const bool report, const polyMesh &mesh, const dictionary &dict, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet &wrongFaces)
Check (subset of mesh including baffles) with mesh settings in dict.
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< word > wordList
A List of words.
Smanip< ios_base::fmtflags > setf(const ios_base::fmtflags flags)
pointField vertices(const blockVertexList &bvl)
Omanip< int > setprecision(const int i)
scalar radToDeg(const scalar rad)
Convert radians to degrees.
const dimensionSet & dimless
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
line< point, const point & > linePointRef
Line using referred points.
Omanip< int > setw(const int i)
const dimensionSet & dimLength
String typeName(const std::type_info &info)
Return the un-mangled name given the standard type info.
errorManip< error > abort(error &err)
vectorField pointField
pointField is a vectorField.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
List< bool > boolList
Bool container classes.
vector point
Point is a vector.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Vector< scalar > vector
A scalar version of the templated Vector.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
List< labelList > labelListList
A List of labelList.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
VolField< scalar > volScalarField
dimensioned< Type > min(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Field< vector > vectorField
Specialisation of Field<T> for vector.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
Type gMax(const UList< Type > &f, const label comm)
prefixOSstream Pout(cout, "Pout")
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
tmp< DimensionedField< scalar, GeoMesh, Field > > mag(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
static const label labelMax
labelList identityMap(const label len)
Create identity map (map[i] == i) of given length.
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
Foam::indirectPrimitivePatch.
defineTypeNameAndDebug(atmosphericBoundaryLayer, 0)
Ostream & indent(Ostream &os)
Indent stream.
dimensionedScalar cos(const dimensionedScalar &ds)
static const label labelMin
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
void inplaceReorder(const labelUList &oldToNew, ListType &)
Inplace reorder the elements of a list.