63 Foam::snappyRefineDriver::snappyRefineDriver
74 meshRefiner_(meshRefiner),
75 decomposer_(decomposer),
76 distributor_(distributor),
77 globalToMasterPatch_(globalToMasterPatch),
78 globalToSlavePatch_(globalToSlavePatch),
79 setFormatter_(setFormatter),
86 Foam::label Foam::snappyRefineDriver::featureEdgeRefine
88 const refinementParameters& refineParams,
98 if (refineParams.minRefineCells() == -1)
106 const fvMesh&
mesh = meshRefiner_.mesh();
110 if (meshRefiner_.features().size() && maxIter > 0)
112 for (; iter < maxIter; iter++)
115 <<
"Feature refinement iteration " << iter <<
nl 116 <<
"------------------------------" <<
nl 121 meshRefiner_.refineCandidates
123 refineParams.locationsInMesh(),
124 refineParams.curvature(),
125 refineParams.planarAngle(),
136 refineParams.maxGlobalCells(),
137 refineParams.maxLocalCells()
142 meshRefiner_.meshCutter().consistentRefinement
148 Info<<
"Determined cells to refine in = " 153 const label nCellsToRefine =
156 Info<<
"Selected for feature refinement : " << nCellsToRefine
160 if (nCellsToRefine <= minRefine)
162 Info<<
"Stopping refining since too few cells selected." 176 meshRefiner_.balanceAndRefine
178 "feature refinement iteration " +
name(iter),
182 refineParams.maxLoadUnbalance()
187 meshRefiner_.refineAndBalance
189 "feature refinement iteration " +
name(iter),
193 refineParams.maxLoadUnbalance()
202 Foam::label Foam::snappyRefineDriver::smallFeatureRefine
204 const refinementParameters& refineParams,
213 if (refineParams.minRefineCells() == -1)
220 addProfiling(feature,
"snappyHexMesh::refine::smallFeature");
221 const fvMesh&
mesh = meshRefiner_.mesh();
226 const labelList surfaceMaxLevel(meshRefiner_.surfaces().maxGapLevel());
227 const labelList shellMaxLevel(meshRefiner_.shells().maxGapLevel());
228 const labelList curvMaxLevel(meshRefiner_.surfaces().maxCurvatureLevel());
232 max(surfaceMaxLevel) == 0
233 &&
max(shellMaxLevel) == 0
234 &&
max(curvMaxLevel) == 0
240 for (; iter < maxIter; iter++)
243 <<
"Small surface feature refinement iteration " << iter <<
nl 244 <<
"--------------------------------------------" <<
nl 253 meshRefiner_.refineCandidates
255 refineParams.locationsInMesh(),
256 refineParams.curvature(),
257 refineParams.planarAngle(),
268 refineParams.maxGlobalCells(),
269 refineParams.maxLocalCells()
275 meshRefiner_.meshCutter().consistentRefinement
281 Info<<
"Determined cells to refine in = " 285 const label nCellsToRefine =
288 Info<<
"Selected for refinement : " << nCellsToRefine
294 if (nCellsToRefine == 0)
296 Info<<
"Stopping refining since too few cells selected." 310 meshRefiner_.balanceAndRefine
312 "small feature refinement iteration " +
name(iter),
316 refineParams.maxLoadUnbalance()
321 meshRefiner_.refineAndBalance
323 "small feature refinement iteration " +
name(iter),
327 refineParams.maxLoadUnbalance()
335 Foam::label Foam::snappyRefineDriver::surfaceOnlyRefine
337 const refinementParameters& refineParams,
339 const label leakBlockageIter
347 if (refineParams.minRefineCells() == -1)
355 const fvMesh&
mesh = meshRefiner_.mesh();
356 const refinementSurfaces& surfaces = meshRefiner_.surfaces();
360 label overallMaxLevel =
max(meshRefiner_.surfaces().maxLevel());
363 for (iter = 0; iter < maxIter; iter++)
366 <<
"Surface refinement iteration " << iter <<
nl 367 <<
"------------------------------" <<
nl 372 if (iter >= leakBlockageIter)
384 DynamicList<label> selectedSurfaces(unnamedSurfaces.size());
385 for (
const label surfi : unnamedSurfaces)
387 const label regioni = surfaces.globalRegion(surfi, 0);
392 if (iter > surfaces.leakLevel()[regioni])
394 selectedSurfaces.append(surfi);
400 selectedSurfaces.size()
401 && refineParams.locationsOutsideMesh().size()
404 meshRefiner_.blockLeakFaces
406 globalToMasterPatch_,
408 refineParams.locationsInMesh(),
409 refineParams.zonesInMesh(),
410 refineParams.locationsOutsideMesh(),
424 meshRefiner_.refineCandidates
426 refineParams.locationsInMesh(),
427 refineParams.curvature(),
428 refineParams.planarAngle(),
439 refineParams.maxGlobalCells(),
440 refineParams.maxLocalCells()
445 meshRefiner_.meshCutter().consistentRefinement
451 Info<<
"Determined cells to refine in = " 455 const label nCellsToRefine =
458 Info<<
"Selected for refinement : " << nCellsToRefine
468 iter >= overallMaxLevel
469 && nCellsToRefine <= refineParams.minRefineCells()
473 Info<<
"Stopping refining since too few cells selected." 487 meshRefiner_.balanceAndRefine
489 "surface refinement iteration " +
name(iter),
493 refineParams.maxLoadUnbalance()
498 meshRefiner_.refineAndBalance
500 "surface refinement iteration " +
name(iter),
504 refineParams.maxLoadUnbalance()
512 Foam::label Foam::snappyRefineDriver::gapOnlyRefine
514 const refinementParameters& refineParams,
523 if (refineParams.minRefineCells() == -1)
530 const fvMesh&
mesh = meshRefiner_.mesh();
535 label maxIncrement = 0;
536 const labelList& maxLevel = meshRefiner_.surfaces().maxLevel();
537 const labelList& gapLevel = meshRefiner_.surfaces().gapLevel();
541 maxIncrement =
max(maxIncrement, gapLevel[i]-maxLevel[i]);
546 if (maxIncrement == 0)
551 for (iter = 0; iter < maxIter; iter++)
554 <<
"Gap refinement iteration " << iter <<
nl 555 <<
"--------------------------" <<
nl 566 meshRefiner_.refineCandidates
568 refineParams.locationsInMesh(),
569 refineParams.curvature(),
570 refineParams.planarAngle(),
581 refineParams.maxGlobalCells(),
582 refineParams.maxLocalCells()
588 Pout<<
"Writing current mesh to time " 589 << meshRefiner_.timeName() <<
endl;
600 Pout<<
"Dumped mesh in = " 604 Pout<<
"Dumping " << candidateCells.size()
605 <<
" cells to cellSet candidateCellsFromGap." <<
endl;
606 cellSet
c(
mesh,
"candidateCellsFromGap", candidateCells);
607 c.instance() = meshRefiner_.timeName();
616 isCandidateCell[candidateCells[i]] =
true;
619 for (label i=0; i<1; i++)
621 boolList newIsCandidateCell(isCandidateCell);
629 if (isCandidateCell[own] != isCandidateCell[nei])
631 newIsCandidateCell[own] =
true;
632 newIsCandidateCell[nei] =
true;
656 if (isCandidateCell[own] != neiIsCandidateCell[bFacei])
658 newIsCandidateCell[own] =
true;
662 isCandidateCell.transfer(newIsCandidateCell);
666 forAll(isCandidateCell, celli)
668 if (isCandidateCell[celli])
673 candidateCells.setSize(
n);
675 forAll(isCandidateCell, celli)
677 if (isCandidateCell[celli])
679 candidateCells[
n++] = celli;
687 Pout<<
"Dumping " << candidateCells.size()
688 <<
" cells to cellSet candidateCellsFromGapPlusBuffer." <<
endl;
689 cellSet
c(
mesh,
"candidateCellsFromGapPlusBuffer", candidateCells);
690 c.instance() = meshRefiner_.timeName();
697 meshRefiner_.meshCutter().consistentRefinement
703 Info<<
"Determined cells to refine in = " 707 const label nCellsToRefine =
710 Info<<
"Selected for refinement : " << nCellsToRefine
721 && nCellsToRefine <= refineParams.minRefineCells()
725 Info<<
"Stopping refining since too few cells selected." 739 meshRefiner_.balanceAndRefine
741 "gap refinement iteration " +
name(iter),
745 refineParams.maxLoadUnbalance()
750 meshRefiner_.refineAndBalance
752 "gap refinement iteration " +
name(iter),
756 refineParams.maxLoadUnbalance()
764 Foam::label Foam::snappyRefineDriver::surfaceProximityBlock
766 const refinementParameters& refineParams,
770 if (refineParams.minRefineCells() == -1)
777 fvMesh&
mesh = meshRefiner_.mesh();
779 if (
min(meshRefiner_.surfaces().blockLevel()) ==
labelMax)
786 for (iter = 0; iter < maxIter; iter++)
789 <<
"Gap blocking iteration " << iter <<
nl 790 <<
"------------------------" <<
nl 797 meshRefiner_.removeGapCells
799 refineParams.planarAngle(),
800 meshRefiner_.surfaces().blockLevel(),
801 globalToMasterPatch_,
802 refineParams.nFilterIter()
808 Pout<<
"Writing gap blocking iteration " 809 << iter <<
" mesh to time " << meshRefiner_.timeName()
827 Foam::label Foam::snappyRefineDriver::bigGapOnlyRefine
829 const refinementParameters& refineParams,
830 const bool spreadGapSize,
834 if (refineParams.minRefineCells() == -1)
846 const fvMesh&
mesh = meshRefiner_.mesh();
851 labelList surfaceMaxLevel(meshRefiner_.surfaces().maxGapLevel());
852 labelList shellMaxLevel(meshRefiner_.shells().maxGapLevel());
854 label overallMaxLevel(
max(
max(surfaceMaxLevel),
max(shellMaxLevel)));
856 if (overallMaxLevel == 0)
862 for (; iter < maxIter; iter++)
865 <<
"Big gap refinement iteration " << iter <<
nl 866 <<
"------------------------------" <<
nl 875 meshRefiner_.refineCandidates
877 refineParams.locationsInMesh(),
878 refineParams.curvature(),
879 refineParams.planarAngle(),
890 refineParams.maxGlobalCells(),
891 refineParams.maxLocalCells()
898 Pout<<
"Writing current mesh to time " 899 << meshRefiner_.timeName() <<
endl;
910 Pout<<
"Dumped mesh in = " 913 Pout<<
"Dumping " << candidateCells.size()
914 <<
" cells to cellSet candidateCellsFromBigGap." <<
endl;
915 cellSet
c(
mesh,
"candidateCellsFromBigGap", candidateCells);
916 c.instance() = meshRefiner_.timeName();
922 meshRefiner_.meshCutter().consistentRefinement
928 Info<<
"Determined cells to refine in = " 932 const label nCellsToRefine =
935 Info<<
"Selected for refinement : " << nCellsToRefine
945 iter >= overallMaxLevel
946 && nCellsToRefine <= refineParams.minRefineCells()
950 Info<<
"Stopping refining since too few cells selected." 964 meshRefiner_.balanceAndRefine
966 "big gap refinement iteration " +
name(iter),
970 refineParams.maxLoadUnbalance()
975 meshRefiner_.refineAndBalance
977 "big gap refinement iteration " +
name(iter),
981 refineParams.maxLoadUnbalance()
989 Foam::label Foam::snappyRefineDriver::danglingCellRefine
991 const refinementParameters& refineParams,
996 if (refineParams.minRefineCells() == -1)
1008 addProfiling(dangling,
"snappyHexMesh::refine::danglingCell");
1009 const fvMesh&
mesh = meshRefiner_.mesh();
1012 for (iter = 0; iter < maxIter; iter++)
1015 <<
"Dangling coarse cells refinement iteration " << iter <<
nl 1016 <<
"--------------------------------------------" <<
nl 1028 cellSet candidateCellSet(
mesh,
"candidateCells",
cells.
size()/1000);
1032 const cell& cFaces =
cells[celli];
1034 label nIntFaces = 0;
1044 label patchi = pbm.patchID()[bFacei];
1052 if (nIntFaces == nFaces)
1054 candidateCellSet.insert(celli);
1060 Pout<<
"Dumping " << candidateCellSet.size()
1061 <<
" cells to cellSet candidateCellSet." <<
endl;
1062 candidateCellSet.instance() = meshRefiner_.timeName();
1063 candidateCellSet.
write();
1065 candidateCells = candidateCellSet.toc();
1072 meshRefiner_.meshCutter().consistentRefinement
1078 Info<<
"Determined cells to refine in = " 1082 const label nCellsToRefine =
1085 Info<<
"Selected for refinement : " << nCellsToRefine
1096 && nCellsToRefine <= refineParams.minRefineCells()
1100 Info<<
"Stopping refining since too few cells selected." 1114 meshRefiner_.balanceAndRefine
1116 "coarse cell refinement iteration " +
name(iter),
1120 refineParams.maxLoadUnbalance()
1125 meshRefiner_.refineAndBalance
1127 "coarse cell refinement iteration " +
name(iter),
1131 refineParams.maxLoadUnbalance()
1141 Foam::label Foam::snappyRefineDriver::refinementInterfaceRefine
1143 const refinementParameters& refineParams,
1147 if (refineParams.minRefineCells() == -1)
1160 const fvMesh&
mesh = meshRefiner_.mesh();
1164 if (refineParams.interfaceRefine())
1166 for (;iter < maxIter; iter++)
1169 <<
"Refinement transition refinement iteration " << iter <<
nl 1170 <<
"--------------------------------------------" <<
nl 1173 const labelList& surfaceIndex = meshRefiner_.surfaceIndex();
1174 const hexRef8& cutter = meshRefiner_.meshCutter();
1188 cellSet transitionCells
1197 const cell& cFaces =
cells[celli];
1198 label cLevel = cutter.cellLevel()[celli];
1202 label facei = cFaces[cFacei];
1204 if (surfaceIndex[facei] != -1)
1206 label fLevel = cutter.faceLevel(facei);
1207 if (fLevel != cLevel)
1209 transitionCells.insert(celli);
1216 cellSet candidateCellSet
1337 for (
const label celli : transitionCells)
1339 const cell& cFaces =
cells[celli];
1340 label cLevel = cutter.cellLevel()[celli];
1343 bool foundOpposite =
false;
1347 label facei = cFaces[cFacei];
1351 surfaceIndex[facei] != -1
1352 && cutter.faceLevel(facei) > cLevel
1357 if (faceOwner[facei] != celli)
1365 label face2i = cFaces[cFaceI2];
1370 && surfaceIndex[face2i] != -1
1375 if (faceOwner[face2i] != celli)
1381 if ((
n&n2) < oppositeCos)
1383 foundOpposite =
true;
1399 candidateCellSet.insert(celli);
1405 Pout<<
"Dumping " << candidateCellSet.size()
1406 <<
" cells to cellSet candidateCellSet." <<
endl;
1407 candidateCellSet.instance() = meshRefiner_.timeName();
1408 candidateCellSet.
write();
1410 candidateCells = candidateCellSet.toc();
1417 meshRefiner_.meshCutter().consistentRefinement
1423 Info<<
"Determined cells to refine in = " 1427 const label nCellsToRefine =
1430 Info<<
"Selected for refinement : " << nCellsToRefine
1441 && nCellsToRefine <= refineParams.minRefineCells()
1445 Info<<
"Stopping refining since too few cells selected." 1459 meshRefiner_.balanceAndRefine
1461 "interface cell refinement iteration " +
name(iter),
1465 refineParams.maxLoadUnbalance()
1470 meshRefiner_.refineAndBalance
1472 "interface cell refinement iteration " +
name(iter),
1476 refineParams.maxLoadUnbalance()
1484 bool Foam::snappyRefineDriver::usesHigherLevel
1491 for (
const label pointi :
f)
1493 if (boundaryPointLevel[pointi] > cLevel)
1502 Foam::label Foam::snappyRefineDriver::boundaryRefinementInterfaceRefine
1504 const refinementParameters& refineParams,
1508 if (refineParams.minRefineCells() == -1)
1521 const fvMesh&
mesh = meshRefiner_.mesh();
1525 if (refineParams.interfaceRefine())
1527 for (;iter < maxIter; iter++)
1530 <<
"Boundary refinement iteration " << iter <<
nl 1531 <<
"-------------------------------" <<
nl 1534 const labelList& surfaceIndex = meshRefiner_.surfaceIndex();
1535 const hexRef8& cutter = meshRefiner_.meshCutter();
1536 const labelList& cellLevel = cutter.cellLevel();
1548 forAll(surfaceIndex, facei)
1550 if (surfaceIndex[facei] != -1)
1552 isBoundaryFace.set(facei);
1553 isBoundaryPoint.set(faces[facei]);
1556 const labelList meshPatchIDs(meshRefiner_.meshedPatches());
1557 for (
const label patchi : meshPatchIDs)
1562 isBoundaryFace.set(pp.start()+i);
1563 isBoundaryPoint.set(pp[i]);
1571 orEqOp<unsigned int>(),
1582 const cell& cFaces =
cells[celli];
1583 const label cLevel = cellLevel[celli];
1585 for (
const label facei : cFaces)
1587 if (isBoundaryFace(facei))
1589 const face&
f = faces[facei];
1590 for (
const label pointi :
f)
1592 boundaryPointLevel[pointi] =
1595 boundaryPointLevel[pointi],
1618 cellSet candidateCellSet
1627 const cell& cFaces =
cells[celli];
1628 const label cLevel = cellLevel[celli];
1630 bool isBoundaryCell =
false;
1631 for (
const label facei : cFaces)
1633 if (isBoundaryFace(facei))
1635 isBoundaryCell =
true;
1640 if (!isBoundaryCell)
1642 for (
const label facei : cFaces)
1645 if (usesHigherLevel(boundaryPointLevel,
f, cLevel))
1647 candidateCellSet.insert(celli);
1655 Pout<<
"Dumping " << candidateCellSet.size()
1656 <<
" cells to cellSet candidateCellSet." <<
endl;
1657 candidateCellSet.instance() = meshRefiner_.timeName();
1658 candidateCellSet.
write();
1660 candidateCells = candidateCellSet.toc();
1665 meshRefiner_.meshCutter().consistentRefinement
1671 Info<<
"Determined cells to refine in = " 1675 const label nCellsToRefine =
1678 Info<<
"Selected for refinement : " << nCellsToRefine
1693 Info<<
"Stopping refining since too few cells selected." 1707 meshRefiner_.balanceAndRefine
1709 "boundary cell refinement iteration " +
name(iter),
1713 refineParams.maxLoadUnbalance()
1718 meshRefiner_.refineAndBalance
1720 "boundary cell refinement iteration " +
name(iter),
1724 refineParams.maxLoadUnbalance()
1733 void Foam::snappyRefineDriver::removeInsideCells
1735 const refinementParameters& refineParams,
1736 const label nBufferLayers
1740 if (meshRefiner_.limitShells().shells().size() == 0 && nBufferLayers == 0)
1751 <<
"Removing mesh beyond surface intersections" <<
nl 1752 <<
"------------------------------------------" <<
nl 1755 const fvMesh&
mesh = meshRefiner_.mesh();
1763 if (meshRefiner_.limitShells().shells().size())
1765 meshRefiner_.removeLimitShells
1769 globalToMasterPatch_,
1770 globalToSlavePatch_,
1771 refineParams.locationsInMesh(),
1772 refineParams.zonesInMesh(),
1773 refineParams.locationsOutsideMesh()
1780 meshRefiner_.splitMesh
1783 refineParams.nErodeCellZone(),
1784 globalToMasterPatch_,
1785 globalToSlavePatch_,
1786 refineParams.locationsInMesh(),
1787 refineParams.zonesInMesh(),
1788 refineParams.locationsOutsideMesh(),
1789 !refineParams.useLeakClosure(),
1797 Pout<<
"Writing subsetted mesh to time " 1798 << meshRefiner_.timeName() <<
endl;
1809 Pout<<
"Dumped mesh in = " 1815 Foam::label Foam::snappyRefineDriver::shellRefine
1817 const refinementParameters& refineParams,
1826 if (refineParams.minRefineCells() == -1)
1834 const fvMesh&
mesh = meshRefiner_.mesh();
1837 meshRefiner_.userFaceData().setSize(1);
1841 meshRefiner_.userFaceData()[0].second() = ListOps::createWithValue<label>
1844 meshRefiner_.intersectedFaces(),
1852 label overallMaxShellLevel = meshRefiner_.shells().maxLevel();
1855 for (iter = 0; iter < maxIter; iter++)
1858 <<
"Shell refinement iteration " << iter <<
nl 1859 <<
"----------------------------" <<
nl 1864 meshRefiner_.refineCandidates
1866 refineParams.locationsInMesh(),
1867 refineParams.curvature(),
1868 refineParams.planarAngle(),
1879 refineParams.maxGlobalCells(),
1880 refineParams.maxLocalCells()
1886 Pout<<
"Dumping " << candidateCells.size()
1887 <<
" cells to cellSet candidateCellsFromShells." <<
endl;
1889 cellSet
c(
mesh,
"candidateCellsFromShells", candidateCells);
1890 c.instance() = meshRefiner_.timeName();
1903 findIndices(meshRefiner_.userFaceData()[0].second(), 0)
1911 if (refineParams.nBufferLayers() <= 2)
1913 cellsToRefine = meshRefiner_.meshCutter().consistentSlowRefinement
1915 refineParams.nBufferLayers(),
1919 meshRefiner_.intersectedPoints()
1924 cellsToRefine = meshRefiner_.meshCutter().consistentSlowRefinement2
1926 refineParams.nBufferLayers(),
1932 Info<<
"Determined cells to refine in = " 1936 const label nCellsToRefine =
1939 Info<<
"Selected for internal refinement : " << nCellsToRefine
1949 iter >= overallMaxShellLevel
1950 && nCellsToRefine <= refineParams.minRefineCells()
1954 Info<<
"Stopping refining since too few cells selected." 1967 meshRefiner_.balanceAndRefine
1969 "shell refinement iteration " +
name(iter),
1973 refineParams.maxLoadUnbalance()
1978 meshRefiner_.refineAndBalance
1980 "shell refinement iteration " +
name(iter),
1984 refineParams.maxLoadUnbalance()
1988 meshRefiner_.userFaceData().clear();
1994 Foam::label Foam::snappyRefineDriver::directionalShellRefine
1996 const refinementParameters& refineParams,
2005 addProfiling(shell,
"snappyHexMesh::refine::directionalShell");
2006 const fvMesh&
mesh = meshRefiner_.mesh();
2007 const shellSurfaces& shells = meshRefiner_.shells();
2010 const_cast<labelIOList&
>(meshRefiner_.meshCutter().cellLevel());
2012 const_cast<labelIOList&
>(meshRefiner_.meshCutter().pointLevel());
2017 const labelPairList dirSelect(shells.directionalSelectLevel());
2020 forAll(dirSelect, shelli)
2022 overallMinLevel =
min(dirSelect[shelli].first(), overallMinLevel);
2023 overallMaxLevel =
max(dirSelect[shelli].second(), overallMaxLevel);
2026 if (overallMinLevel > overallMaxLevel)
2032 List<labelVector> dirCellLevel(cellLevel.size());
2039 for (iter = 0; iter < maxIter; iter++)
2042 <<
"Directional shell refinement iteration " << iter <<
nl 2043 <<
"----------------------------------------" <<
nl 2046 label nAllRefine = 0;
2048 for (
direction dir = 0; dir < vector::nComponents; dir++)
2057 labelList currentLevel(dirCellLevel.size());
2058 forAll(dirCellLevel, celli)
2060 currentLevel[celli] = dirCellLevel[celli][dir];
2065 meshRefiner_.directionalRefineCandidates
2067 refineParams.maxGlobalCells(),
2068 refineParams.maxLocalCells(),
2077 meshRefiner_.meshCutter().consistentRefinement
2085 Info<<
"Determined cells to refine in = " 2088 const label nCellsToRefine =
2091 Info<<
"Selected for direction " << vector::componentNames[dir]
2092 <<
" refinement : " << nCellsToRefine
2096 nAllRefine += nCellsToRefine;
2100 if (nCellsToRefine > 0)
2107 const bitSet isRefineCell(
mesh.
nCells(), cellsToRefine);
2109 autoPtr<mapPolyMesh> map
2111 meshRefiner_.directionalRefine
2113 "directional refinement iteration " +
name(iter),
2119 Info<<
"Refined mesh in = " 2140 forAll(map().cellMap(), celli)
2142 if (isRefineCell[map().cellMap()[celli]])
2144 dirCellLevel[celli][dir]++;
2150 forAll(map().pointMap(), pointi)
2152 label oldPointi = map().pointMap()[pointi];
2153 if (map().reversePointMap()[oldPointi] != pointi)
2156 pointLevel[pointi]++;
2163 if (nAllRefine == 0)
2165 Info<<
"Stopping refining since no cells selected." 2170 meshRefiner_.printMeshInfo
2173 "After directional refinement iteration " +
name(iter)
2178 Pout<<
"Writing directional refinement iteration " 2179 << iter <<
" mesh to time " << meshRefiner_.timeName() <<
endl;
2201 cellLevel[celli] =
cmptMax(dirCellLevel[celli]);
2208 void Foam::snappyRefineDriver::mergeAndSmoothRatio
2211 const label nSmoothExpansion,
2212 List<Tuple2<scalar, scalar>>& keyAndValue
2217 SortableList<scalar> unmergedDist(allSeedPointDist);
2218 DynamicList<scalar> mergedDist;
2220 scalar prevDist = GREAT;
2223 scalar curDist = unmergedDist[i];
2224 scalar difference =
mag(curDist - prevDist);
2225 if (difference > meshRefiner_.mergeDistance())
2228 mergedDist.append(curDist);
2234 SortableList<scalar> sortedDist(mergedDist);
2235 labelList indexSet = sortedDist.indices();
2238 scalarList seedPointsNewLocation = sortedDist;
2240 scalar initResidual = 0.0;
2241 scalar prevIterResidual = GREAT;
2243 for (label iter = 0; iter < nSmoothExpansion; iter++)
2257 for(label i = 2; i<mergedDist.size()-1; i++)
2259 scalar oldX00 = sortedDist[i-2];
2260 scalar oldX1 = sortedDist[i+1];
2261 scalar curX0 = seedPointsNewLocation[i-1];
2262 seedPointsNewLocation[i] = curX0 + (oldX1 - oldX00)/3;
2265 const scalarField residual(seedPointsNewLocation-sortedDist);
2267 scalar res(
sumMag(residual));
2273 res /= initResidual;
2275 if (
mag(prevIterResidual - res) < SMALL)
2279 Pout<<
"Converged with iteration " << iter
2280 <<
" initResidual: " << initResidual
2281 <<
" final residual : " << res <<
endl;
2287 prevIterResidual = res;
2292 sortedDist = seedPointsNewLocation;
2296 keyAndValue.setSize(mergedDist.size());
2300 keyAndValue[i].first() = mergedDist[i];
2301 label index = indexSet[i];
2302 keyAndValue[i].second() = seedPointsNewLocation[index];
2307 Foam::label Foam::snappyRefineDriver::directionalSmooth
2309 const refinementParameters& refineParams
2314 <<
"Directional expansion ratio smoothing" <<
nl 2315 <<
"-------------------------------------" <<
nl 2318 fvMesh& baseMesh = meshRefiner_.mesh();
2319 const searchableSurfaces& geometry = meshRefiner_.surfaces().geometry();
2320 const shellSurfaces& shells = meshRefiner_.shells();
2324 forAll(shells.nSmoothExpansion(), shellI)
2328 shells.nSmoothExpansion()[shellI] > 0
2329 || shells.nSmoothPosition()[shellI] > 0
2332 label surfi = shells.shells()[shellI];
2333 const vector& userDirection = shells.smoothDirection()[shellI];
2340 List<volumeType> volType;
2341 geometry[surfi].getVolumeType(baseMesh.points(), volType);
2373 bitSet isXEdge(baseMesh.edges().size());
2375 const edgeList& edges = baseMesh.edges();
2378 const edge&
e = edges[edgei];
2379 vector eVec(
e.vec(baseMesh.points()));
2381 if (
mag(eVec&userDirection) > 0.9)
2390 const scalar totalLength =
2391 geometry[surfi].bounds().span()
2393 const scalar startPosition =
2394 geometry[surfi].bounds().min()
2401 normalizedPosition[i] =
2403 ((baseMesh.points()[pointi]&userDirection) - startPosition)
2411 DynamicList<scalar> seedPointDist;
2414 scalar prevDist = GREAT;
2417 label pointi = order[i];
2418 scalar curDist = normalizedPosition[pointi];
2419 if (
mag(curDist - prevDist) > meshRefiner_.mergeDistance())
2421 seedPointDist.append(curDist);
2435 ListListOps::combine<scalarList>
2437 gatheredDist, accessOp<scalarList>()
2442 bitSet isFrozenPoint(baseMesh.nPoints(),
true);
2445 scalar minSeed =
min(allSeedPointDist);
2446 scalar maxSeed =
max(allSeedPointDist);
2449 forAll(normalizedPosition, posI)
2451 const scalar
pos = normalizedPosition[posI];
2454 (
mag(
pos-minSeed) < meshRefiner_.mergeDistance())
2455 || (
mag(
pos-maxSeed) < meshRefiner_.mergeDistance())
2469 Info<<
"Smoothing " << geometry[surfi].name() <<
':' <<
nl 2470 <<
" Direction : " << userDirection <<
nl 2471 <<
" Number of points : " 2473 <<
" (out of " << baseMesh.globalData().nTotalPoints()
2475 <<
" Smooth expansion iterations : " 2476 << shells.nSmoothExpansion()[shellI] <<
nl 2477 <<
" Smooth position iterations : " 2478 << shells.nSmoothPosition()[shellI] <<
nl 2479 <<
" Number of planes : " 2480 << allSeedPointDist.size()
2484 List<Tuple2<scalar, scalar>> keyAndValue(allSeedPointDist.size());
2493 shells.nSmoothExpansion()[shellI],
2503 const interpolationTable<scalar> table
2515 const point& curPoint = baseMesh.points()[pointi];
2516 scalar curDist = normalizedPosition[i];
2517 scalar newDist = table(curDist);
2518 scalar newPosition = startPosition + newDist*totalLength;
2519 baseNewPoints[pointi] +=
2520 userDirection * (newPosition - (curPoint &userDirection));
2524 vectorField disp(baseNewPoints-baseMesh.points());
2529 maxMagSqrEqOp<vector>(),
2532 baseMesh.movePoints(baseMesh.points()+disp);
2535 baseMesh.moving(
false);
2539 const_cast<Time&
>(baseMesh.time())++;
2541 Pout<<
"Writing directional expansion ratio smoothed" 2542 <<
" mesh to time " << meshRefiner_.timeName() <<
endl;
2552 baseMesh.time().path()/meshRefiner_.timeName()
2559 pointField baseMeshPoints(baseMesh.points());
2560 scalar initResidual = 0.0;
2561 scalar prevIterResidual = GREAT;
2562 for (iter = 0; iter < shells.nSmoothPosition()[shellI]; iter++)
2565 const edgeList& edges = baseMesh.edges();
2575 const edge&
e = edges[edgei];
2577 (unsmoothedPoints[
e[1]]&userDirection);
2580 (unsmoothedPoints[
e[0]]&userDirection);
2601 if (nSumXEdges[pointi] < 2)
2605 const labelList& pEdges = pointEdges[pointi];
2608 label edgei = pEdges[pE];
2611 const edge&
e = edges[edgei];
2612 label otherPt =
e.otherVertex(pointi);
2613 nSumOther[pointi]--;
2616 unsmoothedPoints[otherPt]
2643 if ((nSumOther[pointi] >= 2) && !isFrozenPoint[pointi])
2648 (unsmoothedPoints[pointi]&userDirection)
2649 +sumOther[pointi]/nSumOther[pointi]
2652 vector& v = baseNewPoints[pointi];
2653 v += (smoothPos-(v&userDirection))*userDirection;
2657 const vectorField residual(baseNewPoints - baseMeshPoints);
2659 scalar res(
gSum(
mag(residual)));
2665 res /= initResidual;
2667 if (
mag(prevIterResidual - res) < SMALL)
2669 Info<<
"Converged smoothing in iteration " << iter
2670 <<
" initResidual: " << initResidual
2671 <<
" final residual : " << res <<
endl;
2676 prevIterResidual = res;
2681 baseMeshPoints = baseNewPoints;
2686 vectorField dispSmooth(baseMeshPoints-baseMesh.points());
2691 maxMagSqrEqOp<vector>(),
2694 baseMesh.movePoints(baseMesh.points()+dispSmooth);
2697 baseMesh.moving(
false);
2701 const_cast<Time&
>(baseMesh.time())++;
2703 Pout<<
"Writing positional smoothing iteration " 2704 << iter <<
" mesh to time " << meshRefiner_.timeName()
2714 baseMesh.time().path()/meshRefiner_.timeName()
2723 void Foam::snappyRefineDriver::baffleAndSplitMesh
2725 const refinementParameters& refineParams,
2726 const snapParameters& snapParams,
2727 const bool handleSnapProblems,
2728 const dictionary& motionDict
2738 <<
"Splitting mesh at surface intersections" <<
nl 2739 <<
"---------------------------------------" <<
nl 2742 const fvMesh&
mesh = meshRefiner_.mesh();
2752 meshRefiner_.baffleAndSplitMesh
2758 refineParams.useTopologicalSnapDetection(),
2761 refineParams.nErodeCellZone(),
2765 globalToMasterPatch_,
2766 globalToSlavePatch_,
2767 refineParams.locationsInMesh(),
2768 refineParams.zonesInMesh(),
2769 refineParams.locationsOutsideMesh(),
2770 !refineParams.useLeakClosure(),
2775 if (!handleSnapProblems)
2777 meshRefiner_.mergeFreeStandingBaffles
2780 refineParams.useTopologicalSnapDetection(),
2783 refineParams.planarAngle(),
2786 globalToMasterPatch_,
2787 globalToSlavePatch_,
2788 refineParams.locationsInMesh(),
2789 refineParams.locationsOutsideMesh()
2795 void Foam::snappyRefineDriver::zonify
2797 const refinementParameters& refineParams,
2812 namedSurfaces.size()
2813 || refineParams.zonesInMesh().size()
2817 <<
"Introducing zones for interfaces" <<
nl 2818 <<
"--------------------------------" <<
nl 2821 const fvMesh&
mesh = meshRefiner_.mesh();
2830 refineParams.allowFreeStandingZoneFaces(),
2831 refineParams.nErodeCellZone(),
2832 refineParams.locationsInMesh(),
2833 refineParams.zonesInMesh(),
2834 refineParams.locationsOutsideMesh(),
2835 !refineParams.useLeakClosure(),
2842 Pout<<
"Writing zoned mesh to time " 2843 << meshRefiner_.timeName() <<
endl;
2862 void Foam::snappyRefineDriver::splitAndMergeBaffles
2864 const refinementParameters& refineParams,
2865 const snapParameters& snapParams,
2866 const bool handleSnapProblems,
2867 const dictionary& motionDict
2876 <<
"Handling cells with snap problems" <<
nl 2877 <<
"---------------------------------" <<
nl 2880 const fvMesh&
mesh = meshRefiner_.mesh();
2888 const scalarField& perpAngle = meshRefiner_.surfaces().perpendicularAngle();
2890 meshRefiner_.baffleAndSplitMesh
2896 refineParams.useTopologicalSnapDetection(),
2899 refineParams.nErodeCellZone(),
2903 globalToMasterPatch_,
2904 globalToSlavePatch_,
2905 refineParams.locationsInMesh(),
2906 refineParams.zonesInMesh(),
2907 refineParams.locationsOutsideMesh(),
2908 !refineParams.useLeakClosure(),
2913 meshRefiner_.mergeFreeStandingBaffles
2916 refineParams.useTopologicalSnapDetection(),
2919 refineParams.planarAngle(),
2922 globalToMasterPatch_,
2923 globalToSlavePatch_,
2924 refineParams.locationsInMesh(),
2925 refineParams.locationsOutsideMesh()
2935 meshRefiner_.dupNonManifoldPoints();
2941 const label nCouples =
returnReduce(couples.size(), sumOp<label>());
2943 Info<<
"Detected unsplittable baffles : " << nCouples <<
endl;
2950 meshRefiner_.mergeBaffles(couples, Map<label>(0));
2955 meshRefiner_.checkData();
2959 meshRefiner_.splitMeshRegions
2961 globalToMasterPatch_,
2962 globalToSlavePatch_,
2963 refineParams.locationsInMesh(),
2964 refineParams.locationsOutsideMesh(),
2972 meshRefiner_.checkData();
2975 Info<<
"Merged free-standing baffles in = " 2981 Pout<<
"Writing handleProblemCells mesh to time " 2982 << meshRefiner_.timeName() <<
endl;
2999 meshRefinement& meshRefiner,
3000 const refinementParameters& refineParams,
3001 const HashTable<Pair<word>>& faceZoneToPatches
3004 if (faceZoneToPatches.size())
3007 <<
"Adding patches for face zones" <<
nl 3008 <<
"-----------------------------" <<
nl 3012 <<
setw(6) <<
"Patch" 3013 <<
setw(20) <<
"Type" 3014 <<
setw(30) <<
"Name" 3015 <<
setw(30) <<
"FaceZone" 3016 <<
setw(10) <<
"FaceType" 3018 <<
setw(6) <<
"-----" 3019 <<
setw(20) <<
"----" 3020 <<
setw(30) <<
"----" 3021 <<
setw(30) <<
"--------" 3022 <<
setw(10) <<
"--------" 3025 const polyMesh&
mesh = meshRefiner.mesh();
3030 const word& fzName = iter.key();
3035 dictionary patchInfo = refineParams.getZoneInfo(fzName, fzType);
3037 const word& masterName = fzName;
3042 label mpi = meshRefiner.addMeshedPatch(masterName, patchInfo);
3047 <<
setw(30) << masterName
3048 <<
setw(30) << fzName
3053 label sli = meshRefiner.addMeshedPatch(slaveName, patchInfo);
3058 <<
setw(30) << slaveName
3059 <<
setw(30) << fzName
3063 meshRefiner.addFaceZone(fzName, masterName, slaveName, fzType);
3071 void Foam::snappyRefineDriver::mergePatchFaces
3074 const refinementParameters& refineParams,
3075 const dictionary& motionDict
3085 <<
"Merge refined boundary faces" <<
nl 3086 <<
"----------------------------" <<
nl 3089 const fvMesh&
mesh = meshRefiner_.mesh();
3093 mergeType == meshRefinement::FaceMergeType::GEOMETRIC
3094 || mergeType == meshRefinement::FaceMergeType::IGNOREPATCH
3097 meshRefiner_.mergePatchFacesUndo
3101 meshRefiner_.meshedPatches(),
3110 meshRefiner_.mergePatchFaces
3115 meshRefiner_.meshedPatches(),
3116 meshRefinement::FaceMergeType::GEOMETRIC
3122 meshRefiner_.checkData();
3129 meshRefiner_.checkData();
3134 void Foam::snappyRefineDriver::deleteSmallRegions
3136 const refinementParameters& refineParams
3139 const fvMesh&
mesh = meshRefiner_.mesh();
3167 meshRefiner_.selectSeparatedCoupledFaces(isBlockedFace);
3171 if (ownPatch[facei] != -1)
3173 isBlockedFace[facei] =
true;
3180 for (
const auto& cz : czm)
3182 UIndirectList<label>(cellToZone, cz) = cz.index();
3186 const regionSplit cellRegion(
mesh, isBlockedFace);
3189 labelList nCellsPerRegion(cellRegion.nRegions(), 0);
3190 labelList regionToZone(cellRegion.nRegions(), -2);
3191 labelList nCellsPerZone(czm.size()+1, 0);
3192 forAll(cellRegion, celli)
3194 const label regioni = cellRegion[celli];
3195 const label zonei = cellToZone[celli];
3198 regionToZone[regioni] = zonei;
3200 nCellsPerRegion[regioni]++;
3201 nCellsPerZone[zonei]++;
3211 forAll(nCellsPerRegion, regioni)
3213 const label zonei = regionToZone[regioni];
3214 label& nRegionCells = nCellsPerRegion[regioni];
3218 nRegionCells < refineParams.minCellFraction()*nCellsPerZone[zonei]
3219 || nRegionCells < refineParams.nMinCells()
3222 Info<<
"Deleting region " << regioni
3223 <<
" (size " << nRegionCells
3224 <<
") of zone size " << nCellsPerZone[zonei]
3233 DynamicList<label> cellsToRemove(
mesh.
nCells()/128);
3234 forAll(cellRegion, celli)
3236 if (nCellsPerRegion[cellRegion[celli]] == 0)
3238 cellsToRemove.append(celli);
3243 cellsToRemove.size(),
3246 if (nTotCellsToRemove > 0)
3248 Info<<
"Deleting " << nTotCellsToRemove
3249 <<
" cells in small regions" <<
endl;
3251 removeCells cellRemover(
mesh);
3253 cellsToRemove.shrink();
3256 cellRemover.getExposedFaces(cellsToRemove)
3260 UIndirectList<label>(ownPatch, exposedFaces)
3262 (void)meshRefiner_.doRemoveCells
3275 const dictionary& refineDict,
3276 const refinementParameters& refineParams,
3277 const snapParameters& snapParams,
3278 const bool prepareForSnapping,
3280 const dictionary& motionDict
3285 <<
"Refinement phase" <<
nl 3286 <<
"----------------" <<
nl 3289 const fvMesh&
mesh = meshRefiner_.mesh();
3293 refineParams.findCells(
true,
mesh, refineParams.locationsInMesh());
3298 refineParams.findCells(
true,
mesh, refineParams.locationsOutsideMesh());
3304 snappyVoxelMeshDriver voxelDriver
3307 globalToMasterPatch_,
3310 voxelDriver.doRefine(refineParams);
3326 max(meshRefiner_.surfaces().maxGapLevel()) > 0
3327 ||
max(meshRefiner_.shells().maxGapLevel()) > 0
3328 ||
max(meshRefiner_.surfaces().maxCurvatureLevel()) > 0
3368 surfaceProximityBlock
3419 refinementInterfaceRefine
3426 directionalShellRefine
3433 if (refineParams.locationsOutsideMesh().size())
3441 meshRefiner_.surfaces().surfZones()
3444 if (unnamedSurfaces.size())
3446 meshRefiner_.blockLeakFaces
3448 globalToMasterPatch_,
3449 globalToSlavePatch_,
3450 refineParams.locationsInMesh(),
3451 refineParams.zonesInMesh(),
3452 refineParams.locationsOutsideMesh(),
3460 max(meshRefiner_.shells().nSmoothExpansion()) > 0
3461 ||
max(meshRefiner_.shells().nSmoothPosition()) > 0
3464 directionalSmooth(refineParams);
3492 zonify(refineParams, zonesToFaceZone);
3496 HashTable<Pair<word>> faceZoneToPatches(zonesToFaceZone.size());
3501 List<Pair<word>> czs(zonesToFaceZone.sortedToc());
3505 const Pair<word>& czNames = czs[i];
3506 const word& fzName = zonesToFaceZone[czNames];
3508 const word& masterName = fzName;
3509 const word slaveName = czNames.second() +
"_to_" + czNames.first();
3510 Pair<word>
patches(masterName, slaveName);
3511 faceZoneToPatches.insert(fzName,
patches);
3513 addFaceZones(meshRefiner_, refineParams, faceZoneToPatches);
3517 splitAndMergeBaffles
3526 if (prepareForSnapping)
3528 mergePatchFaces(mergeType, refineParams, motionDict);
3532 if (refineParams.minCellFraction() > 0 || refineParams.nMinCells() > 0)
3539 deleteSmallRegions(refineParams);
3546 <<
"Doing final balancing" <<
nl 3547 <<
"---------------------" <<
nl 3553 meshRefiner_.balance
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
List< labelList > labelListList
A List of labelList.
void size(const label n)
Older name for setAddressableSize.
void cmptMax(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
const labelIOList & zoneIDs
#define addProfiling(name, descr)
Define profiling trigger with specified name and description string.
fileName path() const
Return path.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
labelList pointLabels(nPoints, -1)
label nPoints() const noexcept
Number of mesh points.
Clamp value to the start/end value.
virtual const labelList & faceNeighbour() const
Return face neighbour.
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Unit conversion functions.
constexpr char nl
The newline '\n' character (0x0a)
List< face > faceList
A List of faces.
bool coupled(solutionDict.getOrDefault("coupledEnergyField", false))
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bool & parRun() noexcept
Test if this a parallel run.
static writeType writeLevel()
Get/set write level.
labelList findIndices(const ListType &input, typename ListType::const_reference val, label start=0)
Linear search to find all occurrences of given element.
interfaceProperties interface(alpha1, U, thermo->transportPropertiesDict())
const cellList & cells() const
static const Enum< faceZoneType > faceZoneTypeNames
static int myProcNo(const label communicator=worldComm)
Number of this process (starting from masterNo() = 0)
set value to -1 any face that was refined
const Time & time() const
Return the top-level database.
static label worldComm
Default world communicator (all processors). May differ from globalComm if local worlds are in use...
label nFaces() const noexcept
Number of mesh faces.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
DynamicID< faceZoneMesh > faceZoneID
Foam::faceZoneID.
UList< label > labelUList
A UList of labels.
static void broadcast(Type &value, const label comm=UPstream::worldComm)
Broadcast content (contiguous or non-contiguous) to all processes in communicator.
static labelPairList findDuplicateFacePairs(const polyMesh &)
Helper routine to find all baffles (two boundary faces.
#define forAll(list, i)
Loop across all elements in list.
static void updateList(const labelList &newToOld, const T &nullValue, List< T > &elems)
Helper: reorder list according to map.
dimensionedScalar pos(const dimensionedScalar &ds)
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator) is 1 for serial run.
Sends/receives parts of mesh+fvfields to neighbouring processors. Used in load balancing.
vectorField pointField
pointField is a vectorField.
static void gatherList(const List< commsStruct > &comms, List< T > &values, const int tag, const label comm)
Gather data, but keep individual values separate. Uses the specified communication schedule...
const dimensionedScalar e
Elementary charge.
void setSize(const label n)
Alias for resize()
FaceMergeType
Enumeration for what to do with co-planar patch faces on a single.
Type gSum(const FieldField< Field, Type > &f)
dimensionedScalar cos(const dimensionedScalar &ds)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
List< edge > edgeList
A List of edges.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
label size() const noexcept
The number of elements in the list.
List< scalar > scalarList
A List of scalars.
wordList patchNames(nPatches)
Base class for writing coordSet(s) and tracks with fields.
static void checkCoupledFaceZones(const polyMesh &)
Helper function: check that face zones are synced.
virtual const labelList & faceOwner() const
Return face owner.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
Smanip< ios_base::fmtflags > setf(const ios_base::fmtflags flags)
const globalMeshData & globalData() const
Return parallel info.
Abstract base class for domain decomposition.
label nInternalFaces() const noexcept
Number of internal faces.
A location inside the volume.
virtual const faceList & faces() const
Return raw faces.
List< labelPair > labelPairList
List of labelPairs.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
static labelList getUnnamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of unnamed surfaces (surfaces without faceZoneName)
const wordList surface
Standard surface field types (scalar, vector, tensor, etc)
Istream and Ostream manipulators taking arguments.
int debug
Static debugging option.
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
defineTypeNameAndDebug(combustionModel, 0)
label nTotalCells() const noexcept
Return total number of cells in decomposed mesh.
double cpuTimeIncrement() const
Return CPU time (in seconds) since last call to cpuTimeIncrement()
static void addFaceZones(meshRefinement &meshRefiner, const refinementParameters &refineParams, const HashTable< Pair< word >> &faceZoneToPatches)
Helper: add faceZones and patches.
dimensioned< typename typeOfMag< Type >::type > sumMag(const DimensionedField< Type, GeoMesh > &df)
static void broadcasts(const label comm, Type &arg1, Args &&... args)
Broadcast multiple items to all processes in communicator.
Helper class which maintains intersections of (changing) mesh with (static) surfaces.
static bool split(const std::string &line, std::string &key, std::string &val)
void doRefine(const dictionary &refineDict, const refinementParameters &refineParams, const snapParameters &snapParams, const bool prepareForSnapping, const meshRefinement::FaceMergeType mergeType, const dictionary &motionDict)
Do all the refinement.
vector point
Point is a vector.
label nCells() const noexcept
Number of mesh cells.
const vectorField & faceAreas() const
const dimensionedScalar c
Speed of light in a vacuum.
static bool master(const label communicator=worldComm)
Am I the master rank.
const polyBoundaryMesh & patches
const cellZoneMesh & cellZones() const noexcept
Return cell zone mesh.
static labelList getNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of named surfaces (surfaces with faceZoneName)
messageStream Info
Information stream (stdout output on master, null elsewhere)
static Vector< label > uniform(const label &s)
Return a VectorSpace with all elements = s.
writeType
Enumeration for what to write. Used as a bit-pattern.
Field< vector > vectorField
Specialisation of Field<T> for vector.
faceZoneType
What to do with faceZone faces.
debugType
Enumeration for what to debug. Used as a bit-pattern.
Vector< label > labelVector
Vector of labels.
Omanip< int > setw(const int i)
List< label > labelList
A List of labels.
T * first()
The first entry in the list.
bool returnReduceOr(const bool value, const label comm=UPstream::worldComm)
Perform logical (or) MPI Allreduce on a copy. Uses UPstream::reduceOr.
constexpr scalar degToRad(const scalar deg) noexcept
Conversion from degrees to radians.
List< bool > boolList
A List of bools.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
List< cell > cellList
A List of cells.
HashTable< word, wordPair, Foam::Hash< wordPair > > wordPairHashTable
HashTable of wordPair.
ZoneMesh< cellZone, polyMesh > cellZoneMesh
A ZoneMesh with the type cellZone.
IOList< label > labelIOList
Label container classes.
forAllConstIters(mixture.phases(), phase)
static void listCombineReduce(List< T > &values, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
After completion all processors have the same data.
static constexpr const zero Zero
Global zero (0)