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;
434 if (debug&meshRefinement::MESH)
442 + meshRefiner_.timeName()
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];
545 vector n = points[f[fp]] - fc;
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 ..." 705 label patchi = patchIDs[i];
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());
821 forAll(pointPatches, patchi)
830 if (numLayers[patchi] == 0)
833 zeroFixedValuePointPatchVectorField::typeName;
835 else if (numLayers[patchi] > 0)
837 patchFieldTypes[
patchi] = fixedValuePointPatchVectorField::typeName;
841 forAll(pointPatches, patchi)
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;
1009 for (
label patchi = nOldPatches; patchi <
nPatches; patchi++)
1012 const label procPatchi = mesh.boundaryMesh().size();
1013 const processorPolyPatch pp
1018 mesh.boundaryMesh(),
1030 wantedToAddedPatch.insert(patchi, procPatchi);
1036 label patchi = sidePatchID[i];
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;
1082 label patchi = patchIDs[i];
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;
1261 label patchi = patchIDs[i];
1262 word patchName = patches[
patchi].name();
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;
1279 label patchi = patchIDs[i];
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 =
1326 <<
returnReduce(patches[patchi].size(), sumOp<scalar>())
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();
1350 label nChangedTotal = 0;
1362 minMagSqrEqOp<vector>(),
1369 if (
mag(patchDisp[i]) < minThickness[i])
1387 labelList syncPatchNLayers(patchNLayers);
1400 forAll(syncPatchNLayers, i)
1402 if (syncPatchNLayers[i] != patchNLayers[i])
1431 forAll(syncPatchNLayers, i)
1433 if (syncPatchNLayers[i] != patchNLayers[i])
1450 nChangedTotal += nChanged;
1469 void Foam::snappyLayerDriver::getPatchDisplacement
1476 List<extrudeMode>& extrudeStatus
1479 Info<< nl <<
"Determining displacement for added points" 1480 <<
" according to pointNormal ..." <<
endl;
1482 const fvMesh& mesh = meshRefiner_.mesh();
1483 const vectorField& faceNormals = pp.faceNormals();
1485 const pointField& localPoints = pp.localPoints();
1497 patchDisp = thickness*pointNormals;
1500 label nNoVisNormal = 0;
1501 label nExtrudeRemove = 0;
1505 forAll(pointNormals, patchPointi)
1507 label meshPointi = pp.meshPoints()[patchPointi];
1509 if (extrudeStatus[patchPointi] == NOEXTRUDE)
1512 patchNLayers[patchPointi] = 0;
1513 patchDisp[patchPointi] =
Zero;
1518 const vector& n = pointNormals[patchPointi];
1524 Pout<<
"No valid normal for point " << meshPointi
1525 <<
' ' << pp.points()[meshPointi]
1526 <<
"; setting displacement to " 1527 << patchDisp[patchPointi]
1531 extrudeStatus[patchPointi] = EXTRUDEREMOVE;
1538 forAll(extrudeStatus, patchPointi)
1540 if (extrudeStatus[patchPointi] == EXTRUDEREMOVE)
1545 const labelList& pEdges = pp.pointEdges()[patchPointi];
1549 label edgei = pEdges[i];
1551 label otherPointi = pp.edges()[edgei].otherVertex(patchPointi);
1553 if (extrudeStatus[otherPointi] != NOEXTRUDE)
1555 avg += localPoints[otherPointi] + patchDisp[otherPointi];
1564 Pout<<
"Displacement at illegal point " 1565 << localPoints[patchPointi]
1567 << (avg / nPoints - localPoints[patchPointi])
1571 patchDisp[patchPointi] =
1573 - localPoints[patchPointi];
1586 <<
" points with point normal pointing through faces." << nl
1587 <<
"Reset displacement at " 1589 <<
" points to average of surrounding points." <<
endl;
1592 syncPatchDisplacement
1605 bool Foam::snappyLayerDriver::sameEdgeNeighbour
1608 const label myGlobalFacei,
1609 const label nbrGlobFacei,
1613 const labelList& eFaces = globalEdgeFaces[edgei];
1614 if (eFaces.size() == 2)
1616 return edge(myGlobalFacei, nbrGlobFacei) == edge(eFaces[0], eFaces[1]);
1625 void Foam::snappyLayerDriver::getVertexString
1631 const label myGlobFacei,
1632 const label nbrGlobFacei,
1633 DynamicList<label>& vertices
1636 const labelList& fEdges = pp.faceEdges()[facei];
1650 label prevFp = fEdges.rcIndex(startFp);
1670 label nextFp = fEdges.fcIndex(endFp);
1687 const face& f = pp.localFaces()[facei];
1692 vertices.append(f[fp]);
1695 vertices.append(f[fp]);
1697 vertices.append(f[fp]);
1704 Foam::label Foam::snappyLayerDriver::truncateDisplacement
1706 const globalIndex& globalFaces,
1710 const faceSet& illegalPatchFaces,
1713 List<extrudeMode>& extrudeStatus
1716 const fvMesh& mesh = meshRefiner_.mesh();
1720 const Map<label>& meshPointMap = pp.meshPointMap();
1724 label facei = iter.key();
1726 if (mesh.isInternalFace(facei))
1729 <<
"Faceset " << illegalPatchFaces.name()
1730 <<
" contains internal face " << facei << nl
1734 const face& f = mesh.faces()[facei];
1739 if (meshPointMap.found(f[fp]))
1741 label patchPointi = meshPointMap[f[fp]];
1743 if (extrudeStatus[patchPointi] != NOEXTRUDE)
1758 forAll(patchDisp, patchPointi)
1760 if (
mag(patchDisp[patchPointi]) < minThickness[patchPointi])
1776 else if (extrudeStatus[patchPointi] == NOEXTRUDE)
1779 patchDisp[patchPointi] =
Zero;
1780 patchNLayers[patchPointi] = 0;
1785 const faceList& localFaces = pp.localFaces();
1789 syncPatchDisplacement
1810 const face& localF = localFaces[i];
1815 extrudeMode prevMode = extrudeStatus[localF.prevLabel(0)];
1819 extrudeMode fpMode = extrudeStatus[localF[fp]];
1821 if (prevMode == NOEXTRUDE && fpMode != NOEXTRUDE)
1848 reduce(nPinched, sumOp<label>());
1850 Info<<
"truncateDisplacement : Unextruded " << nPinched
1851 <<
" faces due to non-consecutive vertices being extruded." <<
endl;
1874 label nButterFly = 0;
1876 DynamicList<label> stringedVerts;
1877 forAll(pp.edges(), edgei)
1879 const labelList& globFaces = edgeGlobalFaces[edgei];
1881 if (globFaces.size() == 2)
1883 label myFacei = pp.edgeFaces()[edgei][0];
1884 label myGlobalFacei = globalFaces.toGlobal
1886 pp.addressing()[myFacei]
1888 label nbrGlobalFacei =
1890 globFaces[0] != myGlobalFacei
1907 extrudeStatus[stringedVerts[0]] != NOEXTRUDE
1908 || extrudeStatus[stringedVerts.last()] != NOEXTRUDE
1913 for (
label i = 1; i < stringedVerts.size()-1; i++)
1917 extrudeStatus[stringedVerts[i]] == NOEXTRUDE
1949 reduce(nButterFly, sumOp<label>());
1951 Info<<
"truncateDisplacement : Unextruded " << nButterFly
1952 <<
" faces due to stringed edges with inconsistent extrusion." 1963 label nDiffering = 0;
2007 if (nPinched+nButterFly+nDiffering == 0)
2019 void Foam::snappyLayerDriver::setupLayerInfoTruncation
2023 const List<extrudeMode>& extrudeStatus,
2024 const label nBufferCellsNoExtrude,
2029 Info<< nl <<
"Setting up information for layer truncation ..." <<
endl;
2031 const fvMesh& mesh = meshRefiner_.mesh();
2033 if (nBufferCellsNoExtrude < 0)
2035 Info<< nl <<
"Performing no layer truncation." 2036 <<
" nBufferCellsNoExtrude set to less than 0 ..." <<
endl;
2039 forAll(pp.localFaces(), patchFacei)
2041 const face& f = pp.localFaces()[patchFacei];
2045 if (patchNLayers[f[fp]] > 0)
2047 nPatchFaceLayers[patchFacei] = patchNLayers[f[fp]];
2052 nPatchPointLayers = patchNLayers;
2055 forAll(nPatchFaceLayers, patchFacei)
2057 if (nPatchFaceLayers[patchFacei] == -1)
2059 nPatchFaceLayers[patchFacei] = 0;
2068 forAll(pp.localFaces(), patchFacei)
2070 const face& f = pp.localFaces()[patchFacei];
2075 bool noExtrude =
false;
2080 if (extrudeStatus[f[fp]] == NOEXTRUDE)
2084 mLevel =
max(mLevel, patchNLayers[f[fp]]);
2094 nPatchFaceLayers[patchFacei] = 1;
2095 maxLevel[patchFacei] = mLevel;
2099 maxLevel[patchFacei] = mLevel;
2114 for (
label ilevel = 1; ilevel < nLevels; ilevel++)
2120 nBuffer = nBufferCellsNoExtrude - 1;
2124 nBuffer = nBufferCellsNoExtrude;
2127 for (
label ibuffer = 0; ibuffer < nBuffer + 1; ibuffer++)
2129 labelList tempCounter(nPatchFaceLayers);
2131 boolList foundNeighbour(pp.nPoints(),
false);
2133 forAll(pp.meshPoints(), patchPointi)
2135 forAll(pointFaces[patchPointi], pointFacei)
2137 label facei = pointFaces[patchPointi][pointFacei];
2141 nPatchFaceLayers[facei] != -1
2142 && maxLevel[facei] > 0
2145 foundNeighbour[patchPointi] =
true;
2160 forAll(pp.meshPoints(), patchPointi)
2162 if (foundNeighbour[patchPointi])
2164 forAll(pointFaces[patchPointi], pointFacei)
2166 label facei = pointFaces[patchPointi][pointFacei];
2169 nPatchFaceLayers[facei] == -1
2170 && maxLevel[facei] > 0
2171 && ilevel < maxLevel[facei]
2174 tempCounter[facei] = ilevel;
2179 nPatchFaceLayers = tempCounter;
2183 forAll(pp.localFaces(), patchFacei)
2185 if (nPatchFaceLayers[patchFacei] == -1)
2187 nPatchFaceLayers[patchFacei] = maxLevel[patchFacei];
2191 forAll(pp.meshPoints(), patchPointi)
2193 if (extrudeStatus[patchPointi] != NOEXTRUDE)
2195 forAll(pointFaces[patchPointi], pointFacei)
2197 label face = pointFaces[patchPointi][pointFacei];
2198 nPatchPointLayers[patchPointi] =
max 2200 nPatchPointLayers[patchPointi],
2201 nPatchFaceLayers[face]
2207 nPatchPointLayers[patchPointi] = 0;
2223 bool Foam::snappyLayerDriver::cellsUseFace
2225 const polyMesh& mesh,
2232 const cell& cFaces = mesh.cells()[cellLabels[i]];
2236 if (faces.found(cFaces[cFacei]))
2249 Foam::label Foam::snappyLayerDriver::checkAndUnmark
2251 const addPatchCellLayer& addLayer,
2252 const dictionary& meshQualityDict,
2253 const bool additionalReporting,
2254 const List<labelPair>& baffles,
2256 const fvMesh& newMesh,
2260 List<extrudeMode>& extrudeStatus
2264 Info<< nl <<
"Checking mesh with layer ..." <<
endl;
2265 faceSet wrongFaces(newMesh,
"wrongFaces", newMesh.nFaces()/1000);
2277 <<
" (concave, zero area or negative cell pyramid volume)" 2291 addLayer.layerFaces()
2299 const label nReportMax = 10;
2300 DynamicField<point> disabledFaceCentres(nReportMax);
2302 forAll(addedCells, oldPatchFacei)
2306 const labelList& fCells = addedCells[oldPatchFacei];
2308 if (cellsUseFace(newMesh, fCells, wrongFaces))
2315 pp.localFaces()[oldPatchFacei],
2322 if (additionalReporting && (nChanged < nReportMax))
2324 disabledFaceCentres.
append 2326 pp.faceCentres()[oldPatchFacei]
2338 if (additionalReporting)
2347 label nReportLocal = nChanged;
2348 if (nChangedTotal > nReportMax)
2363 Pout<<
"Checked mesh with layers. Disabled extrusion at " <<
endl;
2364 for (
label i=0; i < nReportLocal; i++)
2366 Pout<<
" " << disabledFaceCentres[i] <<
endl;
2372 if (nReportTotal < nChangedTotal)
2374 Info<<
"Suppressed disabled extrusion message for other " 2375 << nChangedTotal - nReportTotal <<
" faces." <<
endl;
2379 return nChangedTotal;
2383 Foam::label Foam::snappyLayerDriver::countExtrusion
2386 const List<extrudeMode>& extrudeStatus
2390 label nExtruded = 0;
2392 const faceList& localFaces = pp.localFaces();
2396 const face& localFace = localFaces[i];
2400 if (extrudeStatus[localFace[fp]] != NOEXTRUDE)
2414 void Foam::snappyLayerDriver::getLayerCellsFaces
2416 const polyMesh& mesh,
2417 const addPatchCellLayer& addLayer,
2424 cellNLayers.setSize(mesh.nCells());
2426 faceRealThickness.setSize(mesh.nFaces());
2427 faceRealThickness = 0;
2435 forAll(addedCells, oldPatchFacei)
2437 const labelList& added = addedCells[oldPatchFacei];
2439 const labelList& layer = layerFaces[oldPatchFacei];
2445 cellNLayers[added[i]] = layer.size()-1;
2450 forAll(layerFaces, oldPatchFacei)
2452 const labelList& layer = layerFaces[oldPatchFacei];
2453 const scalar realThickness = oldRealThickness[oldPatchFacei];
2459 for (
label i = 1; i < layer.size(); i++)
2461 faceRealThickness[layer[i]] = realThickness;
2468 void Foam::snappyLayerDriver::printLayerData
2477 const polyBoundaryMesh& pbm = mesh.boundaryMesh();
2479 int oldPrecision =
Info().precision();
2482 label maxPatchNameLen = 0;
2485 label patchi = patchIDs[i];
2486 word patchName = pbm[
patchi].name();
2487 maxPatchNameLen =
max(maxPatchNameLen,
label(patchName.size()));
2491 <<
setf(ios_base::left) <<
setw(maxPatchNameLen) <<
"patch" 2492 <<
setw(0) <<
" faces layers overall thickness" << nl
2493 <<
setf(ios_base::left) <<
setw(maxPatchNameLen) <<
" " 2494 <<
setw(0) <<
" [m] [%]" << nl
2495 <<
setf(ios_base::left) <<
setw(maxPatchNameLen) <<
"-----" 2496 <<
setw(0) <<
" ----- ------ --- ---" <<
endl;
2501 label patchi = patchIDs[i];
2502 const polyPatch& pp = pbm[
patchi];
2504 label sumSize = pp.size();
2507 const labelList& faceCells = pp.faceCells();
2508 label sumNLayers = 0;
2511 sumNLayers += cellNLayers[faceCells[i]];
2524 scalar sumRealThickness =
sum(patchReal);
2525 scalar sumFraction = 0;
2528 if (patchWanted[i] > vSmall)
2530 sumFraction += (patchReal[i]/patchWanted[i]);
2535 reduce(sumSize, sumOp<label>());
2536 reduce(sumNLayers, sumOp<label>());
2537 reduce(sumRealThickness, sumOp<scalar>());
2538 reduce(sumFraction, sumOp<scalar>());
2541 scalar avgLayers = 0;
2543 scalar avgFraction = 0;
2546 avgLayers = scalar(sumNLayers)/sumSize;
2547 avgReal = sumRealThickness/sumSize;
2548 avgFraction = sumFraction/sumSize;
2553 <<
" " <<
setw(8) << sumSize
2554 <<
" " <<
setw(8) << avgLayers
2555 <<
" " <<
setw(8) << avgReal
2556 <<
" " <<
setw(8) << 100*avgFraction
2563 bool Foam::snappyLayerDriver::writeLayerData
2578 forAll(cellNLayers, celli)
2580 if (cellNLayers[celli] > 0)
2585 cellSet addedCellSet(mesh,
"addedCells", nAdded);
2586 forAll(cellNLayers, celli)
2588 if (cellNLayers[celli] > 0)
2590 addedCellSet.insert(celli);
2593 addedCellSet.instance() = meshRefiner_.timeName();
2596 <<
" added cells to cellSet " 2597 << addedCellSet.name() <<
endl;
2598 bool ok = addedCellSet.
write();
2603 for (
label facei = 0; facei < mesh.nInternalFaces(); facei++)
2605 if (faceRealThickness[facei] > 0)
2611 faceSet layerFacesSet(mesh,
"layerFaces", nAdded);
2612 for (
label facei = 0; facei < mesh.nInternalFaces(); facei++)
2614 if (faceRealThickness[facei] > 0)
2616 layerFacesSet.insert(facei);
2619 layerFacesSet.instance() = meshRefiner_.timeName();
2622 <<
" faces inside added layer to faceSet " 2623 << layerFacesSet.name() <<
endl;
2624 bool ok = layerFacesSet.
write();
2631 Info<< nl <<
"Writing fields with layer information:" <<
incrIndent 2639 mesh.time().timeName(),
2647 fixedValueFvPatchScalarField::typeName
2649 const polyBoundaryMesh& pbm = mesh.boundaryMesh();
2652 fld.boundaryFieldRef();
2656 label patchi = patchIDs[i];
2657 const polyPatch& pp = pbm[
patchi];
2658 const labelList& faceCells = pp.faceCells();
2662 pfld[i] = cellNLayers[faceCells[i]];
2668 bool ok =
fld.write();
2677 mesh.time().timeName(),
2685 fixedValueFvPatchScalarField::typeName
2688 const polyBoundaryMesh& pbm = mesh.boundaryMesh();
2691 fld.boundaryFieldRef();
2695 label patchi = patchIDs[i];
2703 bool ok =
fld.write();
2711 "thicknessFraction",
2712 mesh.time().timeName(),
2720 fixedValueFvPatchScalarField::typeName
2723 const polyBoundaryMesh& pbm = mesh.boundaryMesh();
2726 fld.boundaryFieldRef();
2730 label patchi = patchIDs[i];
2745 if (patchWanted[i] > vSmall)
2747 pfld[i] = patchReal[i]/patchWanted[i];
2754 <<
" : overall layer thickness (fraction" 2755 <<
" of desired thickness)" <<
endl;
2756 bool ok =
fld.write();
2769 faceWantedThickness,
2787 meshRefiner_(meshRefiner),
2788 globalToMasterPatch_(globalToMasterPatch),
2789 globalToSlavePatch_(globalToSlavePatch)
2809 <<
"Merging all faces of a cell" << nl
2810 <<
"---------------------------" << nl
2811 <<
" - which are on the same patch" << nl
2812 <<
" - which make an angle < " << planarAngle
2815 <<
" (cos:" << minCos <<
')' << nl
2816 <<
" - as long as the resulting face doesn't become concave" 2819 <<
" (0=straight, 180=fully concave)" << nl
2822 const fvMesh& mesh = meshRefiner_.mesh();
2830 duplicateFace[cpl[0]] = cpl[1];
2831 duplicateFace[cpl[1]] = cpl[0];
2840 patchIDs.unset(patchi);
2844 patchIDs.set(patchi);
2848 label nChanged = meshRefiner_.mergePatchFacesUndo
2857 nChanged += meshRefiner_.mergeEdgesUndo(minCos, motionDict);
2866 const label nAllowableErrors,
2871 fvMesh& mesh = meshRefiner_.mesh();
2876 meshRefiner_.createZoneBaffles
2878 globalToMasterPatch_,
2879 globalToSlavePatch_,
2883 if (debug&meshRefinement::MESH)
2886 Info<<
"Writing baffled mesh to time " 2887 << meshRefiner_.timeName() <<
endl;
2896 mesh.
time().
path()/meshRefiner_.timeName()
2931 determineSidePatches
2952 label nIdealTotAddedCells = 0;
3012 const scalar edge0Len =
3013 meshRefiner_.meshCutter().level0EdgeLength();
3014 const labelList& cellLevel = meshRefiner_.meshCutter().cellLevel();
3043 for (
label i = 0; i < layerParams.
nGrow(); i++)
3057 const scalar edge0Len = meshRefiner_.meshCutter().level0EdgeLength();
3058 const labelList& cellLevel = meshRefiner_.meshCutter().cellLevel();
3068 meshRefiner_.timeName(),
3075 calculateLayerThickness
3102 avgPointData(pp, thickness);
3110 makeLayerDisplacementField
3123 combinedDict.
merge(motionDict);
3125 combinedDict.add(
"minThicknessName", minThickness.name());
3144 label iteration = 0;
3150 <<
"Layer addition iteration " << iteration << nl
3151 <<
"--------------------------" <<
endl;
3159 : motionDict.
subDict(
"relaxed")
3164 Info<<
"Switched to relaxed meshQuality constraints." <<
endl;
3170 syncPatchDisplacement
3180 getPatchDisplacement
3213 combinedDict.
merge(motionDict);
3215 combinedDict.merge(meshQualityDict);
3217 combinedDict.add(
"minThicknessName", minThickness.name());
3220 medialAxisMoverPtr().move
3230 patchDisp = oldPatchPos - pp().localPoints();
3236 faceSet dummySet(mesh,
"wrongPatchFaces", 0);
3237 truncateDisplacement
3255 mesh.
time().
path()/
"layer_" + meshRefiner_.timeName(),
3262 Info<<
"Writing shrunk mesh to time " 3263 << meshRefiner_.timeName() <<
endl;
3276 mesh.
time().
path()/meshRefiner_.timeName()
3292 labelList nPatchFaceLayers(pp().size(), -1);
3293 setupLayerInfoTruncation
3307 forAll(nPatchPointLayers, i)
3311 nPatchPointLayers[i],
3314 finalDisp[i] = ratio*patchDisp[i];
3318 const scalarField invExpansionRatio(1.0/expansionRatio);
3343 savedMeshMod = meshMod;
3365 fvMesh& newMesh = newMeshPtr();
3387 newMeshBaffles[i][0] = map().reverseFaceMap()[p[0]];
3388 newMeshBaffles[i][1] = map().reverseFaceMap()[p[1]];
3396 avgPointData(pp,
mag(patchDisp))(),
3404 label nAddedCells = 0;
3405 forAll(cellNLayers, celli)
3407 if (cellNLayers[celli] > 0)
3414 if (debug&meshRefinement::MESH)
3416 Info<<
"Writing layer mesh to time " << meshRefiner_.timeName()
3420 cellSet addedCellSet(newMesh,
"addedCells", nAddedCells);
3421 forAll(cellNLayers, celli)
3423 if (cellNLayers[celli] > 0)
3425 addedCellSet.
insert(celli);
3428 addedCellSet.
instance() = meshRefiner_.timeName();
3431 <<
" added cells to cellSet " << addedCellSet.
name()
3433 addedCellSet.
write();
3443 if (faceRealThickness[facei] > 0)
3445 layerFacesSet.
insert(facei);
3448 layerFacesSet.instance() = meshRefiner_.timeName();
3451 <<
" faces inside added layer to faceSet " 3452 << layerFacesSet.name() <<
endl;
3453 layerFacesSet.
write();
3457 label nTotChanged = checkAndUnmark
3471 label nTotExtruded = countExtrusion(pp, extrudeStatus);
3475 Info<<
"Extruding " << nTotExtruded
3476 <<
" out of " << nTotFaces
3477 <<
" faces (" << 100.0*nTotExtruded/nTotFaces <<
"%)." 3478 <<
" Removed extrusion at " << nTotChanged <<
" faces." 3480 <<
"Added " << nTotAddedCells <<
" out of " 3481 << nIdealTotAddedCells <<
" cells (" 3482 << 100.0*nTotAddedCells/nIdealTotAddedCells <<
"%)." 3485 if (nTotChanged == 0)
3495 for (
label i = 0; i < layerParams.
nGrow(); i++)
3524 if (map().hasMotionPoints())
3537 meshRefiner_.topoChange(map,
labelList(0));
3546 p[0] = map().reverseFaceMap()[p[0]];
3547 p[1] = map().reverseFaceMap()[p[1]];
3555 Info<<
"Converting " << nBaffles
3556 <<
" baffles back into zoned faces ..." 3565 Info<<
"Converted baffles in = " 3566 << meshRefiner_.mesh().time().cpuTimeIncrement()
3567 <<
" s\n" << nl <<
endl;
3577 <<
"Doing final balancing" << nl
3578 <<
"---------------------" << nl
3600 map().distributeCellData(cellNLayers);
3601 map().distributeFaceData(faceWantedThickness);
3602 map().distributeFaceData(faceRealThickness);
3614 faceWantedThickness,
3625 const bool preBalance,
3630 const fvMesh& mesh = meshRefiner_.mesh();
3633 <<
"Shrinking and layer addition phase" << nl
3634 <<
"----------------------------------" << nl
3637 Info<<
"Using mesh parameters " << motionDict << nl <<
endl;
3640 mergePatchFacesUndo(layerParams, motionDict);
3647 label nFacesWithLayers = 0;
3648 forAll(numLayers, patchi)
3650 if (numLayers[patchi] > 0)
3662 <<
"Ignoring layers on coupled patch " << pp.
name()
3671 Info<< nl <<
"No layers to generate ..." <<
endl;
3676 checkMeshManifold();
3679 Info<<
"Checking initial mesh ..." <<
endl;
3688 Info<<
"Detected " << nInitErrors <<
" illegal faces" 3689 <<
" (concave, zero area or negative cell pyramid volume)" 3697 <<
"Doing initial balancing" << nl
3698 <<
"-----------------------" << nl
3702 forAll(numLayers, patchi)
3704 if (numLayers[patchi] > 0)
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 polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
List< labelList > labelListList
A List of labelList.
void clearOut()
Clear all geometry and addressing.
void inplaceReorder(const labelUList &oldToNew, ListType &)
Inplace reorder the elements of a list.
#define forAll(list, i)
Loop across all elements in list.
Simple container to keep together layer specific information.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
virtual Ostream & write(const char)=0
Write character.
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const word & name() const
Return name.
const word & name() const
Return name.
Ostream & indent(Ostream &os)
Indent stream.
static const Vector< scalar > max
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
scalar concaveAngle() const
label nInternalFaces() const
const labelListList & pointEdges() const
Unit conversion functions.
static autoPtr< externalDisplacementMeshMover > New(const word &type, const dictionary &dict, const List< labelPair > &baffles, pointVectorField &pointDisplacement)
Return a reference to the selected meshMover model.
void size(const label)
Override size to be inconsistent with allocated storage.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
static tmp< GeometricField< vector, pointPatchField, pointMesh > > New(const word &name, const Internal &, const PtrList< pointPatchField< vector >> &)
Return a temporary field constructed from name,.
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const List< mergeFace > & mergeFaces() const
Whether to merge boundary faces of the same layer cell.
static writeType writeLevel()
Get/set write level.
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
label nBufferCellsNoExtrude() const
Create buffer region for new layer terminations.
HashTable< label, label, Hash< label > >::const_iterator const_iterator
void addLayers(const layerParameters &layerParams, const dictionary &motionDict, const labelList &patchIDs, const label nAllowableErrors, decompositionMethod &decomposer, fvMeshDistribute &distributor)
Add cell layers.
GeometricBoundaryField< scalar, fvPatchField, volMesh > Boundary
Type of the boundary field.
Vector< scalar > vector
A scalar version of the templated Vector.
const dimensionSet dimless
const dictionary & dict() const
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 Time & time() const
Return the top-level database.
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
Foam::indirectPrimitivePatch.
virtual bool write(const bool write=true) const
Write mesh using IO settings from time.
bool insert(const Key &key)
Insert a new entry.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
const labelList & numLayers() const
How many layers to add:
label size() const
Return number of elements in table.
virtual void topoChange(const polyTopoChangeMap &map)
Update mesh corresponding to the given map.
static const word & calculatedType()
Return the type of the calculated for of fvPatchField.
scalar degToRad(const scalar deg)
Conversion from degrees to radians.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
const dimensionSet dimLength
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
static labelPairList findDuplicateFacePairs(const polyMesh &)
Helper routine to find all baffles (two boundary faces.
virtual const pointField & points() const
Return raw points.
label nRelaxedIter() const
Number of iterations after which relaxed motion rules.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
List< bool > boolList
Bool container classes.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
static void updateList(const labelList &newToOld, const T &nullValue, List< T > &elems)
Helper: reorder list according to map.
scalar maxFaceThicknessRatio() const
Stop layer growth on highly warped cells.
Omanip< int > setprecision(const int i)
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
snappyLayerDriver(meshRefinement &meshRefiner, const labelList &globalToMasterPatch, const labelList &globalToSlavePatch)
Construct from components.
Sends/receives parts of mesh+fvfields to neighbouring processors. Used in load balancing.
vectorField pointField
pointField is a vectorField.
scalar finalLayerThicknessRatio(const label nLayers, const scalar expansionRatio) const
Determine ratio of final layer thickness to.
An ordered pair of two objects of type <T> with first() and second() elements.
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< ' ';}gmvFile<< nl;forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
dimensionedScalar cos(const dimensionedScalar &ds)
void topoChange(const polyTopoChangeMap &, const labelList &faceMap, const labelList &pointMap)
Update any locally stored mesh information. Gets additional.
line< point, const point & > linePointRef
Line using referred points.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
const labelUList & faceCells() const
Return face-cell addressing.
Adds layers of cells to outside of polyPatch. Can optionally create stand-alone extruded mesh (addToM...
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.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
void append(const T &)
Append an element at the end of the list.
static void setDisplacement(const labelList &patchIDs, const indirectPrimitivePatch &pp, pointField &patchDisp, pointVectorField &displacement)
Set displacement field from displacement on patch points.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
Smanip< ios_base::fmtflags > setf(const ios_base::fmtflags flags)
static const label labelMax
List< label > labelList
A List of labels.
Abstract base class for decomposition.
errorManip< error > abort(error &err)
scalar featureAngle() const
label nLayerIter() const
Number of overall layer addition iterations.
Istream and Ostream manipulators taking arguments.
Type gMax(const FieldField< Field, Type > &f)
defineTypeNameAndDebug(combustionModel, 0)
static pointMesh & New(polyMesh &mesh)
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
static autoPtr< indirectPrimitivePatch > makePatch(const polyMesh &, const labelList &)
Create patch from set of patches.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
void setInstance(const fileName &)
Set the instance for mesh files.
Helper class which maintains intersections of (changing) mesh with (static) surfaces.
virtual tmp< scalarField > movePoints(const pointField &)
Move points, returns volumes swept by faces in motion.
label size() const
Return the number of elements in the UPtrList.
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
List< word > wordList
A List of words.
void setSize(const label)
Reset size of List.
static bool & parRun()
Is this a parallel run?
static label nProcs(const label communicator=0)
Number of processes in parallel run.
static const Vector< scalar > rootMax
bool relativeSizes() const
Are size parameters relative to inner cell size or.
label nGrow() const
If points get not extruded do nGrow layers of connected faces.
vector point
Point is a vector.
const word & meshShrinker() const
Type of mesh shrinker.
#define WarningInFunction
Report a warning using Foam::Warning.
const word & name() const
Return reference to name.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
A collection of cell labels.
prefixOSstream Pout(cout, "Pout")
Mesh data needed to do the Finite Volume discretisation.
Direct mesh changes based on v1.3 polyTopoChange syntax.
const Switch & additionalReporting() const
void mergePatchFacesUndo(const layerParameters &layerParams, const dictionary &motionDict)
Merge patch faces on same cell.
static const Vector< scalar > one
SubField< scalar > subField
Declare type of subField.
bool merge(const dictionary &)
Merge entries from the given dictionary.
dimensioned< scalar > mag(const dimensioned< Type > &)
static labelListList globalEdgeFaces(const polyMesh &, const globalIndex &globalFaces, const indirectPrimitivePatch &pp)
Per patch edge the pp faces (in global indices) using it. Uses.
labelListList addedCells() const
Added cells given current mesh & layerfaces.
Field< vector > vectorField
Specialisation of Field<T> for vector.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
fileName & instance() const
Return the instance directory, constant, system, <time> etc.
Mesh consisting of general polyhedral cells.
Omanip< int > setw(const int i)
virtual bool write(const bool write=true) const
Write using setting from DB.
A class for managing temporary objects.
A patch is a list of labels that address the faces in the global face list.
fileName path() const
Return path.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
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.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
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.
A primitive field of type <T> with automated input and output.
static const label labelMin