74 meshRefiner_(meshRefiner),
75 decomposer_(decomposer),
76 distributor_(distributor),
77 globalToMasterPatch_(globalToMasterPatch),
78 globalToSlavePatch_(globalToSlavePatch),
79 setFormatter_(setFormatter),
86Foam::label Foam::snappyRefineDriver::featureEdgeRefine
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
142 meshRefiner_.meshCutter().consistentRefinement
148 Info<<
"Determined cells to refine in = "
153 label nCellsToRefine = cellsToRefine.size();
154 reduce(nCellsToRefine, sumOp<label>());
156 Info<<
"Selected for feature refinement : " << nCellsToRefine
160 if (nCellsToRefine <= minRefine)
162 Info<<
"Stopping refining since too few cells selected."
183 meshRefiner_.balanceAndRefine
185 "feature refinement iteration " +
name(iter),
194 meshRefiner_.refineAndBalance
196 "feature refinement iteration " +
name(iter),
209Foam::label Foam::snappyRefineDriver::smallFeatureRefine
211 const refinementParameters& refineParams,
220 if (refineParams.minRefineCells() == -1)
227 addProfiling(feature,
"snappyHexMesh::refine::smallFeature");
228 const fvMesh&
mesh = meshRefiner_.mesh();
233 labelList surfaceMaxLevel(meshRefiner_.surfaces().maxGapLevel());
234 labelList shellMaxLevel(meshRefiner_.shells().maxGapLevel());
236 if (
max(surfaceMaxLevel) == 0 &&
max(shellMaxLevel) == 0)
241 for (; iter < maxIter; iter++)
244 <<
"Small surface feature refinement iteration " << iter <<
nl
245 <<
"--------------------------------------------" <<
nl
254 meshRefiner_.refineCandidates
256 refineParams.locationsInMesh(),
257 refineParams.curvature(),
258 refineParams.planarAngle(),
269 refineParams.maxGlobalCells(),
270 refineParams.maxLocalCells()
276 meshRefiner_.meshCutter().consistentRefinement
282 Info<<
"Determined cells to refine in = "
286 label nCellsToRefine = cellsToRefine.size();
287 reduce(nCellsToRefine, sumOp<label>());
289 Info<<
"Selected for refinement : " << nCellsToRefine
295 if (nCellsToRefine == 0)
297 Info<<
"Stopping refining since too few cells selected."
313 (
mesh.
nCells() >= refineParams.maxLocalCells()),
318 meshRefiner_.balanceAndRefine
320 "small feature refinement iteration " +
name(iter),
324 refineParams.maxLoadUnbalance()
329 meshRefiner_.refineAndBalance
331 "small feature refinement iteration " +
name(iter),
335 refineParams.maxLoadUnbalance()
343Foam::label Foam::snappyRefineDriver::surfaceOnlyRefine
345 const refinementParameters& refineParams,
347 const label leakBlockageIter
355 if (refineParams.minRefineCells() == -1)
362 addProfiling(surface,
"snappyHexMesh::refine::surface");
363 const fvMesh&
mesh = meshRefiner_.mesh();
364 const refinementSurfaces& surfaces = meshRefiner_.surfaces();
368 label overallMaxLevel =
max(meshRefiner_.surfaces().maxLevel());
371 for (iter = 0; iter < maxIter; iter++)
374 <<
"Surface refinement iteration " << iter <<
nl
375 <<
"------------------------------" <<
nl
380 if (iter >= leakBlockageIter)
392 DynamicList<label> selectedSurfaces(unnamedSurfaces.size());
393 for (
const label surfi : unnamedSurfaces)
395 const label regioni = surfaces.globalRegion(surfi, 0);
400 if (iter > surfaces.leakLevel()[regioni])
402 selectedSurfaces.append(surfi);
408 selectedSurfaces.size()
409 && refineParams.locationsOutsideMesh().size()
412 meshRefiner_.blockLeakFaces
414 globalToMasterPatch_,
416 refineParams.locationsInMesh(),
417 refineParams.zonesInMesh(),
418 refineParams.locationsOutsideMesh(),
432 meshRefiner_.refineCandidates
434 refineParams.locationsInMesh(),
435 refineParams.curvature(),
436 refineParams.planarAngle(),
447 refineParams.maxGlobalCells(),
448 refineParams.maxLocalCells()
453 meshRefiner_.meshCutter().consistentRefinement
459 Info<<
"Determined cells to refine in = "
463 label nCellsToRefine = cellsToRefine.size();
464 reduce(nCellsToRefine, sumOp<label>());
466 Info<<
"Selected for refinement : " << nCellsToRefine
476 iter >= overallMaxLevel
477 && nCellsToRefine <= refineParams.minRefineCells()
481 Info<<
"Stopping refining since too few cells selected."
497 (
mesh.
nCells() >= refineParams.maxLocalCells()),
502 meshRefiner_.balanceAndRefine
504 "surface refinement iteration " +
name(iter),
508 refineParams.maxLoadUnbalance()
513 meshRefiner_.refineAndBalance
515 "surface refinement iteration " +
name(iter),
519 refineParams.maxLoadUnbalance()
527Foam::label Foam::snappyRefineDriver::gapOnlyRefine
529 const refinementParameters& refineParams,
538 if (refineParams.minRefineCells() == -1)
545 const fvMesh&
mesh = meshRefiner_.mesh();
550 label maxIncrement = 0;
551 const labelList& maxLevel = meshRefiner_.surfaces().maxLevel();
552 const labelList& gapLevel = meshRefiner_.surfaces().gapLevel();
556 maxIncrement =
max(maxIncrement, gapLevel[i]-maxLevel[i]);
561 if (maxIncrement == 0)
566 for (iter = 0; iter < maxIter; iter++)
569 <<
"Gap refinement iteration " << iter <<
nl
570 <<
"--------------------------" <<
nl
581 meshRefiner_.refineCandidates
583 refineParams.locationsInMesh(),
584 refineParams.curvature(),
585 refineParams.planarAngle(),
596 refineParams.maxGlobalCells(),
597 refineParams.maxLocalCells()
603 Pout<<
"Writing current mesh to time "
604 << meshRefiner_.timeName() <<
endl;
615 Pout<<
"Dumped mesh in = "
619 Pout<<
"Dumping " << candidateCells.size()
620 <<
" cells to cellSet candidateCellsFromGap." <<
endl;
621 cellSet
c(
mesh,
"candidateCellsFromGap", candidateCells);
622 c.instance() = meshRefiner_.timeName();
631 isCandidateCell[candidateCells[i]] =
true;
634 for (label i=0; i<1; i++)
636 boolList newIsCandidateCell(isCandidateCell);
644 if (isCandidateCell[own] != isCandidateCell[nei])
646 newIsCandidateCell[own] =
true;
647 newIsCandidateCell[nei] =
true;
671 if (isCandidateCell[own] != neiIsCandidateCell[bFacei])
673 newIsCandidateCell[own] =
true;
677 isCandidateCell.transfer(newIsCandidateCell);
681 forAll(isCandidateCell, celli)
683 if (isCandidateCell[celli])
688 candidateCells.setSize(
n);
690 forAll(isCandidateCell, celli)
692 if (isCandidateCell[celli])
694 candidateCells[
n++] = celli;
702 Pout<<
"Dumping " << candidateCells.size()
703 <<
" cells to cellSet candidateCellsFromGapPlusBuffer." <<
endl;
704 cellSet
c(
mesh,
"candidateCellsFromGapPlusBuffer", candidateCells);
705 c.instance() = meshRefiner_.timeName();
712 meshRefiner_.meshCutter().consistentRefinement
718 Info<<
"Determined cells to refine in = "
722 label nCellsToRefine = cellsToRefine.size();
723 reduce(nCellsToRefine, sumOp<label>());
725 Info<<
"Selected for refinement : " << nCellsToRefine
736 && nCellsToRefine <= refineParams.minRefineCells()
740 Info<<
"Stopping refining since too few cells selected."
756 (
mesh.
nCells() >= refineParams.maxLocalCells()),
761 meshRefiner_.balanceAndRefine
763 "gap refinement iteration " +
name(iter),
767 refineParams.maxLoadUnbalance()
772 meshRefiner_.refineAndBalance
774 "gap refinement iteration " +
name(iter),
778 refineParams.maxLoadUnbalance()
786Foam::label Foam::snappyRefineDriver::surfaceProximityBlock
788 const refinementParameters& refineParams,
792 if (refineParams.minRefineCells() == -1)
799 fvMesh&
mesh = meshRefiner_.mesh();
801 if (
min(meshRefiner_.surfaces().blockLevel()) ==
labelMax)
808 for (iter = 0; iter < maxIter; iter++)
811 <<
"Gap blocking iteration " << iter <<
nl
812 <<
"------------------------" <<
nl
819 meshRefiner_.removeGapCells
821 refineParams.planarAngle(),
822 meshRefiner_.surfaces().blockLevel(),
823 globalToMasterPatch_,
824 refineParams.nFilterIter()
830 Pout<<
"Writing gap blocking iteration "
831 << iter <<
" mesh to time " << meshRefiner_.timeName()
849Foam::label Foam::snappyRefineDriver::bigGapOnlyRefine
851 const refinementParameters& refineParams,
852 const bool spreadGapSize,
856 if (refineParams.minRefineCells() == -1)
868 const fvMesh&
mesh = meshRefiner_.mesh();
873 labelList surfaceMaxLevel(meshRefiner_.surfaces().maxGapLevel());
874 labelList shellMaxLevel(meshRefiner_.shells().maxGapLevel());
876 label overallMaxLevel(
max(
max(surfaceMaxLevel),
max(shellMaxLevel)));
878 if (overallMaxLevel == 0)
884 for (; iter < maxIter; iter++)
887 <<
"Big gap refinement iteration " << iter <<
nl
888 <<
"------------------------------" <<
nl
897 meshRefiner_.refineCandidates
899 refineParams.locationsInMesh(),
900 refineParams.curvature(),
901 refineParams.planarAngle(),
912 refineParams.maxGlobalCells(),
913 refineParams.maxLocalCells()
920 Pout<<
"Writing current mesh to time "
921 << meshRefiner_.timeName() <<
endl;
932 Pout<<
"Dumped mesh in = "
935 Pout<<
"Dumping " << candidateCells.size()
936 <<
" cells to cellSet candidateCellsFromBigGap." <<
endl;
937 cellSet
c(
mesh,
"candidateCellsFromBigGap", candidateCells);
938 c.instance() = meshRefiner_.timeName();
944 meshRefiner_.meshCutter().consistentRefinement
950 Info<<
"Determined cells to refine in = "
954 label nCellsToRefine = cellsToRefine.size();
955 reduce(nCellsToRefine, sumOp<label>());
957 Info<<
"Selected for refinement : " << nCellsToRefine
967 iter >= overallMaxLevel
968 && nCellsToRefine <= refineParams.minRefineCells()
972 Info<<
"Stopping refining since too few cells selected."
988 (
mesh.
nCells() >= refineParams.maxLocalCells()),
993 meshRefiner_.balanceAndRefine
995 "big gap refinement iteration " +
name(iter),
999 refineParams.maxLoadUnbalance()
1004 meshRefiner_.refineAndBalance
1006 "big gap refinement iteration " +
name(iter),
1010 refineParams.maxLoadUnbalance()
1018Foam::label Foam::snappyRefineDriver::danglingCellRefine
1020 const refinementParameters& refineParams,
1025 if (refineParams.minRefineCells() == -1)
1037 addProfiling(dangling,
"snappyHexMesh::refine::danglingCell");
1038 const fvMesh&
mesh = meshRefiner_.mesh();
1041 for (iter = 0; iter < maxIter; iter++)
1044 <<
"Dangling coarse cells refinement iteration " << iter <<
nl
1045 <<
"--------------------------------------------" <<
nl
1057 cellSet candidateCellSet(
mesh,
"candidateCells",
cells.
size()/1000);
1061 const cell& cFaces =
cells[celli];
1063 label nIntFaces = 0;
1073 label patchi = pbm.patchID()[bFacei];
1083 candidateCellSet.insert(celli);
1089 Pout<<
"Dumping " << candidateCellSet.size()
1090 <<
" cells to cellSet candidateCellSet." <<
endl;
1091 candidateCellSet.instance() = meshRefiner_.timeName();
1092 candidateCellSet.
write();
1094 candidateCells = candidateCellSet.toc();
1101 meshRefiner_.meshCutter().consistentRefinement
1107 Info<<
"Determined cells to refine in = "
1111 label nCellsToRefine = cellsToRefine.size();
1112 reduce(nCellsToRefine, sumOp<label>());
1114 Info<<
"Selected for refinement : " << nCellsToRefine
1125 && nCellsToRefine <= refineParams.minRefineCells()
1129 Info<<
"Stopping refining since too few cells selected."
1145 (
mesh.
nCells() >= refineParams.maxLocalCells()),
1150 meshRefiner_.balanceAndRefine
1152 "coarse cell refinement iteration " +
name(iter),
1156 refineParams.maxLoadUnbalance()
1161 meshRefiner_.refineAndBalance
1163 "coarse cell refinement iteration " +
name(iter),
1167 refineParams.maxLoadUnbalance()
1177Foam::label Foam::snappyRefineDriver::refinementInterfaceRefine
1179 const refinementParameters& refineParams,
1183 if (refineParams.minRefineCells() == -1)
1196 const fvMesh&
mesh = meshRefiner_.mesh();
1200 if (refineParams.interfaceRefine())
1202 for (;iter < maxIter; iter++)
1205 <<
"Refinement transition refinement iteration " << iter <<
nl
1206 <<
"--------------------------------------------" <<
nl
1209 const labelList& surfaceIndex = meshRefiner_.surfaceIndex();
1210 const hexRef8& cutter = meshRefiner_.meshCutter();
1224 cellSet transitionCells
1233 const cell& cFaces =
cells[celli];
1234 label cLevel = cutter.cellLevel()[celli];
1238 label facei = cFaces[cFacei];
1240 if (surfaceIndex[facei] != -1)
1242 label fLevel = cutter.faceLevel(facei);
1243 if (fLevel != cLevel)
1245 transitionCells.insert(celli);
1252 cellSet candidateCellSet
1373 for (
const label celli : transitionCells)
1375 const cell& cFaces =
cells[celli];
1376 label cLevel = cutter.cellLevel()[celli];
1379 bool foundOpposite =
false;
1383 label facei = cFaces[cFacei];
1387 surfaceIndex[facei] != -1
1388 && cutter.faceLevel(facei) > cLevel
1393 if (faceOwner[facei] != celli)
1401 label face2i = cFaces[cFaceI2];
1406 && surfaceIndex[face2i] != -1
1411 if (faceOwner[face2i] != celli)
1417 if ((
n&n2) < oppositeCos)
1419 foundOpposite =
true;
1435 candidateCellSet.insert(celli);
1441 Pout<<
"Dumping " << candidateCellSet.size()
1442 <<
" cells to cellSet candidateCellSet." <<
endl;
1443 candidateCellSet.instance() = meshRefiner_.timeName();
1444 candidateCellSet.
write();
1446 candidateCells = candidateCellSet.toc();
1453 meshRefiner_.meshCutter().consistentRefinement
1459 Info<<
"Determined cells to refine in = "
1463 label nCellsToRefine = cellsToRefine.size();
1464 reduce(nCellsToRefine, sumOp<label>());
1466 Info<<
"Selected for refinement : " << nCellsToRefine
1477 && nCellsToRefine <= refineParams.minRefineCells()
1481 Info<<
"Stopping refining since too few cells selected."
1497 (
mesh.
nCells() >= refineParams.maxLocalCells()),
1502 meshRefiner_.balanceAndRefine
1504 "interface cell refinement iteration " +
name(iter),
1508 refineParams.maxLoadUnbalance()
1513 meshRefiner_.refineAndBalance
1515 "interface cell refinement iteration " +
name(iter),
1519 refineParams.maxLoadUnbalance()
1527bool Foam::snappyRefineDriver::usesHigherLevel
1534 for (
const label pointi :
f)
1536 if (boundaryPointLevel[pointi] > cLevel)
1545Foam::label Foam::snappyRefineDriver::boundaryRefinementInterfaceRefine
1547 const refinementParameters& refineParams,
1551 if (refineParams.minRefineCells() == -1)
1564 const fvMesh&
mesh = meshRefiner_.mesh();
1568 if (refineParams.interfaceRefine())
1570 for (;iter < maxIter; iter++)
1573 <<
"Boundary refinement iteration " << iter <<
nl
1574 <<
"-------------------------------" <<
nl
1577 const labelList& surfaceIndex = meshRefiner_.surfaceIndex();
1578 const hexRef8& cutter = meshRefiner_.meshCutter();
1579 const labelList& cellLevel = cutter.cellLevel();
1591 forAll(surfaceIndex, facei)
1593 if (surfaceIndex[facei] != -1)
1595 isBoundaryFace.set(facei);
1596 isBoundaryPoint.set(faces[facei]);
1599 const labelList meshPatchIDs(meshRefiner_.meshedPatches());
1600 for (
const label patchi : meshPatchIDs)
1605 isBoundaryFace.set(pp.start()+i);
1606 isBoundaryPoint.set(pp[i]);
1614 orEqOp<unsigned int>(),
1625 const cell& cFaces =
cells[celli];
1626 const label cLevel = cellLevel[celli];
1628 for (
const label facei : cFaces)
1630 if (isBoundaryFace(facei))
1632 const face&
f = faces[facei];
1633 for (
const label pointi :
f)
1635 boundaryPointLevel[pointi] =
1638 boundaryPointLevel[pointi],
1661 cellSet candidateCellSet
1670 const cell& cFaces =
cells[celli];
1671 const label cLevel = cellLevel[celli];
1673 bool isBoundaryCell =
false;
1674 for (
const label facei : cFaces)
1676 if (isBoundaryFace(facei))
1678 isBoundaryCell =
true;
1683 if (!isBoundaryCell)
1685 for (
const label facei : cFaces)
1688 if (usesHigherLevel(boundaryPointLevel,
f, cLevel))
1690 candidateCellSet.insert(celli);
1698 Pout<<
"Dumping " << candidateCellSet.size()
1699 <<
" cells to cellSet candidateCellSet." <<
endl;
1700 candidateCellSet.instance() = meshRefiner_.timeName();
1701 candidateCellSet.
write();
1703 candidateCells = candidateCellSet.toc();
1708 meshRefiner_.meshCutter().consistentRefinement
1714 Info<<
"Determined cells to refine in = "
1718 label nCellsToRefine = cellsToRefine.size();
1719 reduce(nCellsToRefine, sumOp<label>());
1721 Info<<
"Selected for refinement : " << nCellsToRefine
1736 Info<<
"Stopping refining since too few cells selected."
1752 (
mesh.
nCells() >= refineParams.maxLocalCells()),
1757 meshRefiner_.balanceAndRefine
1759 "boundary cell refinement iteration " +
name(iter),
1763 refineParams.maxLoadUnbalance()
1768 meshRefiner_.refineAndBalance
1770 "boundary cell refinement iteration " +
name(iter),
1774 refineParams.maxLoadUnbalance()
1783void Foam::snappyRefineDriver::removeInsideCells
1785 const refinementParameters& refineParams,
1786 const label nBufferLayers
1790 if (meshRefiner_.limitShells().shells().size() == 0 && nBufferLayers == 0)
1801 <<
"Removing mesh beyond surface intersections" <<
nl
1802 <<
"------------------------------------------" <<
nl
1805 const fvMesh&
mesh = meshRefiner_.mesh();
1813 if (meshRefiner_.limitShells().shells().size())
1815 meshRefiner_.removeLimitShells
1819 globalToMasterPatch_,
1820 globalToSlavePatch_,
1821 refineParams.locationsInMesh(),
1822 refineParams.zonesInMesh(),
1823 refineParams.locationsOutsideMesh()
1830 meshRefiner_.splitMesh
1833 refineParams.nErodeCellZone(),
1834 globalToMasterPatch_,
1835 globalToSlavePatch_,
1836 refineParams.locationsInMesh(),
1837 refineParams.zonesInMesh(),
1838 refineParams.locationsOutsideMesh(),
1839 !refineParams.useLeakClosure(),
1847 Pout<<
"Writing subsetted mesh to time "
1848 << meshRefiner_.timeName() <<
endl;
1859 Pout<<
"Dumped mesh in = "
1865Foam::label Foam::snappyRefineDriver::shellRefine
1867 const refinementParameters& refineParams,
1876 if (refineParams.minRefineCells() == -1)
1884 const fvMesh&
mesh = meshRefiner_.mesh();
1887 meshRefiner_.userFaceData().setSize(1);
1891 meshRefiner_.userFaceData()[0].second() = ListOps::createWithValue<label>
1894 meshRefiner_.intersectedFaces(),
1902 label overallMaxShellLevel = meshRefiner_.shells().maxLevel();
1905 for (iter = 0; iter < maxIter; iter++)
1908 <<
"Shell refinement iteration " << iter <<
nl
1909 <<
"----------------------------" <<
nl
1914 meshRefiner_.refineCandidates
1916 refineParams.locationsInMesh(),
1917 refineParams.curvature(),
1918 refineParams.planarAngle(),
1929 refineParams.maxGlobalCells(),
1930 refineParams.maxLocalCells()
1936 Pout<<
"Dumping " << candidateCells.size()
1937 <<
" cells to cellSet candidateCellsFromShells." <<
endl;
1939 cellSet
c(
mesh,
"candidateCellsFromShells", candidateCells);
1940 c.instance() = meshRefiner_.timeName();
1953 findIndices(meshRefiner_.userFaceData()[0].second(), 0)
1961 if (refineParams.nBufferLayers() <= 2)
1963 cellsToRefine = meshRefiner_.meshCutter().consistentSlowRefinement
1965 refineParams.nBufferLayers(),
1969 meshRefiner_.intersectedPoints()
1974 cellsToRefine = meshRefiner_.meshCutter().consistentSlowRefinement2
1976 refineParams.nBufferLayers(),
1982 Info<<
"Determined cells to refine in = "
1986 label nCellsToRefine = cellsToRefine.size();
1987 reduce(nCellsToRefine, sumOp<label>());
1989 Info<<
"Selected for internal refinement : " << nCellsToRefine
1999 iter >= overallMaxShellLevel
2000 && nCellsToRefine <= refineParams.minRefineCells()
2004 Info<<
"Stopping refining since too few cells selected."
2019 (
mesh.
nCells() >= refineParams.maxLocalCells()),
2024 meshRefiner_.balanceAndRefine
2026 "shell refinement iteration " +
name(iter),
2030 refineParams.maxLoadUnbalance()
2035 meshRefiner_.refineAndBalance
2037 "shell refinement iteration " +
name(iter),
2041 refineParams.maxLoadUnbalance()
2045 meshRefiner_.userFaceData().clear();
2051Foam::label Foam::snappyRefineDriver::directionalShellRefine
2053 const refinementParameters& refineParams,
2062 addProfiling(shell,
"snappyHexMesh::refine::directionalShell");
2063 const fvMesh&
mesh = meshRefiner_.mesh();
2064 const shellSurfaces& shells = meshRefiner_.shells();
2067 const_cast<labelIOList&
>(meshRefiner_.meshCutter().cellLevel());
2069 const_cast<labelIOList&
>(meshRefiner_.meshCutter().pointLevel());
2074 const labelPairList dirSelect(shells.directionalSelectLevel());
2077 forAll(dirSelect, shelli)
2079 overallMinLevel =
min(dirSelect[shelli].first(), overallMinLevel);
2080 overallMaxLevel =
max(dirSelect[shelli].second(), overallMaxLevel);
2083 if (overallMinLevel > overallMaxLevel)
2089 List<labelVector> dirCellLevel(cellLevel.size());
2092 dirCellLevel[celli] = labelVector::uniform(cellLevel[celli]);
2096 for (iter = 0; iter < maxIter; iter++)
2099 <<
"Directional shell refinement iteration " << iter <<
nl
2100 <<
"----------------------------------------" <<
nl
2103 label nAllRefine = 0;
2114 labelList currentLevel(dirCellLevel.size());
2115 forAll(dirCellLevel, celli)
2117 currentLevel[celli] = dirCellLevel[celli][dir];
2122 meshRefiner_.directionalRefineCandidates
2124 refineParams.maxGlobalCells(),
2125 refineParams.maxLocalCells(),
2134 meshRefiner_.meshCutter().consistentRefinement
2142 Info<<
"Determined cells to refine in = "
2145 label nCellsToRefine = cellsToRefine.size();
2146 reduce(nCellsToRefine, sumOp<label>());
2149 <<
" refinement : " << nCellsToRefine
2153 nAllRefine += nCellsToRefine;
2157 if (nCellsToRefine > 0)
2164 const bitSet isRefineCell(
mesh.
nCells(), cellsToRefine);
2166 autoPtr<mapPolyMesh> map
2168 meshRefiner_.directionalRefine
2170 "directional refinement iteration " +
name(iter),
2176 Info<<
"Refined mesh in = "
2197 forAll(map().cellMap(), celli)
2199 if (isRefineCell[map().cellMap()[celli]])
2201 dirCellLevel[celli][dir]++;
2207 forAll(map().pointMap(), pointi)
2209 label oldPointi = map().pointMap()[pointi];
2210 if (map().reversePointMap()[oldPointi] != pointi)
2213 pointLevel[pointi]++;
2220 if (nAllRefine == 0)
2222 Info<<
"Stopping refining since no cells selected."
2227 meshRefiner_.printMeshInfo
2230 "After directional refinement iteration " +
name(iter)
2235 Pout<<
"Writing directional refinement iteration "
2236 << iter <<
" mesh to time " << meshRefiner_.timeName() <<
endl;
2258 cellLevel[celli] =
cmptMax(dirCellLevel[celli]);
2265void Foam::snappyRefineDriver::mergeAndSmoothRatio
2268 const label nSmoothExpansion,
2269 List<Tuple2<scalar, scalar>>& keyAndValue
2274 SortableList<scalar> unmergedDist(allSeedPointDist);
2275 DynamicList<scalar> mergedDist;
2277 scalar prevDist = GREAT;
2280 scalar curDist = unmergedDist[i];
2281 scalar difference =
mag(curDist - prevDist);
2282 if (difference > meshRefiner_.mergeDistance())
2285 mergedDist.append(curDist);
2291 SortableList<scalar> sortedDist(mergedDist);
2292 labelList indexSet = sortedDist.indices();
2295 scalarList seedPointsNewLocation = sortedDist;
2297 scalar initResidual = 0.0;
2298 scalar prevIterResidual = GREAT;
2300 for (label iter = 0; iter < nSmoothExpansion; iter++)
2314 for(label i = 2; i<mergedDist.size()-1; i++)
2316 scalar oldX00 = sortedDist[i-2];
2317 scalar oldX1 = sortedDist[i+1];
2318 scalar curX0 = seedPointsNewLocation[i-1];
2319 seedPointsNewLocation[i] = curX0 + (oldX1 - oldX00)/3;
2322 const scalarField residual(seedPointsNewLocation-sortedDist);
2324 scalar res(
sumMag(residual));
2330 res /= initResidual;
2332 if (
mag(prevIterResidual - res) < SMALL)
2336 Pout<<
"Converged with iteration " << iter
2337 <<
" initResidual: " << initResidual
2338 <<
" final residual : " << res <<
endl;
2344 prevIterResidual = res;
2349 sortedDist = seedPointsNewLocation;
2353 keyAndValue.setSize(mergedDist.size());
2357 keyAndValue[i].first() = mergedDist[i];
2358 label index = indexSet[i];
2359 keyAndValue[i].second() = seedPointsNewLocation[index];
2364Foam::label Foam::snappyRefineDriver::directionalSmooth
2366 const refinementParameters& refineParams
2371 <<
"Directional expansion ratio smoothing" <<
nl
2372 <<
"-------------------------------------" <<
nl
2375 fvMesh& baseMesh = meshRefiner_.mesh();
2376 const searchableSurfaces& geometry = meshRefiner_.surfaces().geometry();
2377 const shellSurfaces& shells = meshRefiner_.shells();
2381 forAll(shells.nSmoothExpansion(), shellI)
2385 shells.nSmoothExpansion()[shellI] > 0
2386 || shells.nSmoothPosition()[shellI] > 0
2389 label surfi = shells.shells()[shellI];
2390 const vector& userDirection = shells.smoothDirection()[shellI];
2397 List<volumeType> volType;
2398 geometry[surfi].getVolumeType(baseMesh.points(), volType);
2430 bitSet isXEdge(baseMesh.edges().size());
2432 const edgeList& edges = baseMesh.edges();
2435 const edge&
e = edges[edgei];
2436 vector eVec(
e.vec(baseMesh.points()));
2438 if (
mag(eVec&userDirection) > 0.9)
2447 const scalar totalLength =
2448 geometry[surfi].bounds().span()
2450 const scalar startPosition =
2451 geometry[surfi].bounds().min()
2458 normalizedPosition[i] =
2460 ((baseMesh.points()[pointi]&userDirection) - startPosition)
2468 DynamicList<scalar> seedPointDist;
2471 scalar prevDist = GREAT;
2474 label pointi = order[i];
2475 scalar curDist = normalizedPosition[pointi];
2476 if (
mag(curDist - prevDist) > meshRefiner_.mergeDistance())
2478 seedPointDist.append(curDist);
2492 ListListOps::combine<scalarList>
2494 gatheredDist, accessOp<scalarList>()
2499 bitSet isFrozenPoint(baseMesh.nPoints(),
true);
2502 scalar minSeed =
min(allSeedPointDist);
2503 scalar maxSeed =
max(allSeedPointDist);
2506 forAll(normalizedPosition, posI)
2508 const scalar
pos = normalizedPosition[posI];
2511 (
mag(
pos-minSeed) < meshRefiner_.mergeDistance())
2512 || (
mag(
pos-maxSeed) < meshRefiner_.mergeDistance())
2526 Info<<
"Smoothing " << geometry[surfi].name() <<
':' <<
nl
2527 <<
" Direction : " << userDirection <<
nl
2528 <<
" Number of points : "
2530 <<
" (out of " << baseMesh.globalData().nTotalPoints()
2532 <<
" Smooth expansion iterations : "
2533 << shells.nSmoothExpansion()[shellI] <<
nl
2534 <<
" Smooth position iterations : "
2535 << shells.nSmoothPosition()[shellI] <<
nl
2536 <<
" Number of planes : "
2537 << allSeedPointDist.size()
2541 List<Tuple2<scalar, scalar>> keyAndValue(allSeedPointDist.size());
2550 shells.nSmoothExpansion()[shellI],
2560 const interpolationTable<scalar> table
2572 const point& curPoint = baseMesh.points()[pointi];
2573 scalar curDist = normalizedPosition[i];
2574 scalar newDist = table(curDist);
2575 scalar newPosition = startPosition + newDist*totalLength;
2576 baseNewPoints[pointi] +=
2577 userDirection * (newPosition - (curPoint &userDirection));
2581 vectorField disp(baseNewPoints-baseMesh.points());
2586 maxMagSqrEqOp<vector>(),
2589 baseMesh.movePoints(baseMesh.points()+disp);
2592 baseMesh.moving(
false);
2596 const_cast<Time&
>(baseMesh.time())++;
2598 Pout<<
"Writing directional expansion ratio smoothed"
2599 <<
" mesh to time " << meshRefiner_.timeName() <<
endl;
2609 baseMesh.time().path()/meshRefiner_.timeName()
2616 pointField baseMeshPoints(baseMesh.points());
2617 scalar initResidual = 0.0;
2618 scalar prevIterResidual = GREAT;
2619 for (iter = 0; iter < shells.nSmoothPosition()[shellI]; iter++)
2622 const edgeList& edges = baseMesh.edges();
2632 const edge&
e = edges[edgei];
2634 (unsmoothedPoints[
e[1]]&userDirection);
2637 (unsmoothedPoints[
e[0]]&userDirection);
2658 if (nSumXEdges[pointi] < 2)
2662 const labelList& pEdges = pointEdges[pointi];
2665 label edgei = pEdges[pE];
2668 const edge&
e = edges[edgei];
2669 label otherPt =
e.otherVertex(pointi);
2670 nSumOther[pointi]--;
2673 unsmoothedPoints[otherPt]
2700 if ((nSumOther[pointi] >= 2) && !isFrozenPoint[pointi])
2705 (unsmoothedPoints[pointi]&userDirection)
2706 +sumOther[pointi]/nSumOther[pointi]
2709 vector& v = baseNewPoints[pointi];
2710 v += (smoothPos-(v&userDirection))*userDirection;
2714 const vectorField residual(baseNewPoints - baseMeshPoints);
2716 scalar res(
gSum(
mag(residual)));
2722 res /= initResidual;
2724 if (
mag(prevIterResidual - res) < SMALL)
2726 Info<<
"Converged smoothing in iteration " << iter
2727 <<
" initResidual: " << initResidual
2728 <<
" final residual : " << res <<
endl;
2733 prevIterResidual = res;
2738 baseMeshPoints = baseNewPoints;
2743 vectorField dispSmooth(baseMeshPoints-baseMesh.points());
2748 maxMagSqrEqOp<vector>(),
2751 baseMesh.movePoints(baseMesh.points()+dispSmooth);
2754 baseMesh.moving(
false);
2758 const_cast<Time&
>(baseMesh.time())++;
2760 Pout<<
"Writing positional smoothing iteration "
2761 << iter <<
" mesh to time " << meshRefiner_.timeName()
2771 baseMesh.time().path()/meshRefiner_.timeName()
2780void Foam::snappyRefineDriver::baffleAndSplitMesh
2782 const refinementParameters& refineParams,
2783 const snapParameters& snapParams,
2784 const bool handleSnapProblems,
2785 const dictionary& motionDict
2795 <<
"Splitting mesh at surface intersections" <<
nl
2796 <<
"---------------------------------------" <<
nl
2799 const fvMesh&
mesh = meshRefiner_.mesh();
2809 meshRefiner_.baffleAndSplitMesh
2815 refineParams.useTopologicalSnapDetection(),
2818 refineParams.nErodeCellZone(),
2822 globalToMasterPatch_,
2823 globalToSlavePatch_,
2824 refineParams.locationsInMesh(),
2825 refineParams.zonesInMesh(),
2826 refineParams.locationsOutsideMesh(),
2827 !refineParams.useLeakClosure(),
2832 if (!handleSnapProblems)
2834 meshRefiner_.mergeFreeStandingBaffles
2837 refineParams.useTopologicalSnapDetection(),
2840 refineParams.planarAngle(),
2843 globalToMasterPatch_,
2844 globalToSlavePatch_,
2845 refineParams.locationsInMesh(),
2846 refineParams.locationsOutsideMesh()
2852void Foam::snappyRefineDriver::zonify
2854 const refinementParameters& refineParams,
2869 namedSurfaces.size()
2870 || refineParams.zonesInMesh().size()
2874 <<
"Introducing zones for interfaces" <<
nl
2875 <<
"--------------------------------" <<
nl
2878 const fvMesh&
mesh = meshRefiner_.mesh();
2887 refineParams.allowFreeStandingZoneFaces(),
2888 refineParams.nErodeCellZone(),
2889 refineParams.locationsInMesh(),
2890 refineParams.zonesInMesh(),
2891 refineParams.locationsOutsideMesh(),
2892 !refineParams.useLeakClosure(),
2899 Pout<<
"Writing zoned mesh to time "
2900 << meshRefiner_.timeName() <<
endl;
2914 meshRefinement::checkCoupledFaceZones(
mesh);
2919void Foam::snappyRefineDriver::splitAndMergeBaffles
2921 const refinementParameters& refineParams,
2922 const snapParameters& snapParams,
2923 const bool handleSnapProblems,
2924 const dictionary& motionDict
2933 <<
"Handling cells with snap problems" <<
nl
2934 <<
"---------------------------------" <<
nl
2937 const fvMesh&
mesh = meshRefiner_.mesh();
2945 const scalarField& perpAngle = meshRefiner_.surfaces().perpendicularAngle();
2947 meshRefiner_.baffleAndSplitMesh
2953 refineParams.useTopologicalSnapDetection(),
2956 refineParams.nErodeCellZone(),
2960 globalToMasterPatch_,
2961 globalToSlavePatch_,
2962 refineParams.locationsInMesh(),
2963 refineParams.zonesInMesh(),
2964 refineParams.locationsOutsideMesh(),
2965 !refineParams.useLeakClosure(),
2970 meshRefiner_.mergeFreeStandingBaffles
2973 refineParams.useTopologicalSnapDetection(),
2976 refineParams.planarAngle(),
2979 globalToMasterPatch_,
2980 globalToSlavePatch_,
2981 refineParams.locationsInMesh(),
2982 refineParams.locationsOutsideMesh()
2992 meshRefiner_.dupNonManifoldPoints();
2998 label nCouples =
returnReduce(couples.size(), sumOp<label>());
3000 Info<<
"Detected unsplittable baffles : " << nCouples <<
endl;
3007 meshRefiner_.mergeBaffles(couples, Map<label>(0));
3012 meshRefiner_.checkData();
3016 meshRefiner_.splitMeshRegions
3018 globalToMasterPatch_,
3019 globalToSlavePatch_,
3020 refineParams.locationsInMesh(),
3021 refineParams.locationsOutsideMesh(),
3029 meshRefiner_.checkData();
3032 Info<<
"Merged free-standing baffles in = "
3038 Pout<<
"Writing handleProblemCells mesh to time "
3039 << meshRefiner_.timeName() <<
endl;
3061 if (faceZoneToPatches.size())
3064 <<
"Adding patches for face zones" <<
nl
3065 <<
"-----------------------------" <<
nl
3069 <<
setw(6) <<
"Patch"
3070 <<
setw(20) <<
"Type"
3071 <<
setw(30) <<
"Name"
3072 <<
setw(30) <<
"FaceZone"
3073 <<
setw(10) <<
"FaceType"
3075 <<
setw(6) <<
"-----"
3076 <<
setw(20) <<
"----"
3077 <<
setw(30) <<
"----"
3078 <<
setw(30) <<
"--------"
3079 <<
setw(10) <<
"--------"
3087 const word& fzName = iter.key();
3094 const word& masterName = fzName;
3104 <<
setw(30) << masterName
3105 <<
setw(30) << fzName
3115 <<
setw(30) << slaveName
3116 <<
setw(30) << fzName
3120 meshRefiner.
addFaceZone(fzName, masterName, slaveName, fzType);
3128void Foam::snappyRefineDriver::mergePatchFaces
3142 <<
"Merge refined boundary faces" <<
nl
3143 <<
"----------------------------" <<
nl
3146 const fvMesh&
mesh = meshRefiner_.mesh();
3154 meshRefiner_.mergePatchFacesUndo
3158 meshRefiner_.meshedPatches(),
3167 meshRefiner_.mergePatchFaces
3172 meshRefiner_.meshedPatches(),
3179 meshRefiner_.checkData();
3186 meshRefiner_.checkData();
3191void Foam::snappyRefineDriver::deleteSmallRegions
3193 const refinementParameters& refineParams
3196 const fvMesh&
mesh = meshRefiner_.mesh();
3224 meshRefiner_.selectSeparatedCoupledFaces(isBlockedFace);
3228 if (ownPatch[facei] != -1)
3230 isBlockedFace[facei] =
true;
3237 for (
const auto& cz : czm)
3239 UIndirectList<label>(cellToZone, cz) = cz.index();
3243 const regionSplit cellRegion(
mesh, isBlockedFace);
3246 labelList nCellsPerRegion(cellRegion.nRegions(), 0);
3247 labelList regionToZone(cellRegion.nRegions(), -2);
3249 forAll(cellRegion, celli)
3251 const label regioni = cellRegion[celli];
3252 const label zonei = cellToZone[celli];
3255 regionToZone[regioni] = zonei;
3257 nCellsPerRegion[regioni]++;
3268 forAll(nCellsPerRegion, regioni)
3270 const label zonei = regionToZone[regioni];
3271 label& nRegionCells = nCellsPerRegion[regioni];
3275 nRegionCells < refineParams.minCellFraction()*
nCellsPerZone[zonei]
3276 || nRegionCells < refineParams.nMinCells()
3279 Info<<
"Deleting region " << regioni
3280 <<
" (size " << nRegionCells
3290 DynamicList<label> cellsToRemove(
mesh.
nCells()/128);
3291 forAll(cellRegion, celli)
3293 if (nCellsPerRegion[cellRegion[celli]] == 0)
3295 cellsToRemove.append(celli);
3300 cellsToRemove.size(),
3303 if (nTotCellsToRemove > 0)
3305 Info<<
"Deleting " << nTotCellsToRemove
3306 <<
" cells in small regions" <<
endl;
3308 removeCells cellRemover(
mesh);
3310 cellsToRemove.shrink();
3313 cellRemover.getExposedFaces(cellsToRemove)
3317 UIndirectList<label>(ownPatch, exposedFaces)
3319 (void)meshRefiner_.doRemoveCells
3335 const bool prepareForSnapping,
3342 <<
"Refinement phase" <<
nl
3343 <<
"----------------" <<
nl
3364 globalToMasterPatch_,
3367 voxelDriver.
doRefine(refineParams);
3383 max(meshRefiner_.surfaces().maxGapLevel()) > 0
3384 ||
max(meshRefiner_.shells().maxGapLevel()) > 0
3424 surfaceProximityBlock
3475 refinementInterfaceRefine
3482 directionalShellRefine
3497 meshRefiner_.surfaces().surfZones()
3500 if (unnamedSurfaces.
size())
3502 meshRefiner_.blockLeakFaces
3504 globalToMasterPatch_,
3505 globalToSlavePatch_,
3516 max(meshRefiner_.shells().nSmoothExpansion()) > 0
3517 ||
max(meshRefiner_.shells().nSmoothPosition()) > 0
3520 directionalSmooth(refineParams);
3548 zonify(refineParams, zonesToFaceZone);
3562 const word& fzName = zonesToFaceZone[czNames];
3564 const word& masterName = fzName;
3569 addFaceZones(meshRefiner_, refineParams, faceZoneToPatches);
3573 splitAndMergeBaffles
3582 if (prepareForSnapping)
3584 mergePatchFaces(mergeType, refineParams, motionDict);
3595 deleteSmallRegions(refineParams);
3602 <<
"Doing final balancing" <<
nl
3603 <<
"---------------------" <<
nl
3609 meshRefiner_.balance
Istream and Ostream manipulators taking arguments.
static bool split(const std::string &line, std::string &key, std::string &val)
T & first() noexcept
The first element of the list, position [0].
A HashTable similar to std::unordered_map.
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
label size() const noexcept
The number of elements in table.
void setSize(const label n)
Alias for resize()
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
An ordered pair of two objects of type <T> with first() and second() elements.
const T & second() const noexcept
Return second element, which is also the last element.
label nProcs() const noexcept
Number of ranks associated with PstreamBuffers.
static void listCombineAllGather(const List< commsStruct > &comms, List< T > &values, const CombineOp &cop, const int tag, const label comm)
After completion all processors have the same data.
static void gatherList(const List< commsStruct > &comms, List< T > &values, const int tag, const label comm)
static void broadcast(Type &value, const label comm=UPstream::worldComm)
static void broadcasts(const label comm, Type &arg1, Args &&... args)
Broadcast multiple items to all processes in communicator.
fileName path() const
Return path.
T * first()
The first entry in the list.
void size(const label n)
Older name for setAddressableSize.
static label worldComm
Default communicator (all processors)
static bool & parRun() noexcept
Test if this a parallel run.
label size() const noexcept
The number of elements in the list.
Base class for writing coordSet(s) and tracks with fields.
double cpuTimeIncrement() const
Return CPU time (in seconds) since last call to cpuTimeIncrement()
Abstract base class for domain decomposition.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Sends/receives parts of mesh+fvfields to neighbouring processors. Used in load balancing.
Mesh data needed to do the Finite Volume discretisation.
const Time & time() const
Return the top-level database.
label nTotalCells() const noexcept
Return total number of cells in decomposed mesh.
static labelPairList findDuplicateFacePairs(const polyMesh &)
Helper routine to find all baffles (two boundary faces.
Helper class which maintains intersections of (changing) mesh with (static) surfaces.
label addFaceZone(const word &fzName, const word &masterPatch, const word &slavePatch, const surfaceZonesInfo::faceZoneType &fzType)
Add/lookup faceZone and update information. Return index of.
writeType
Enumeration for what to write. Used as a bit-pattern.
@ REMOVE
set value to -1 any face that was refined
debugType
Enumeration for what to debug. Used as a bit-pattern.
label addMeshedPatch(const word &name, const dictionary &)
Add patch originating from meshing. Update meshedPatches_.
const fvMesh & mesh() const
Reference to mesh.
FaceMergeType
Enumeration for what to do with co-planar patch faces on a single.
static void updateList(const labelList &newToOld, const T &nullValue, List< T > &elems)
Helper: reorder list according to map.
static writeType writeLevel()
Get/set write level.
static const char *const componentNames[]
static constexpr direction nComponents
Number of components in bool is 1.
Mesh consisting of general polyhedral cells.
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
virtual const faceList & faces() const
Return raw faces.
virtual const labelList & faceOwner() const
Return face owner.
const globalMeshData & globalData() const
Return parallel info.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
const cellZoneMesh & cellZones() const noexcept
Return cell zone mesh.
virtual const labelList & faceNeighbour() const
Return face neighbour.
label nInternalFaces() const noexcept
Number of internal faces.
label nPoints() const noexcept
Number of mesh points.
label nCells() const noexcept
Number of mesh cells.
label nFaces() const noexcept
Number of mesh faces.
const vectorField & faceAreas() const
const cellList & cells() const
int myProcNo() const noexcept
Return processor number.
Simple container to keep together refinement specific information.
scalar planarAngle() const
Angle when two intersections are considered to be planar.
label maxLocalCells() const
Per processor max number of cells.
scalar curvature() const
Curvature.
scalar minCellFraction() const
When are disconnected regions small. Fraction of overall size.
label minRefineCells() const
When to stop refining.
label nMinCells() const
When are disconnected regions small. Absolute number of cells.
const pointField & locationsOutsideMesh() const
Optional points which are checked to be outside the mesh.
static labelList findCells(const bool checkInsideMesh, const polyMesh &, const pointField &locations)
Checks that cells are in mesh. Returns cells (or -1) they.
const pointField & locationsInMesh() const
Areas to keep.
dictionary getZoneInfo(const word &fzName, surfaceZonesInfo::faceZoneType &faceType) const
Get patchInfo and faceType for faceZone.
scalar maxLoadUnbalance() const
Allowed load unbalance.
label maxGlobalCells() const
Total number of cells.
const wordList & zonesInMesh() const
Per area the zone name.
Simple container to keep together snap specific information.
static void addFaceZones(meshRefinement &meshRefiner, const refinementParameters &refineParams, const HashTable< Pair< word > > &faceZoneToPatches)
Helper: add faceZones and patches.
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.
Equivalent of snappyRefineDriver but operating on a voxel mesh.
void doRefine(const refinementParameters &refineParams)
splitCell * master() const
static labelList getUnnamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of unnamed surfaces (surfaces without faceZoneName)
faceZoneType
What to do with faceZone faces.
static const Enum< faceZoneType > faceZoneTypeNames
static labelList getNamedSurfaces(const PtrList< surfaceZonesInfo > &surfList)
Get indices of named surfaces (surfaces with faceZoneName)
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
@ INSIDE
A location inside the volume.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
const polyBoundaryMesh & patches
bool coupled(solutionDict.getOrDefault("coupledEnergyField", false))
const labelList nFaces(UPstream::listGatherValues< label >(aMesh.nFaces()))
const labelIOList & zoneIDs
labelList nCellsPerZone(nZones, Zero)
@ CLAMP
Clamp value to the start/end value.
const dimensionedScalar c
Speed of light in a vacuum.
dimensionedScalar pos(const dimensionedScalar &ds)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Smanip< ios_base::fmtflags > setf(const ios_base::fmtflags flags)
List< labelPair > labelPairList
List of labelPairs.
Type gSum(const FieldField< Field, Type > &f)
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
List< label > labelList
A List of labels.
ZoneMesh< cellZone, polyMesh > cellZoneMesh
A ZoneMesh with the type cellZone.
List< cell > cellList
A List of cells.
Vector< label > labelVector
Vector of labels.
messageStream Info
Information stream (stdout output on master, null elsewhere)
vectorField pointField
pointField is a vectorField.
List< scalar > scalarList
A List of scalars.
vector point
Point is a vector.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
HashTable< word, wordPair, Foam::Hash< wordPair > > wordPairHashTable
HashTable of wordPair.
Omanip< int > setw(const int i)
dimensioned< typename typeOfMag< Type >::type > sumMag(const DimensionedField< Type, GeoMesh > &df)
Ostream & endl(Ostream &os)
Add newline and flush stream.
constexpr scalar degToRad() noexcept
Multiplication factor for degrees to radians conversion.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
List< labelList > labelListList
A List of labelList.
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
IOList< label > labelIOList
Label container classes.
Field< vector > vectorField
Specialisation of Field<T> for vector.
List< bool > boolList
A List of bools.
void cmptMax(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
static constexpr const zero Zero
Global zero (0)
List< edge > edgeList
A List of edges.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
List< face > faceList
A List of faces.
labelList findIndices(const ListType &input, typename ListType::const_reference val, label start=0)
Linear search to find all occurrences of given element.
UList< label > labelUList
A UList of labels.
DynamicID< faceZoneMesh > faceZoneID
Foam::faceZoneID.
dimensionedScalar cos(const dimensionedScalar &ds)
constexpr char nl
The newline '\n' character (0x0a)
#define addProfiling(name, descr)
Define profiling trigger with specified name and description string.
wordList patchNames(nPatches)
labelList pointLabels(nPoints, -1)
interfaceProperties interface(alpha1, U, thermo->transportPropertiesDict())
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIters(container, iter)
Iterate across all elements of the container object with const access.
Unit conversion functions.