76 void Foam::snappyLayerDriver::dumpDisplacement
78 const fileName& prefix,
81 const List<extrudeMode>& extrudeStatus
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;
169 labelList outsideFaces(mesh.nFaces() - mesh.nInternalFaces());
171 for (
label facei = mesh.nInternalFaces(); facei < mesh.nFaces(); facei++)
173 outsideFaces[facei - mesh.nInternalFaces()] = facei;
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,
221 List<extrudeMode>& extrudeStatus
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,
251 List<extrudeMode>& extrudeStatus
254 bool unextruded =
false;
277 void Foam::snappyLayerDriver::handleNonManifolds
284 List<extrudeMode>& extrudeStatus
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]]);
319 PackedBoolList isCoupledEdge(mesh.nEdges());
321 const labelList& cpEdges = mesh.globalData().coupledPatchMeshEdges();
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
395 List<extrudeMode>& extrudeStatus
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,
515 List<extrudeMode>& extrudeStatus
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];
534 label ownLevel = cellLevel[mesh.faceOwner()[facei]];
535 scalar edgeLen = edge0Len/(1<<ownLevel);
538 const point& fc = mesh.faceCentres()[facei];
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
689 List<extrudeMode>& extrudeStatus,
693 const fvMesh& mesh = meshRefiner_.mesh();
695 Info<<
nl <<
"Handling points with inconsistent layer specification ..."
707 const labelList& meshPoints = mesh.boundaryMesh()[
patchi].meshPoints();
711 forAll(meshPoints, patchPointi)
713 label ppPointi = pp.meshPointMap()[meshPoints[patchPointi]];
715 maxLayers[ppPointi] =
max(wantedLayers, maxLayers[ppPointi]);
716 minLayers[ppPointi] =
min(wantedLayers, minLayers[ppPointi]);
747 <<
"Patchpoint:" << i <<
" coord:" << pp.localPoints()[i]
748 <<
" maxLayers:" << maxLayers
749 <<
" minLayers:" << minLayers
752 else if (maxLayers[i] == minLayers[i])
755 patchNLayers[i] = maxLayers[i];
773 patchNLayers[i] = maxLayers[i];
780 forAll(pp.localFaces(), facei)
782 const face&
f = pp.localFaces()[facei];
788 nCells =
max(nCells, patchNLayers[
f[fp]]);
791 nAddedCells += nCells;
793 reduce(nAddedCells, sumOp<label>());
806 Foam::snappyLayerDriver::makeLayerDisplacementField
808 const pointMesh& pMesh,
813 const pointBoundaryMesh& pointPatches = pMesh.boundary();
818 slipPointPatchVectorField::typeName
820 wordList actualPatchTypes(patchFieldTypes.size());
830 if (numLayers[
patchi] == 0)
833 zeroFixedValuePointPatchVectorField::typeName;
835 else if (numLayers[
patchi] > 0)
837 patchFieldTypes[
patchi] = fixedValuePointPatchVectorField::typeName;
843 if (isA<processorPointPatch>(pointPatches[
patchi]))
845 patchFieldTypes[
patchi] = calculatedPointPatchVectorField::typeName;
847 else if (isA<cyclicPointPatch>(pointPatches[
patchi]))
849 patchFieldTypes[
patchi] = cyclicSlipPointPatchVectorField::typeName;
856 tmp<pointVectorField> tfld
871 void Foam::snappyLayerDriver::growNoExtrusion
876 List<extrudeMode>& extrudeStatus
879 Info<<
nl <<
"Growing non-extrusion points by one layer ..." <<
endl;
881 List<extrudeMode> grownExtrudeStatus(extrudeStatus);
883 const faceList& localFaces = pp.localFaces();
889 const face&
f = localFaces[facei];
891 bool hasSqueeze =
false;
894 if (extrudeStatus[
f[fp]] == NOEXTRUDE)
908 extrudeStatus[
f[fp]] == EXTRUDE
909 && grownExtrudeStatus[
f[fp]] != NOEXTRUDE
912 grownExtrudeStatus[
f[fp]] = NOEXTRUDE;
919 extrudeStatus.transfer(grownExtrudeStatus);
928 status[i] = extrudeStatus[i];
940 extrudeStatus[i] = extrudeMode(status[i]);
945 forAll(extrudeStatus, patchPointi)
947 if (extrudeStatus[patchPointi] == NOEXTRUDE)
949 patchDisp[patchPointi] =
Zero;
950 patchNLayers[patchPointi] = 0;
954 reduce(nGrown, sumOp<label>());
956 Info<<
"Set displacement to zero for an additional " << nGrown
957 <<
" points." <<
endl;
961 void Foam::snappyLayerDriver::determineSidePatches
963 const globalIndex& globalFaces,
976 fvMesh& mesh = meshRefiner_.mesh();
982 Map<label> nbrProcToPatch;
983 Map<label> patchToNbrProc;
997 label nOldPatches = mesh.boundaryMesh().size();
999 Info<<
nl <<
"Adding in total " << nAdded/2 <<
" inter-processor patches to"
1000 <<
" handle extrusion of non-manifold processor boundaries."
1007 Map<label> wantedToAddedPatch;
1012 const label procPatchi = mesh.boundaryMesh().size();
1013 const processorPolyPatch pp
1018 mesh.boundaryMesh(),
1030 wantedToAddedPatch.insert(
patchi, procPatchi);
1038 if (fnd != wantedToAddedPatch.end())
1040 sidePatchID[i] = fnd();
1045 const_cast<polyBoundaryMesh&
>(mesh.boundaryMesh()).topoChange();
1050 void Foam::snappyLayerDriver::calculateLayerThickness
1054 const layerParameters& layerParams,
1057 const scalar edge0Len,
1064 const fvMesh& mesh = meshRefiner_.mesh();
1065 const polyBoundaryMesh&
patches = mesh.boundaryMesh();
1072 scalarField firstLayerThickness(pp.nPoints(), great);
1073 scalarField finalLayerThickness(pp.nPoints(), great);
1077 minThickness.setSize(pp.nPoints());
1078 minThickness = great;
1086 forAll(meshPoints, patchPointi)
1088 label ppPointi = pp.meshPointMap()[meshPoints[patchPointi]];
1090 firstLayerThickness[ppPointi] =
min
1092 firstLayerThickness[ppPointi],
1093 layerParams.firstLayerThickness()[
patchi]
1095 finalLayerThickness[ppPointi] =
min
1097 finalLayerThickness[ppPointi],
1098 layerParams.finalLayerThickness()[
patchi]
1100 totalThickness[ppPointi] =
min
1102 totalThickness[ppPointi],
1103 layerParams.thickness()[
patchi]
1105 expRatio[ppPointi] =
min
1108 layerParams.expansionRatio()[
patchi]
1110 minThickness[ppPointi] =
min
1112 minThickness[ppPointi],
1113 layerParams.minThickness()[
patchi]
1122 firstLayerThickness,
1130 finalLayerThickness,
1168 if (layerParams.relativeSizes())
1172 min(layerParams.minThickness()) < 0
1173 ||
max(layerParams.minThickness()) > 2
1177 <<
"Thickness should be factor of local undistorted cell size."
1178 <<
" Valid values are [0..2]." <<
nl
1179 <<
" minThickness:" << layerParams.minThickness()
1191 label ownLevel = cellLevel[mesh.faceOwner()[pp.addressing()[i]]];
1193 const face&
f = pp.localFaces()[i];
1197 maxPointLevel[
f[fp]] =
max(maxPointLevel[
f[fp]], ownLevel);
1211 forAll(maxPointLevel, pointi)
1214 scalar edgeLen = edge0Len/(1<<maxPointLevel[pointi]);
1215 firstLayerThickness[pointi] *= edgeLen;
1216 finalLayerThickness[pointi] *= edgeLen;
1217 totalThickness[pointi] *= edgeLen;
1218 minThickness[pointi] *= edgeLen;
1227 forAll(firstLayerThickness, pointi)
1229 thickness[pointi] = layerParams.layerThickness
1231 patchNLayers[pointi],
1232 firstLayerThickness[pointi],
1233 finalLayerThickness[pointi],
1234 totalThickness[pointi],
1238 expansionRatio[pointi] = layerParams.layerExpansionRatio
1240 patchNLayers[pointi],
1241 firstLayerThickness[pointi],
1242 finalLayerThickness[pointi],
1243 totalThickness[pointi],
1253 const polyBoundaryMesh&
patches = mesh.boundaryMesh();
1255 int oldPrecision =
Info().precision();
1258 label maxPatchNameLen = 0;
1263 maxPatchNameLen =
max(maxPatchNameLen,
label(patchName.size()));
1267 <<
setf(ios_base::left) <<
setw(maxPatchNameLen) <<
"patch"
1268 <<
setw(0) <<
" faces layers avg thickness[m]" <<
nl
1269 <<
setf(ios_base::left) <<
setw(maxPatchNameLen) <<
" "
1270 <<
setw(0) <<
" near-wall overall" <<
nl
1271 <<
setf(ios_base::left) <<
setw(maxPatchNameLen) <<
"-----"
1272 <<
setw(0) <<
" ----- ------ --------- -------" <<
endl;
1283 scalar sumThickness = 0;
1284 scalar sumNearWallThickness = 0;
1285 label nMasterPoints = 0;
1287 forAll(meshPoints, patchPointi)
1289 label meshPointi = meshPoints[patchPointi];
1290 if (isMasterPoint[meshPointi])
1292 label ppPointi = pp.meshPointMap()[meshPointi];
1294 sumThickness += thickness[ppPointi];
1295 sumNearWallThickness += layerParams.firstLayerThickness
1297 patchNLayers[ppPointi],
1298 firstLayerThickness[ppPointi],
1299 finalLayerThickness[ppPointi],
1300 thickness[ppPointi],
1301 expansionRatio[ppPointi]
1310 scalar avgThickness = 0;
1311 scalar avgNearWallThickness = 0;
1318 avgNearWallThickness =
1327 <<
" " <<
setw(6) << layerParams.numLayers()[
patchi]
1328 <<
" " <<
setw(8) << avgNearWallThickness
1329 <<
" " <<
setw(8) << avgThickness
1338 void Foam::snappyLayerDriver::syncPatchDisplacement
1344 List<extrudeMode>& extrudeStatus
1347 const fvMesh& mesh = meshRefiner_.mesh();
1348 const labelList& meshPoints = pp.meshPoints();
1360 minMagSqrEqOp<vector>(),
1367 if (
mag(patchDisp[i]) < minThickness[i])
1385 labelList syncPatchNLayers(patchNLayers);
1398 forAll(syncPatchNLayers, i)
1400 if (syncPatchNLayers[i] != patchNLayers[i])
1429 forAll(syncPatchNLayers, i)
1431 if (syncPatchNLayers[i] != patchNLayers[i])
1462 void Foam::snappyLayerDriver::getPatchDisplacement
1469 List<extrudeMode>& extrudeStatus
1472 Info<<
nl <<
"Determining displacement for added points"
1473 <<
" according to pointNormal ..." <<
endl;
1475 const fvMesh& mesh = meshRefiner_.mesh();
1476 const vectorField& faceNormals = pp.faceNormals();
1478 const pointField& localPoints = pp.localPoints();
1490 patchDisp = thickness*pointNormals;
1493 label nNoVisNormal = 0;
1494 label nExtrudeRemove = 0;
1498 forAll(pointNormals, patchPointi)
1500 label meshPointi = pp.meshPoints()[patchPointi];
1502 if (extrudeStatus[patchPointi] == NOEXTRUDE)
1505 patchNLayers[patchPointi] = 0;
1506 patchDisp[patchPointi] =
Zero;
1511 const vector&
n = pointNormals[patchPointi];
1517 Pout<<
"No valid normal for point " << meshPointi
1518 <<
' ' << pp.points()[meshPointi]
1519 <<
"; setting displacement to "
1520 << patchDisp[patchPointi]
1524 extrudeStatus[patchPointi] = EXTRUDEREMOVE;
1531 forAll(extrudeStatus, patchPointi)
1533 if (extrudeStatus[patchPointi] == EXTRUDEREMOVE)
1538 const labelList& pEdges = pp.pointEdges()[patchPointi];
1542 label edgei = pEdges[i];
1544 label otherPointi = pp.edges()[edgei].otherVertex(patchPointi);
1546 if (extrudeStatus[otherPointi] != NOEXTRUDE)
1548 avg += localPoints[otherPointi] + patchDisp[otherPointi];
1557 Pout<<
"Displacement at illegal point "
1558 << localPoints[patchPointi]
1560 << (avg /
nPoints - localPoints[patchPointi])
1564 patchDisp[patchPointi] =
1566 - localPoints[patchPointi];
1579 <<
" points with point normal pointing through faces." <<
nl
1580 <<
"Reset displacement at "
1582 <<
" points to average of surrounding points." <<
endl;
1585 syncPatchDisplacement
1598 bool Foam::snappyLayerDriver::sameEdgeNeighbour
1601 const label myGlobalFacei,
1602 const label nbrGlobFacei,
1606 const labelList& eFaces = globalEdgeFaces[edgei];
1607 if (eFaces.size() == 2)
1609 return edge(myGlobalFacei, nbrGlobFacei) == edge(eFaces[0], eFaces[1]);
1618 void Foam::snappyLayerDriver::getVertexString
1624 const label myGlobFacei,
1625 const label nbrGlobFacei,
1629 const labelList& fEdges = pp.faceEdges()[facei];
1643 label prevFp = fEdges.rcIndex(startFp);
1663 label nextFp = fEdges.fcIndex(endFp);
1680 const face&
f = pp.localFaces()[facei];
1697 Foam::label Foam::snappyLayerDriver::truncateDisplacement
1699 const globalIndex& globalFaces,
1703 const faceSet& illegalPatchFaces,
1706 List<extrudeMode>& extrudeStatus
1709 const fvMesh& mesh = meshRefiner_.mesh();
1713 const Map<label>& meshPointMap = pp.meshPointMap();
1717 label facei = iter.key();
1719 if (mesh.isInternalFace(facei))
1722 <<
"Faceset " << illegalPatchFaces.name()
1723 <<
" contains internal face " << facei <<
nl
1727 const face&
f = mesh.faces()[facei];
1732 if (meshPointMap.found(
f[fp]))
1734 label patchPointi = meshPointMap[
f[fp]];
1736 if (extrudeStatus[patchPointi] != NOEXTRUDE)
1751 forAll(patchDisp, patchPointi)
1753 if (
mag(patchDisp[patchPointi]) < minThickness[patchPointi])
1769 else if (extrudeStatus[patchPointi] == NOEXTRUDE)
1772 patchDisp[patchPointi] =
Zero;
1773 patchNLayers[patchPointi] = 0;
1778 const faceList& localFaces = pp.localFaces();
1782 syncPatchDisplacement
1803 const face& localF = localFaces[i];
1808 extrudeMode prevMode = extrudeStatus[localF.prevLabel(0)];
1812 extrudeMode fpMode = extrudeStatus[localF[fp]];
1814 if (prevMode == NOEXTRUDE && fpMode != NOEXTRUDE)
1841 reduce(nPinched, sumOp<label>());
1843 Info<<
"truncateDisplacement : Unextruded " << nPinched
1844 <<
" faces due to non-consecutive vertices being extruded." <<
endl;
1867 label nButterFly = 0;
1869 DynamicList<label> stringedVerts;
1870 forAll(pp.edges(), edgei)
1872 const labelList& globFaces = edgeGlobalFaces[edgei];
1874 if (globFaces.size() == 2)
1876 label myFacei = pp.edgeFaces()[edgei][0];
1877 label myGlobalFacei = globalFaces.toGlobal
1879 pp.addressing()[myFacei]
1881 label nbrGlobalFacei =
1883 globFaces[0] != myGlobalFacei
1900 extrudeStatus[stringedVerts[0]] != NOEXTRUDE
1901 || extrudeStatus[stringedVerts.last()] != NOEXTRUDE
1906 for (
label i = 1; i < stringedVerts.size()-1; i++)
1910 extrudeStatus[stringedVerts[i]] == NOEXTRUDE
1942 reduce(nButterFly, sumOp<label>());
1944 Info<<
"truncateDisplacement : Unextruded " << nButterFly
1945 <<
" faces due to stringed edges with inconsistent extrusion."
1956 label nDiffering = 0;
2000 if (nPinched+nButterFly+nDiffering == 0)
2012 void Foam::snappyLayerDriver::setupLayerInfoTruncation
2016 const List<extrudeMode>& extrudeStatus,
2017 const label nBufferCellsNoExtrude,
2022 Info<<
nl <<
"Setting up information for layer truncation ..." <<
endl;
2024 const fvMesh& mesh = meshRefiner_.mesh();
2026 if (nBufferCellsNoExtrude < 0)
2028 Info<<
nl <<
"Performing no layer truncation."
2029 <<
" nBufferCellsNoExtrude set to less than 0 ..." <<
endl;
2032 forAll(pp.localFaces(), patchFacei)
2034 const face&
f = pp.localFaces()[patchFacei];
2038 if (patchNLayers[
f[fp]] > 0)
2040 nPatchFaceLayers[patchFacei] = patchNLayers[
f[fp]];
2045 nPatchPointLayers = patchNLayers;
2048 forAll(nPatchFaceLayers, patchFacei)
2050 if (nPatchFaceLayers[patchFacei] == -1)
2052 nPatchFaceLayers[patchFacei] = 0;
2061 forAll(pp.localFaces(), patchFacei)
2063 const face&
f = pp.localFaces()[patchFacei];
2068 bool noExtrude =
false;
2073 if (extrudeStatus[
f[fp]] == NOEXTRUDE)
2077 mLevel =
max(mLevel, patchNLayers[
f[fp]]);
2087 nPatchFaceLayers[patchFacei] = 1;
2088 maxLevel[patchFacei] = mLevel;
2092 maxLevel[patchFacei] = mLevel;
2107 for (
label ilevel = 1; ilevel < nLevels; ilevel++)
2113 nBuffer = nBufferCellsNoExtrude - 1;
2117 nBuffer = nBufferCellsNoExtrude;
2120 for (
label ibuffer = 0; ibuffer < nBuffer + 1; ibuffer++)
2122 labelList tempCounter(nPatchFaceLayers);
2124 boolList foundNeighbour(pp.nPoints(),
false);
2126 forAll(pp.meshPoints(), patchPointi)
2128 forAll(pointFaces[patchPointi], pointFacei)
2130 label facei = pointFaces[patchPointi][pointFacei];
2134 nPatchFaceLayers[facei] != -1
2135 && maxLevel[facei] > 0
2138 foundNeighbour[patchPointi] =
true;
2153 forAll(pp.meshPoints(), patchPointi)
2155 if (foundNeighbour[patchPointi])
2157 forAll(pointFaces[patchPointi], pointFacei)
2159 label facei = pointFaces[patchPointi][pointFacei];
2162 nPatchFaceLayers[facei] == -1
2163 && maxLevel[facei] > 0
2164 && ilevel < maxLevel[facei]
2167 tempCounter[facei] = ilevel;
2172 nPatchFaceLayers = tempCounter;
2176 forAll(pp.localFaces(), patchFacei)
2178 if (nPatchFaceLayers[patchFacei] == -1)
2180 nPatchFaceLayers[patchFacei] = maxLevel[patchFacei];
2184 forAll(pp.meshPoints(), patchPointi)
2186 if (extrudeStatus[patchPointi] != NOEXTRUDE)
2188 forAll(pointFaces[patchPointi], pointFacei)
2190 label face = pointFaces[patchPointi][pointFacei];
2191 nPatchPointLayers[patchPointi] =
max
2193 nPatchPointLayers[patchPointi],
2194 nPatchFaceLayers[face]
2200 nPatchPointLayers[patchPointi] = 0;
2216 bool Foam::snappyLayerDriver::cellsUseFace
2218 const polyMesh& mesh,
2225 const cell& cFaces = mesh.cells()[cellLabels[i]];
2229 if (faces.found(cFaces[cFacei]))
2242 Foam::label Foam::snappyLayerDriver::checkAndUnmark
2244 const addPatchCellLayer& addLayer,
2245 const dictionary& meshQualityDict,
2246 const bool additionalReporting,
2247 const List<labelPair>& baffles,
2249 const fvMesh& newMesh,
2253 List<extrudeMode>& extrudeStatus
2257 Info<<
nl <<
"Checking mesh with layer ..." <<
endl;
2258 faceSet wrongFaces(newMesh,
"wrongFaces", newMesh.nFaces()/1000);
2270 <<
" (concave, zero area or negative cell pyramid volume)"
2284 addLayer.layerFaces()
2292 const label nReportMax = 10;
2293 DynamicField<point> disabledFaceCentres(nReportMax);
2295 forAll(addedCells, oldPatchFacei)
2299 const labelList& fCells = addedCells[oldPatchFacei];
2301 if (cellsUseFace(newMesh, fCells, wrongFaces))
2308 pp.localFaces()[oldPatchFacei],
2315 if (additionalReporting && (nChanged < nReportMax))
2317 disabledFaceCentres.
append
2319 pp.faceCentres()[oldPatchFacei]
2331 if (additionalReporting)
2340 label nReportLocal = nChanged;
2341 if (nChangedTotal > nReportMax)
2356 Pout<<
"Checked mesh with layers. Disabled extrusion at " <<
endl;
2357 for (
label i=0; i < nReportLocal; i++)
2359 Pout<<
" " << disabledFaceCentres[i] <<
endl;
2365 if (nReportTotal < nChangedTotal)
2367 Info<<
"Suppressed disabled extrusion message for other "
2368 << nChangedTotal - nReportTotal <<
" faces." <<
endl;
2372 return nChangedTotal;
2376 Foam::label Foam::snappyLayerDriver::countExtrusion
2379 const List<extrudeMode>& extrudeStatus
2383 label nExtruded = 0;
2385 const faceList& localFaces = pp.localFaces();
2389 const face& localFace = localFaces[i];
2393 if (extrudeStatus[localFace[fp]] != NOEXTRUDE)
2407 void Foam::snappyLayerDriver::getLayerCellsFaces
2409 const polyMesh& mesh,
2410 const addPatchCellLayer& addLayer,
2417 cellNLayers.setSize(mesh.nCells());
2419 faceRealThickness.setSize(mesh.nFaces());
2420 faceRealThickness = 0;
2428 forAll(addedCells, oldPatchFacei)
2430 const labelList& added = addedCells[oldPatchFacei];
2432 const labelList& layer = layerFaces[oldPatchFacei];
2438 cellNLayers[added[i]] = layer.size()-1;
2443 forAll(layerFaces, oldPatchFacei)
2445 const labelList& layer = layerFaces[oldPatchFacei];
2446 const scalar realThickness = oldRealThickness[oldPatchFacei];
2452 for (
label i = 1; i < layer.size(); i++)
2454 faceRealThickness[layer[i]] = realThickness;
2461 void Foam::snappyLayerDriver::printLayerData
2470 const polyBoundaryMesh& pbm = mesh.boundaryMesh();
2472 int oldPrecision =
Info().precision();
2475 label maxPatchNameLen = 0;
2479 word patchName = pbm[
patchi].name();
2480 maxPatchNameLen =
max(maxPatchNameLen,
label(patchName.size()));
2484 <<
setf(ios_base::left) <<
setw(maxPatchNameLen) <<
"patch"
2485 <<
setw(0) <<
" faces layers overall thickness" <<
nl
2486 <<
setf(ios_base::left) <<
setw(maxPatchNameLen) <<
" "
2487 <<
setw(0) <<
" [m] [%]" <<
nl
2488 <<
setf(ios_base::left) <<
setw(maxPatchNameLen) <<
"-----"
2489 <<
setw(0) <<
" ----- ------ --- ---" <<
endl;
2495 const polyPatch& pp = pbm[
patchi];
2497 label sumSize = pp.size();
2500 const labelList& faceCells = pp.faceCells();
2501 label sumNLayers = 0;
2504 sumNLayers += cellNLayers[faceCells[i]];
2517 scalar sumRealThickness =
sum(patchReal);
2518 scalar sumFraction = 0;
2521 if (patchWanted[i] > vSmall)
2523 sumFraction += (patchReal[i]/patchWanted[i]);
2528 reduce(sumSize, sumOp<label>());
2529 reduce(sumNLayers, sumOp<label>());
2530 reduce(sumRealThickness, sumOp<scalar>());
2531 reduce(sumFraction, sumOp<scalar>());
2534 scalar avgLayers = 0;
2536 scalar avgFraction = 0;
2539 avgLayers = scalar(sumNLayers)/sumSize;
2540 avgReal = sumRealThickness/sumSize;
2541 avgFraction = sumFraction/sumSize;
2546 <<
" " <<
setw(8) << sumSize
2547 <<
" " <<
setw(8) << avgLayers
2548 <<
" " <<
setw(8) << avgReal
2549 <<
" " <<
setw(8) << 100*avgFraction
2556 bool Foam::snappyLayerDriver::writeLayerData
2571 forAll(cellNLayers, celli)
2573 if (cellNLayers[celli] > 0)
2578 cellSet addedCellSet(mesh,
"addedCells", nAdded);
2579 forAll(cellNLayers, celli)
2581 if (cellNLayers[celli] > 0)
2583 addedCellSet.insert(celli);
2586 addedCellSet.instance() = meshRefiner_.name();
2589 <<
" added cells to cellSet "
2590 << addedCellSet.name() <<
endl;
2591 bool ok = addedCellSet.
write();
2596 for (
label facei = 0; facei < mesh.nInternalFaces(); facei++)
2598 if (faceRealThickness[facei] > 0)
2604 faceSet layerFacesSet(mesh,
"layerFaces", nAdded);
2605 for (
label facei = 0; facei < mesh.nInternalFaces(); facei++)
2607 if (faceRealThickness[facei] > 0)
2609 layerFacesSet.insert(facei);
2612 layerFacesSet.instance() = meshRefiner_.name();
2615 <<
" faces inside added layer to faceSet "
2616 << layerFacesSet.name() <<
endl;
2617 bool ok = layerFacesSet.
write();
2640 fixedValueFvPatchScalarField::typeName
2642 const polyBoundaryMesh& pbm = mesh.boundaryMesh();
2645 fld.boundaryFieldRef();
2650 const polyPatch& pp = pbm[
patchi];
2651 const labelList& faceCells = pp.faceCells();
2655 pfld[i] = cellNLayers[faceCells[i]];
2661 bool ok =
fld.write();
2678 fixedValueFvPatchScalarField::typeName
2681 const polyBoundaryMesh& pbm = mesh.boundaryMesh();
2684 fld.boundaryFieldRef();
2696 bool ok =
fld.write();
2704 "thicknessFraction",
2713 fixedValueFvPatchScalarField::typeName
2716 const polyBoundaryMesh& pbm = mesh.boundaryMesh();
2719 fld.boundaryFieldRef();
2738 if (patchWanted[i] > vSmall)
2740 pfld[i] = patchReal[i]/patchWanted[i];
2747 <<
" : overall layer thickness (fraction"
2748 <<
" of desired thickness)" <<
endl;
2749 bool ok =
fld.write();
2762 faceWantedThickness,
2780 meshRefiner_(meshRefiner),
2781 globalToMasterPatch_(globalToMasterPatch),
2782 globalToSlavePatch_(globalToSlavePatch)
2802 <<
"Merging all faces of a cell" <<
nl
2803 <<
"---------------------------" <<
nl
2804 <<
" - which are on the same patch" <<
nl
2805 <<
" - which make an angle < " << planarAngle
2808 <<
" (cos:" << minCos <<
')' <<
nl
2809 <<
" - as long as the resulting face doesn't become concave"
2812 <<
" (0=straight, 180=fully concave)" <<
nl
2815 const fvMesh& mesh = meshRefiner_.mesh();
2823 duplicateFace[cpl[0]] = cpl[1];
2824 duplicateFace[cpl[1]] = cpl[0];
2841 meshRefiner_.mergePatchFacesUndo
2850 meshRefiner_.mergeEdgesUndo(minCos, motionDict);
2859 const label nAllowableErrors,
2864 fvMesh& mesh = meshRefiner_.mesh();
2869 meshRefiner_.createZoneBaffles
2871 globalToMasterPatch_,
2872 globalToSlavePatch_,
2879 Info<<
"Writing baffled mesh to time "
2880 << meshRefiner_.name() <<
endl;
2924 determineSidePatches
2945 label nIdealTotAddedCells = 0;
3005 const scalar edge0Len =
3006 meshRefiner_.meshCutter().level0EdgeLength();
3007 const labelList& cellLevel = meshRefiner_.meshCutter().cellLevel();
3036 for (
label i = 0; i < layerParams.
nGrow(); i++)
3050 const scalar edge0Len = meshRefiner_.meshCutter().level0EdgeLength();
3051 const labelList& cellLevel = meshRefiner_.meshCutter().cellLevel();
3061 meshRefiner_.name(),
3068 calculateLayerThickness
3095 avgPointData(pp, thickness);
3103 makeLayerDisplacementField
3116 combinedDict.
merge(motionDict);
3118 combinedDict.
add(
"minThicknessName", minThickness.
name());
3137 label iteration = 0;
3143 <<
"Layer addition iteration " << iteration <<
nl
3144 <<
"--------------------------" <<
endl;
3152 : motionDict.
subDict(
"relaxed")
3157 Info<<
"Switched to relaxed meshQuality constraints." <<
endl;
3163 syncPatchDisplacement
3173 getPatchDisplacement
3206 combinedDict.
merge(motionDict);
3208 combinedDict.
merge(meshQualityDict);
3210 combinedDict.
add(
"minThicknessName", minThickness.
name());
3213 medialAxisMoverPtr().move
3223 patchDisp = oldPatchPos - pp().localPoints();
3229 faceSet dummySet(mesh,
"wrongPatchFaces", 0);
3230 truncateDisplacement
3255 Info<<
"Writing shrunk mesh to time "
3256 << meshRefiner_.name() <<
endl;
3285 labelList nPatchFaceLayers(pp().size(), -1);
3286 setupLayerInfoTruncation
3300 forAll(nPatchPointLayers, i)
3304 nPatchPointLayers[i],
3307 finalDisp[i] = ratio*patchDisp[i];
3311 const scalarField invExpansionRatio(1.0/expansionRatio);
3336 savedMeshMod = meshMod;
3358 fvMesh& newMesh = newMeshPtr();
3380 newMeshBaffles[i][0] = map().reverseFaceMap()[
p[0]];
3381 newMeshBaffles[i][1] = map().reverseFaceMap()[
p[1]];
3389 avgPointData(pp,
mag(patchDisp))(),
3397 label nAddedCells = 0;
3398 forAll(cellNLayers, celli)
3400 if (cellNLayers[celli] > 0)
3409 Info<<
"Writing layer mesh to time " << meshRefiner_.name()
3413 cellSet addedCellSet(newMesh,
"addedCells", nAddedCells);
3414 forAll(cellNLayers, celli)
3416 if (cellNLayers[celli] > 0)
3418 addedCellSet.
insert(celli);
3424 <<
" added cells to cellSet " << addedCellSet.
name()
3426 addedCellSet.
write();
3436 if (faceRealThickness[facei] > 0)
3438 layerFacesSet.
insert(facei);
3444 <<
" faces inside added layer to faceSet "
3446 layerFacesSet.
write();
3450 label nTotChanged = checkAndUnmark
3464 label nTotExtruded = countExtrusion(pp, extrudeStatus);
3468 Info<<
"Extruding " << nTotExtruded
3469 <<
" out of " << nTotFaces
3470 <<
" faces (" << 100.0*nTotExtruded/nTotFaces <<
"%)."
3471 <<
" Removed extrusion at " << nTotChanged <<
" faces."
3473 <<
"Added " << nTotAddedCells <<
" out of "
3474 << nIdealTotAddedCells <<
" cells ("
3475 << 100.0*nTotAddedCells/nIdealTotAddedCells <<
"%)."
3478 if (nTotChanged == 0)
3488 for (
label i = 0; i < layerParams.
nGrow(); i++)
3517 if (map().hasMotionPoints())
3530 meshRefiner_.topoChange(map,
labelList(0));
3539 p[0] = map().reverseFaceMap()[
p[0]];
3540 p[1] = map().reverseFaceMap()[
p[1]];
3548 Info<<
"Converting " << nBaffles
3549 <<
" baffles back into zoned faces ..."
3558 Info<<
"Converted baffles in = "
3559 << meshRefiner_.mesh().time().cpuTimeIncrement()
3570 <<
"Doing final balancing" <<
nl
3571 <<
"---------------------" <<
nl
3593 map().distributeCellData(cellNLayers);
3594 map().distributeFaceData(faceWantedThickness);
3595 map().distributeFaceData(faceRealThickness);
3607 faceWantedThickness,
3618 const bool preBalance,
3623 const fvMesh& mesh = meshRefiner_.mesh();
3626 <<
"Shrinking and layer addition phase" <<
nl
3627 <<
"----------------------------------" <<
nl
3630 Info<<
"Using mesh parameters " << motionDict <<
nl <<
endl;
3633 mergePatchFacesUndo(layerParams, motionDict);
3640 label nFacesWithLayers = 0;
3643 if (numLayers[
patchi] > 0)
3655 <<
"Ignoring layers on coupled patch " << pp.
name()
3664 Info<<
nl <<
"No layers to generate ..." <<
endl;
3669 checkMeshManifold();
3672 Info<<
"Checking initial mesh ..." <<
endl;
3681 Info<<
"Detected " << nInitErrors <<
" illegal faces"
3682 <<
" (concave, zero area or negative cell pyramid volume)"
3690 <<
"Doing initial balancing" <<
nl
3691 <<
"-----------------------" <<
nl
3697 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 polyMesh &mesh)
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, PatchField, GeoMesh > Boundary
Type of the boundary field.
static tmp< GeometricField< Type, pointPatchField, pointMesh > > New(const word &name, const Internal &, const PtrList< pointPatchField< Type >> &)
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.
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...
writeOption writeOpt() const
fileName & instance() const
Return the instance directory, constant, system, <time> etc.
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.
HashTable< label, label, Hash< label > >::const_iterator const_iterator
virtual Ostream & write(const char)=0
Write character.
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.
void setRefinement(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, polyTopoChange &meshMod)
Play commands into polyTopoChange to create layers on top.
void topoChange(const polyTopoChangeMap &, const labelList &faceMap, const labelList &pointMap)
Update any locally stored mesh information. Gets additional.
labelListList addedCells() const
Added cells given current mesh & layerfaces.
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 keyword definitions, which are a keyword followed by any number of values (e....
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.
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.
virtual tmp< scalarField > movePoints(const pointField &)
Move points, returns volumes swept by faces in motion.
virtual bool write(const bool write=true) const
Write mesh using IO settings from time.
const word & name() const
Return reference to name.
virtual void topoChange(const polyTopoChangeMap &map)
Update mesh corresponding to the given map.
void clearOut()
Clear all geometry and addressing.
static const word & calculatedType()
Return the type of the calculated for of fvPatchField.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
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.
static bool checkMesh(const bool report, const polyMesh &mesh, const dictionary &dict, labelHashSet &wrongFaces)
Check mesh with mesh settings in dict. Collects incorrect faces.
const word & name() const
Return name.
Mesh consisting of general polyhedral cells.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
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 > changeMesh(polyMesh &mesh, const bool inflate, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
Inplace changes mesh without change of patches.
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.
const labelListList & pointEdges() const
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
label nInternalFaces() 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.
#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(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(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const fvPatchList & patches
#define WarningInFunction
Report a warning using Foam::Warning.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
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)
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)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
errorManip< error > abort(error &err)
const dimensionSet dimless
const dimensionSet dimLength
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.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
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< scalar > mag(const dimensioned< Type > &)
defineTypeNameAndDebug(combustionModel, 0)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
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)
prefixOSstream Pout(cout, "Pout")
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
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.
Ostream & indent(Ostream &os)
Indent stream.
Type gMax(const FieldField< Field, Type > &f)
dimensionedScalar cos(const dimensionedScalar &ds)
static const label labelMin
scalar degToRad(const scalar deg)
Conversion from degrees to radians.
void inplaceReorder(const labelUList &oldToNew, ListType &)
Inplace reorder the elements of a list.
Unit conversion functions.