127 label nMasterChanged = 0;
142 const label nInternalFaces =
mesh.nInternalFaces();
147 forAll(oldCellsToRefine, i)
149 oldRefineCell.
set(oldCellsToRefine[i], 1u);
157 for (
label faceI = 0; faceI < nInternalFaces; faceI++)
165 && oldRefineCell.
get(oldOwn) == 0u
167 && oldRefineCell.
get(oldNei) == 0u
174 refinedInternalFace.
set(faceI, 1u);
181 boolList refinedBoundaryFace(
mesh.nFaces()-nInternalFaces,
false);
193 if (oldOwn >= 0 && oldRefineCell.
get(oldOwn) == 0u)
199 refinedBoundaryFace[faceI-nInternalFaces] =
true;
206 syncTools::syncBoundaryFaceList
219 forAll(refinedInternalFace, faceI)
221 if (refinedInternalFace.
get(faceI) == 1u)
223 const cell& ownFaces =
cells[faceOwner[faceI]];
226 changedFace[ownFaces[ownI]] =
true;
228 const cell& neiFaces =
cells[faceNeighbour[faceI]];
231 changedFace[neiFaces[neiI]] =
true;
236 forAll(refinedBoundaryFace, i)
238 if (refinedBoundaryFace[i])
240 const cell& ownFaces =
cells[faceOwner[i+nInternalFaces]];
243 changedFace[ownFaces[ownI]] =
true;
248 syncTools::syncFaceList
264 forAll(changedFace, faceI)
266 if (changedFace[faceI] && isMasterFace[faceI])
276 Pout<<
"getChangedFaces : Detected "
277 <<
" local:" << changedFaces.
size()
279 <<
" changed faces out of " <<
mesh.globalData().nTotalFaces()
282 faceSet changedFacesSet(
mesh,
"changedFaces", changedFaces);
283 Pout<<
"getChangedFaces : Writing " << changedFaces.
size()
284 <<
" changed faces to faceSet " << changedFacesSet.
name()
286 changedFacesSet.
write();
298 const label markValue,
299 const label nAllowRefine,
307 cellValue = markValue;
311 return nRefine <= nAllowRefine;
351 const point& keepPoint = keepPoints[i];
360 (void)mesh_.cellTree();
363 mesh_.findCellFacePt(keepPoint, cellI, tetFaceI, tetPtI);
372 const edgeMesh& featureMesh = features_[featI];
373 const label featureLevel = features_.levels()[featI][0];
387 forAll(pointEdges, pointI)
389 if (pointEdges[pointI].size() != 2)
391 if (debug&meshRefinement::FEATURESEEDS)
393 Pout<<
"Adding particle from point:" << pointI
394 <<
" coord:" << featureMesh.
points()[pointI]
395 <<
" since number of emanating edges:"
396 << pointEdges[pointI].
size()
410 featureMesh.
points()[pointI],
419 if (pointEdges[pointI].size() > 0)
421 label e0 = pointEdges[pointI][0];
422 label regionI = edgeRegion[e0];
423 regionVisited[regionI] = 1u;
433 if (regionVisited.
set(edgeRegion[edgeI], 1u))
437 if (debug&meshRefinement::FEATURESEEDS)
439 Pout<<
"Adding particle from point:" << pointI
440 <<
" coord:" << featureMesh.
points()[pointI]
441 <<
" on circular region:" << edgeRegion[edgeI]
455 featureMesh.
points()[pointI],
470 maxFeatureLevel =
labelList(mesh_.nCells(), -1);
477 featureEdgeVisited[featI].
setSize(features_[featI].edges().size());
478 featureEdgeVisited[featI] = 0u;
493 scalar maxTrackLen = 2.0*mesh_.bounds().mag();
495 if (debug&meshRefinement::FEATURESEEDS)
497 Pout<<
"Tracking " << startPointCloud.
size()
498 <<
" particles over distance " << maxTrackLen
499 <<
" to find the starting cell" <<
endl;
501 startPointCloud.
move(td, maxTrackLen);
505 maxFeatureLevel = -1;
508 featureEdgeVisited[featI] = 0u;
519 if (debug&meshRefinement::FEATURESEEDS)
521 Pout<<
"Constructing cloud for cell marking" <<
endl;
528 label featI = startTp.
i();
529 label pointI = startTp.
j();
531 const edgeMesh& featureMesh = features_[featI];
537 label edgeI = pEdges[pEdgeI];
539 if (featureEdgeVisited[featI].set(edgeI, 1u))
545 label otherPointI =
e.otherVertex(pointI);
548 tp->end() = featureMesh.
points()[otherPointI];
549 tp->j() = otherPointI;
552 if (debug&meshRefinement::FEATURESEEDS)
554 Pout<<
"Adding particle for point:" << pointI
555 <<
" coord:" <<
tp->position()
556 <<
" feature:" << featI
557 <<
" to track to:" <<
tp->end()
566 startPointCloud.
clear();
572 if (debug&meshRefinement::FEATURESEEDS)
575 <<
" particles over distance " << maxTrackLen
576 <<
" to mark cells" <<
endl;
578 cloud.move(td, maxTrackLen);
588 const edgeMesh& featureMesh = features_[featI];
594 bool keepParticle =
false;
598 label edgeI = pEdges[i];
600 if (featureEdgeVisited[featI].set(edgeI, 1u))
606 label otherPointI =
e.otherVertex(pointI);
608 tp.end() = featureMesh.
points()[otherPointI];
609 tp.j() = otherPointI;
625 if (debug&meshRefinement::FEATURESEEDS)
658 const label nAllowRefine,
666 markFeatureCellLevel(keepPoints, maxFeatureLevel);
671 const labelList& cellLevel = meshCutter_.cellLevel();
673 label oldNRefine = nRefine;
675 forAll(maxFeatureLevel, cellI)
677 if (maxFeatureLevel[cellI] > cellLevel[cellI])
703 Info<<
"Reached refinement limit." <<
endl;
713 const label nAllowRefine,
719 const labelList& cellLevel = meshCutter_.cellLevel();
720 const pointField& cellCentres = mesh_.cellCentres();
723 if (features_.maxDistance() <= 0.0)
728 label oldNRefine = nRefine;
739 testCc[testI] = cellCentres[cellI];
740 testLevels[testI] = cellLevel[cellI];
747 features_.findHigherLevel(testCc, testLevels, maxLevel);
756 if (maxLevel[testI] > testLevels[testI])
758 bool reachedLimit = !markForRefine
770 Pout<<
"Stopped refining internal cells"
771 <<
" since reaching my cell limit of "
772 << mesh_.nCells()+7*nRefine <<
endl;
787 Info<<
"Reached refinement limit." <<
endl;
797 const label nAllowRefine,
803 const labelList& cellLevel = meshCutter_.cellLevel();
804 const pointField& cellCentres = mesh_.cellCentres();
806 label oldNRefine = nRefine;
817 testCc[testI] = cellCentres[cellI];
818 testLevels[testI] = cellLevel[cellI];
825 shells_.findHigherLevel(testCc, testLevels, maxLevel);
834 if (maxLevel[testI] > testLevels[testI])
836 bool reachedLimit = !markForRefine
848 Pout<<
"Stopped refining internal cells"
849 <<
" since reaching my cell limit of "
850 << mesh_.nCells()+7*nRefine <<
endl;
865 Info<<
"Reached refinement limit." <<
endl;
878 const labelList& cellLevel = meshCutter_.cellLevel();
879 const pointField& cellCentres = mesh_.cellCentres();
881 label oldNRefine = nRefine;
892 testCc[testI] = cellCentres[cellI];
893 testLevels[testI] = cellLevel[cellI];
900 limitShells_.findLevel(testCc, testLevels, levelShell);
909 if (levelShell[testI] != -1)
933 forAll(surfaceIndex_, faceI)
935 if (surfaceIndex_[faceI] != -1)
937 label own = mesh_.faceOwner()[faceI];
939 if (mesh_.isInternalFace(faceI))
941 label nei = mesh_.faceNeighbour()[faceI];
945 testFaces[nTest++] = faceI;
952 testFaces[nTest++] = faceI;
966 const label nAllowRefine,
974 const labelList& cellLevel = meshCutter_.cellLevel();
976 label oldNRefine = nRefine;
1009 surfaces_.findHigherIntersection
1026 label faceI = testFaces[i];
1028 label surfI = surfaceHit[i];
1038 label own = mesh_.faceOwner()[faceI];
1040 if (surfaceMinLevel[i] > cellLevel[own])
1058 if (mesh_.isInternalFace(faceI))
1060 label nei = mesh_.faceNeighbour()[faceI];
1061 if (surfaceMinLevel[i] > cellLevel[nei])
1088 Info<<
"Reached refinement limit." <<
endl;
1107 const vector& n1 = normals1[i];
1111 const vector& n2 = normals2[j];
1128 const scalar curvature,
1129 const label nAllowRefine,
1137 const labelList& cellLevel = meshCutter_.cellLevel();
1138 const pointField& cellCentres = mesh_.cellCentres();
1140 label oldNRefine = nRefine;
1149 const PackedBoolList isMasterFace(syncTools::getMasterFaces(mesh_));
1164 label faceI = testFaces[i];
1166 label own = mesh_.faceOwner()[faceI];
1168 if (mesh_.isInternalFace(faceI))
1170 label nei = mesh_.faceNeighbour()[faceI];
1172 start[i] = cellCentres[own];
1173 end[i] = cellCentres[nei];
1174 minLevel[i] =
min(cellLevel[own], cellLevel[nei]);
1178 label bFaceI = faceI - mesh_.nInternalFaces();
1180 start[i] = cellCentres[own];
1181 end[i] = neiCc[bFaceI];
1183 if (!isMasterFace[faceI])
1185 Swap(start[i], end[i]);
1188 minLevel[i] =
min(cellLevel[own], neiLevel[bFaceI]);
1194 const vectorField smallVec(ROOTSMALL*(end-start));
1211 surfaces_.findAllHigherIntersections
1218 surfaces_.maxLevel(),
1229 forAll(surfaceNormal, pointI)
1231 vectorList& pNormals = surfaceNormal[pointI];
1232 labelList& pLevel = surfaceLevel[pointI];
1248 label faceI = testFaces[i];
1249 label own = mesh_.faceOwner()[faceI];
1251 const vectorList& fNormals = surfaceNormal[i];
1252 const labelList& fLevels = surfaceLevel[i];
1256 if (fLevels[hitI] > cellLevel[own])
1258 cellSurfLevels[own].
append(fLevels[hitI]);
1259 cellSurfNormals[own].
append(fNormals[hitI]);
1262 if (mesh_.isInternalFace(faceI))
1264 label nei = mesh_.faceNeighbour()[faceI];
1265 if (fLevels[hitI] > cellLevel[nei])
1267 cellSurfLevels[nei].
append(fLevels[hitI]);
1268 cellSurfNormals[nei].
append(fNormals[hitI]);
1282 forAll(cellSurfNormals, cellI)
1284 const vectorList& normals = cellSurfNormals[cellI];
1288 nNormals += normals.
size();
1293 Info<<
"markSurfaceCurvatureRefinement :"
1294 <<
" cells:" << mesh_.globalData().nTotalCells()
1295 <<
" of which with normals:" << nSet
1296 <<
" ; total normals stored:" << nNormals
1302 bool reachedLimit =
false;
1311 !reachedLimit && cellI < cellSurfNormals.
size();
1315 const vectorList& normals = cellSurfNormals[cellI];
1316 const labelList& levels = cellSurfLevels[cellI];
1319 for (
label i = 0; !reachedLimit && i < normals.
size(); i++)
1321 for (
label j = i+1; !reachedLimit && j < normals.
size(); j++)
1323 if ((normals[i] & normals[j]) < curvature)
1325 label maxLevel =
max(levels[i], levels[j]);
1327 if (cellLevel[cellI] < maxLevel)
1342 Pout<<
"Stopped refining since reaching my cell"
1343 <<
" limit of " << mesh_.nCells()+7*nRefine
1346 reachedLimit =
true;
1366 !reachedLimit && faceI < mesh_.nInternalFaces();
1370 label own = mesh_.faceOwner()[faceI];
1371 label nei = mesh_.faceNeighbour()[faceI];
1373 const vectorList& ownNormals = cellSurfNormals[own];
1374 const labelList& ownLevels = cellSurfLevels[own];
1375 const vectorList& neiNormals = cellSurfNormals[nei];
1376 const labelList& neiLevels = cellSurfLevels[nei];
1384 countMatches(ownNormals, neiNormals)
1385 == ownNormals.
size();
1388 countMatches(neiNormals, ownNormals)
1389 == neiNormals.
size();
1392 if (!ownIsSubset && !neiIsSubset)
1395 for (
label i = 0; !reachedLimit && i < ownNormals.
size(); i++)
1397 for (
label j = 0; !reachedLimit && j < neiNormals.
size(); j++)
1400 if ((ownNormals[i] & neiNormals[j]) < curvature)
1403 if (cellLevel[own] < ownLevels[i])
1418 Pout<<
"Stopped refining since reaching"
1419 <<
" my cell limit of "
1420 << mesh_.nCells()+7*nRefine <<
endl;
1422 reachedLimit =
true;
1426 if (cellLevel[nei] < neiLevels[j])
1441 Pout<<
"Stopped refining since reaching"
1442 <<
" my cell limit of "
1443 << mesh_.nCells()+7*nRefine <<
endl;
1445 reachedLimit =
true;
1458 syncTools::swapBoundaryCellList(mesh_, cellSurfNormals, neiSurfaceNormals);
1463 label faceI = mesh_.nInternalFaces();
1464 !reachedLimit && faceI < mesh_.nFaces();
1468 label own = mesh_.faceOwner()[faceI];
1469 label bFaceI = faceI - mesh_.nInternalFaces();
1471 const vectorList& ownNormals = cellSurfNormals[own];
1472 const labelList& ownLevels = cellSurfLevels[own];
1473 const vectorList& neiNormals = neiSurfaceNormals[bFaceI];
1480 countMatches(ownNormals, neiNormals)
1481 == ownNormals.
size();
1484 countMatches(neiNormals, ownNormals)
1485 == neiNormals.
size();
1488 if (!ownIsSubset && !neiIsSubset)
1491 for (
label i = 0; !reachedLimit && i < ownNormals.
size(); i++)
1493 for (
label j = 0; !reachedLimit && j < neiNormals.
size(); j++)
1496 if ((ownNormals[i] & neiNormals[j]) < curvature)
1498 if (cellLevel[own] < ownLevels[i])
1513 Pout<<
"Stopped refining since reaching"
1514 <<
" my cell limit of "
1515 << mesh_.nCells()+7*nRefine
1518 reachedLimit =
true;
1535 Info<<
"Reached refinement limit." <<
endl;
1544 const scalar planarCos,
1554 vector d = point1-point0;
1555 scalar magD =
mag(d);
1557 if (magD > mergeDistance())
1559 scalar cosAngle = (normal0 & normal1);
1561 vector avg = vector::zero;
1562 if (cosAngle < (-1+planarCos))
1565 avg = 0.5*(normal0-normal1);
1567 else if (cosAngle > (1-planarCos))
1569 avg = 0.5*(normal0+normal1);
1572 if (avg != vector::zero)
1577 if (
mag(avg&d) > mergeDistance())
1601 const scalar planarCos,
1611 vector d = point1-point0;
1612 scalar magD =
mag(d);
1614 if (magD > mergeDistance())
1616 scalar cosAngle = (normal0 & normal1);
1618 vector avg = vector::zero;
1619 if (cosAngle < (-1+planarCos))
1622 avg = 0.5*(normal0-normal1);
1624 else if (cosAngle > (1-planarCos))
1626 avg = 0.5*(normal0+normal1);
1629 if (avg != vector::zero)
1658 const scalar planarCos,
1659 const label nAllowRefine,
1661 const label surfaceLevel,
1663 const vector& surfaceNormal,
1667 label& cellMaxLevel,
1675 const labelList& cellLevel = meshCutter_.cellLevel();
1678 if (surfaceLevel > cellLevel[cellI])
1680 if (cellMaxLevel == -1)
1683 cellMaxLevel = surfaceLevel;
1685 cellMaxNormal = surfaceNormal;
1694 bool closeSurfaces = isNormalGap
1705 if (surfaceLevel > cellMaxLevel)
1707 cellMaxLevel = surfaceLevel;
1709 cellMaxNormal = surfaceNormal;
1723 return markForRefine
1741 const scalar planarCos,
1742 const label nAllowRefine,
1750 const labelList& cellLevel = meshCutter_.cellLevel();
1752 label oldNRefine = nRefine;
1784 labelList cellMaxLevel(mesh_.nCells(), -1);
1785 vectorField cellMaxNormal(mesh_.nCells(), vector::zero);
1786 pointField cellMaxLocation(mesh_.nCells(), vector::zero);
1795 surfaces_.findAllHigherIntersections
1802 surfaces_.gapLevel(),
1832 label faceI = testFaces[i];
1833 label own = mesh_.faceOwner()[faceI];
1835 const labelList& fLevels = surfaceLevel[i];
1837 const vectorList& fNormals = surfaceNormal[i];
1852 cellMaxLocation[own],
1860 if (mesh_.isInternalFace(faceI))
1862 label nei = mesh_.faceNeighbour()[faceI];
1877 cellMaxLocation[nei],
1891 labelList neiBndMaxLevel(mesh_.nFaces()-mesh_.nInternalFaces());
1892 pointField neiBndMaxLocation(mesh_.nFaces()-mesh_.nInternalFaces());
1893 vectorField neiBndMaxNormal(mesh_.nFaces()-mesh_.nInternalFaces());
1895 for (
label faceI = mesh_.nInternalFaces(); faceI < mesh_.nFaces(); faceI++)
1897 label bFaceI = faceI-mesh_.nInternalFaces();
1898 label own = mesh_.faceOwner()[faceI];
1900 neiBndMaxLevel[bFaceI] = cellMaxLevel[own];
1901 neiBndMaxLocation[bFaceI] = cellMaxLocation[own];
1902 neiBndMaxNormal[bFaceI] = cellMaxNormal[own];
1904 syncTools::swapBoundaryFaceList(mesh_, neiBndMaxLevel);
1905 syncTools::swapBoundaryFaceList(mesh_, neiBndMaxLocation);
1906 syncTools::swapBoundaryFaceList(mesh_, neiBndMaxNormal);
1911 for (
label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
1913 label own = mesh_.faceOwner()[faceI];
1914 label nei = mesh_.faceNeighbour()[faceI];
1916 if (cellMaxLevel[own] != -1 && cellMaxLevel[nei] != -1)
1924 cellMaxLocation[own],
1926 cellMaxLocation[nei],
1932 if (cellLevel[own] < cellMaxLevel[own])
1947 Pout<<
"Stopped refining since reaching my cell"
1948 <<
" limit of " << mesh_.nCells()+7*nRefine
1955 if (cellLevel[nei] < cellMaxLevel[nei])
1970 Pout<<
"Stopped refining since reaching my cell"
1971 <<
" limit of " << mesh_.nCells()+7*nRefine
1981 for (
label faceI = mesh_.nInternalFaces(); faceI < mesh_.nFaces(); faceI++)
1983 label own = mesh_.faceOwner()[faceI];
1984 label bFaceI = faceI - mesh_.nInternalFaces();
1986 if (cellLevel[own] < cellMaxLevel[own] && neiBndMaxLevel[bFaceI] != -1)
1994 cellMaxLocation[own],
1996 neiBndMaxLocation[bFaceI],
1997 neiBndMaxNormal[bFaceI]
2014 Pout<<
"Stopped refining since reaching my cell"
2015 <<
" limit of " << mesh_.nCells()+7*nRefine
2030 Info<<
"Reached refinement limit." <<
endl;
2047 const scalar curvature,
2048 const scalar planarAngle,
2050 const bool featureRefinement,
2051 const bool featureDistanceRefinement,
2052 const bool internalRefinement,
2053 const bool surfaceRefinement,
2054 const bool curvatureRefinement,
2055 const bool smallFeatureRefinement,
2056 const bool gapRefinement,
2057 const bool bigGapRefinement,
2058 const bool spreadGapSize,
2059 const label maxGlobalCells,
2060 const label maxLocalCells
2063 label totNCells = mesh_.globalData().nTotalCells();
2067 if (totNCells >= maxGlobalCells)
2069 Info<<
"No cells marked for refinement since reached limit "
2070 << maxGlobalCells <<
'.' <<
endl;
2104 labelList neiLevel(mesh_.nFaces()-mesh_.nInternalFaces());
2105 pointField neiCc(mesh_.nFaces()-mesh_.nInternalFaces());
2106 calcNeighbourData(neiLevel, neiCc);
2115 if (featureRefinement)
2117 label nFeatures = markFeatureRefinement
2126 Info<<
"Marked for refinement due to explicit features "
2127 <<
": " << nFeatures <<
" cells." <<
endl;
2133 if (featureDistanceRefinement)
2135 label nShell = markInternalDistanceToFeatureRefinement
2142 Info<<
"Marked for refinement due to distance to explicit features "
2143 ": " << nShell <<
" cells." <<
endl;
2149 if (internalRefinement)
2151 label nShell = markInternalRefinement
2158 Info<<
"Marked for refinement due to refinement shells "
2159 <<
": " << nShell <<
" cells." <<
endl;
2165 if (surfaceRefinement)
2167 label nSurf = markSurfaceRefinement
2176 Info<<
"Marked for refinement due to surface intersection "
2177 <<
": " << nSurf <<
" cells." <<
endl;
2185 &&
max(shells_.maxGapLevel()) > 0
2188 label nGapSurf = markSurfaceGapRefinement
2198 Info<<
"Marked for refinement due to surface intersection"
2200 <<
": " << nGapSurf <<
" cells." <<
endl;
2210 && (curvature >= -1 && curvature <= 1)
2211 && (surfaces_.minLevel() != surfaces_.maxLevel())
2214 label nCurv = markSurfaceCurvatureRefinement
2224 Info<<
"Marked for refinement due to curvature/regions "
2225 <<
": " << nCurv <<
" cells." <<
endl;
2234 smallFeatureRefinement
2235 && (planarCos >= -1 && planarCos <= 1)
2236 &&
max(shells_.maxGapLevel()) > 0
2239 label nGap = markSmallFeatureRefinement
2249 Info<<
"Marked for refinement due to close opposite surfaces "
2250 <<
": " << nGap <<
" cells." <<
endl;
2260 && (planarCos >= -1 && planarCos <= 1)
2261 && (
max(surfaces_.gapLevel()) > -1)
2264 Info<<
"Specified gap level : " <<
max(surfaces_.gapLevel())
2265 <<
", planar angle " << planarAngle <<
endl;
2267 label nGap = markProximityRefinement
2277 Info<<
"Marked for refinement due to close opposite surfaces "
2278 <<
": " << nGap <<
" cells." <<
endl;
2288 && (planarCos >= -1 && planarCos <= 1)
2289 &&
max(shells_.maxGapLevel()) > 0
2296 label nGap = markInternalGapRefinement
2307 Info<<
"Marked for refinement due to opposite surfaces"
2309 <<
": " << nGap <<
" cells." <<
endl;
2320 Info<<
"Unmarked for refinement due to limit shells"
2321 <<
" : " << nUnmarked <<
" cells." <<
endl;
2330 cellsToRefine.
setSize(nRefine);
2337 cellsToRefine[nRefine++] = cellI;
2342 return cellsToRefine;
2355 meshCutter_.setRefinement(cellsToRefine, meshMod);
2361 mesh_.updateMesh(map);
2364 if (map().hasMotionPoints())
2366 mesh_.movePoints(map().preMotionPoints());
2378 updateMesh(map, getChangedFaces(map, cellsToRefine));
2393 const scalar maxLoadUnbalance
2397 refine(cellsToRefine);
2401 Pout<<
"Writing refined but unbalanced " << msg
2409 Pout<<
"Dumped debug data in = "
2410 << mesh_.time().cpuTimeIncrement() <<
" s" <<
endl;
2416 Info<<
"Refined mesh in = "
2417 << mesh_.time().cpuTimeIncrement() <<
" s" <<
endl;
2418 printMeshInfo(debug,
"After refinement " + msg);
2426 if (Pstream::nProcs() > 1)
2428 scalar nIdealCells =
2429 mesh_.globalData().nTotalCells()
2430 / Pstream::nProcs();
2434 mag(1.0-mesh_.nCells()/nIdealCells),
2438 if (unbalance <= maxLoadUnbalance)
2440 Info<<
"Skipping balancing since max unbalance " << unbalance
2441 <<
" is less than allowable " << maxLoadUnbalance
2457 Info<<
"Balanced mesh in = "
2458 << mesh_.time().cpuTimeIncrement() <<
" s" <<
endl;
2460 printMeshInfo(debug,
"After balancing " + msg);
2465 Pout<<
"Writing balanced " << msg
2473 Pout<<
"Dumped debug data in = "
2474 << mesh_.time().cpuTimeIncrement() <<
" s" <<
endl;
2494 const scalar maxLoadUnbalance
2497 labelList cellsToRefine(initCellsToRefine);
2528 if (Pstream::nProcs() > 1)
2532 scalar nNewCells = scalar(mesh_.nCells() + 7*cellsToRefine.
size());
2533 scalar nIdealNewCells =
2535 / Pstream::nProcs();
2538 mag(1.0-nNewCells/nIdealNewCells),
2542 if (unbalance <= maxLoadUnbalance)
2544 Info<<
"Skipping balancing since max unbalance " << unbalance
2545 <<
" is less than allowable " << maxLoadUnbalance
2553 cellWeights[cellsToRefine[i]] += 7;
2566 distMap().distributeCellIndices(cellsToRefine);
2568 Info<<
"Balanced mesh in = "
2569 << mesh_.time().cpuTimeIncrement() <<
" s" <<
endl;
2584 printMeshInfo(debug,
"After balancing " + msg);
2588 Pout<<
"Writing balanced " << msg
2596 Pout<<
"Dumped debug data in = "
2597 << mesh_.time().cpuTimeIncrement() <<
" s" <<
endl;
2608 refine(cellsToRefine);
2612 Pout<<
"Writing refined " << msg
2620 Pout<<
"Dumped debug data in = "
2621 << mesh_.time().cpuTimeIncrement() <<
" s" <<
endl;
2627 Info<<
"Refined mesh in = "
2628 << mesh_.time().cpuTimeIncrement() <<
" s" <<
endl;
2642 printMeshInfo(debug,
"After refinement " + msg);