Go to the documentation of this file.
83 { debugType::MESH,
"mesh" },
84 { debugType::OBJINTERSECTIONS,
"intersections" },
85 { debugType::FEATURESEEDS,
"featureSeeds" },
86 { debugType::ATTRACTION,
"attraction" },
87 { debugType::LAYERINFO,
"layerInfo" },
107 { writeType::WRITEMESH,
"mesh" },
108 { writeType::NOWRITEREFINEMENT,
"noRefinement" },
109 { writeType::WRITELEVELS,
"scalarLevels" },
110 { writeType::WRITELAYERSETS,
"layerSets" },
111 { writeType::WRITELAYERFIELDS,
"layerFields" },
132 void Foam::meshRefinement::calcNeighbourData
139 const pointField& cellCentres = mesh_.cellCentres();
141 const label nBoundaryFaces = mesh_.nBoundaryFaces();
143 if (neiLevel.size() != nBoundaryFaces || neiCc.size() != nBoundaryFaces)
146 << nBoundaryFaces <<
" neiLevel:" << neiLevel.size()
150 const polyBoundaryMesh&
patches = mesh_.boundaryMesh();
156 const polyPatch& pp =
patches[patchi];
162 label bFacei = pp.start()-mesh_.nInternalFaces();
168 neiLevel[bFacei] = cellLevel[faceCells[i]];
169 neiCc[bFacei] = cellCentres[faceCells[i]];
173 else if (addedPatchIDSet.found(patchi))
185 label own = faceCells[i];
186 label ownLevel = cellLevel[own];
192 faceLevel = ownLevel;
196 scalar d = ((faceCentres[i] - cellCentres[own]) & fn);
197 if (faceLevel > ownLevel)
202 neiLevel[bFacei] = faceLevel;
204 neiCc[bFacei] = faceCentres[i] + d*fn;
212 neiLevel[bFacei] = cellLevel[faceCells[i]];
213 neiCc[bFacei] = faceCentres[i];
225 void Foam::meshRefinement::calcCellCellRays
235 const labelList& cellLevel = meshCutter_.cellLevel();
236 const pointField& cellCentres = mesh_.cellCentres();
238 start.setSize(testFaces.size());
239 end.setSize(testFaces.size());
240 minLevel.setSize(testFaces.size());
244 const label facei = testFaces[i];
245 const label own = mesh_.faceOwner()[facei];
247 if (mesh_.isInternalFace(facei))
249 const label nei = mesh_.faceNeighbour()[facei];
251 start[i] = cellCentres[own];
252 end[i] = cellCentres[nei];
253 minLevel[i] =
min(cellLevel[own], cellLevel[nei]);
257 const label bFacei = facei - mesh_.nInternalFaces();
259 start[i] = cellCentres[own];
260 end[i] = neiCc[bFacei];
261 minLevel[i] =
min(cellLevel[own], neiLevel[bFacei]);
283 label nChangedFaces = 0;
286 if (isMasterFace.
test(changedFaces[i]))
295 Info<<
"Edge intersection testing:" <<
nl
296 <<
" Number of edges : " << nMasterFaces <<
nl
297 <<
" Number of edges to retest : " << nChangedFaces
304 labelList neiLevel(mesh_.nBoundaryFaces());
306 calcNeighbourData(neiLevel, neiCc);
329 surfaces_.findHigherIntersection
343 surfaceIndex_[changedFaces[i]] = surfaceHit[i];
350 label nHits = countHits();
356 Info<<
" Number of intersected edges : " << nTotHits <<
endl;
360 setInstance(mesh_.facesInstance());
376 if (adaptPatchIDs.size())
378 nearestAdaptPatch.
setSize(mesh_.nFaces(), adaptPatchIDs[0]);
390 List<topoDistanceData> cellData(mesh_.nCells());
391 List<topoDistanceData> faceData(mesh_.nFaces());
395 List<topoDistanceData> patchData(nFaces);
399 label patchi = adaptPatchIDs[i];
400 const polyPatch& pp =
patches[patchi];
404 patchFaces[nFaces] = pp.start()+i;
405 patchData[nFaces] = topoDistanceData(patchi, 0);
411 FaceCellWave<topoDistanceData> deltaCalc
418 mesh_.globalData().nTotalCells()+1
423 bool haveWarned =
false;
426 if (!faceData[facei].valid(deltaCalc.data()))
431 <<
"Did not visit some faces, e.g. face " << facei
432 <<
" at " << mesh_.faceCentres()[facei] <<
endl
433 <<
"Assigning these faces to patch "
441 nearestAdaptPatch[facei] = faceData[facei].data();
448 nearestAdaptPatch.
setSize(mesh_.nFaces(), 0);
451 return nearestAdaptPatch;
458 const label defaultRegion
467 labelList neiLevel(mesh_.nFaces()-mesh_.nInternalFaces());
468 pointField neiCc(mesh_.nFaces()-mesh_.nInternalFaces());
469 calcNeighbourData(neiLevel, neiCc);
475 const labelList testFaces(intersectedFaces());
493 List<pointIndexHit> hit1;
496 List<pointIndexHit> hit2;
498 surfaces_.findNearestIntersection
512 labelList nearestRegion(mesh_.nFaces(), defaultRegion);
515 List<topoDistanceData> cellData(mesh_.nCells());
516 List<topoDistanceData> faceData(mesh_.nFaces());
519 DynamicList<label> patchFaces(
start.size());
520 DynamicList<topoDistanceData> patchData(
start.size());
523 label facei = testFaces[i];
524 if (surface1[i] != -1)
526 patchFaces.append(facei);
527 label regioni = surfaces_.globalRegion(surface1[i], region1[i]);
528 patchData.append(topoDistanceData(regioni, 0));
530 else if (surface2[i] != -1)
532 patchFaces.append(facei);
533 label regioni = surfaces_.globalRegion(surface2[i], region2[i]);
534 patchData.append(topoDistanceData(regioni, 0));
539 FaceCellWave<topoDistanceData> deltaCalc
546 mesh_.globalData().nTotalCells()+1
551 bool haveWarned =
false;
554 if (!faceData[facei].valid(deltaCalc.data()))
559 <<
"Did not visit some faces, e.g. face " << facei
560 <<
" at " << mesh_.faceCentres()[facei] <<
endl
561 <<
"Assigning these faces to global region "
562 << defaultRegion <<
endl;
568 nearestRegion[facei] = faceData[facei].data();
572 return nearestRegion;
591 Pout<<
"Checking field " << msg <<
endl;
610 const scalar& minVal = minFld[pointi];
611 const scalar& maxVal = maxFld[pointi];
612 if (
mag(minVal-maxVal) > SMALL)
615 <<
" minFld:" << minVal <<
nl
616 <<
" maxFld:" << maxVal <<
nl
638 Pout<<
"Checking field " << msg <<
endl;
645 point(GREAT, GREAT, GREAT)
657 const point& minVal = minFld[pointi];
658 const point& maxVal = maxFld[pointi];
659 if (
mag(minVal-maxVal) > SMALL)
662 <<
" minFld:" << minVal <<
nl
663 <<
" maxFld:" << maxVal <<
nl
672 Pout<<
"meshRefinement::checkData() : Checking refinement structure."
674 meshCutter_.checkMesh();
676 Pout<<
"meshRefinement::checkData() : Checking refinement levels."
678 meshCutter_.checkRefinementLevels(1,
labelList(0));
681 const label nBnd = mesh_.nBoundaryFaces();
683 Pout<<
"meshRefinement::checkData() : Checking synchronization."
689 pointField::subList boundaryFc
693 mesh_.nInternalFaces()
706 testSyncBoundaryFaceList
709 "testing faceCentres : ",
716 const labelList& surfIndex = surfaceIndex();
723 calcNeighbourData(neiLevel, neiCc);
731 start[facei] = mesh_.cellCentres()[mesh_.faceOwner()[facei]];
733 if (mesh_.isInternalFace(facei))
735 end[facei] = mesh_.cellCentres()[mesh_.faceNeighbour()[facei]];
739 end[facei] = neiCc[facei-mesh_.nInternalFaces()];
755 surfaces_.findHigherIntersection
772 mesh_.nInternalFaces()
780 if (surfIndex[facei] != surfaceHit[facei])
782 if (mesh_.isInternalFace(facei))
785 <<
"Internal face:" << facei
786 <<
" fc:" << mesh_.faceCentres()[facei]
787 <<
" cached surfaceIndex_:" << surfIndex[facei]
788 <<
" current:" << surfaceHit[facei]
790 << mesh_.cellCentres()[mesh_.faceOwner()[facei]]
792 << mesh_.cellCentres()[mesh_.faceNeighbour()[facei]]
798 != neiHit[facei-mesh_.nInternalFaces()]
802 <<
"Boundary face:" << facei
803 <<
" fc:" << mesh_.faceCentres()[facei]
804 <<
" cached surfaceIndex_:" << surfIndex[facei]
805 <<
" current:" << surfaceHit[facei]
807 << mesh_.cellCentres()[mesh_.faceOwner()[facei]]
809 << neiCc[facei-mesh_.nInternalFaces()]
810 <<
" end:" <<
end[facei]
812 << meshCutter_.cellLevel()[mesh_.faceOwner()[facei]]
814 << meshCutter_.faceLevel(facei)
824 mesh_.nBoundaryFaces(),
825 mesh_.nInternalFaces()
828 labelList neiBoundarySurface(boundarySurface);
836 testSyncBoundaryFaceList
839 "testing surfaceIndex() : ",
847 Pout<<
"meshRefinement::checkData() : Counting duplicate faces."
855 identity(mesh_.nBoundaryFaces(), mesh_.nInternalFaces())
865 if (duplicateFace[i] != -1)
871 Pout<<
"meshRefinement::checkData() : Found " << nDup
872 <<
" duplicate pairs of faces." <<
endl;
879 meshCutter_.setInstance(inst);
880 surfaceIndex_.instance() = inst;
908 mesh_.updateMesh(map);
923 setInstance(mesh_.facesInstance());
938 updateMesh(map, newExposedFaces);
954 label facei = splitFaces[i];
955 const face&
f = mesh_.faces()[facei];
978 face f1(
f.size()-f0.size()+2);
988 label own = mesh_.faceOwner()[facei];
991 if (facei >= mesh_.nInternalFaces())
993 patchi = mesh_.boundaryMesh().whichPatch(facei);
997 nei = mesh_.faceNeighbour()[facei];
1000 label zonei = mesh_.faceZones().whichZone(facei);
1001 bool zoneFlip =
false;
1004 const faceZone& fz = mesh_.faceZones()[zonei];
1011 Pout<<
"face:" << facei <<
" verts:" <<
f
1012 <<
" split into f0:" << f0
1013 <<
" f1:" << f1 <<
endl;
1075 <<
"Splitting " << nSplit
1076 <<
" faces across diagonals" <<
"." <<
nl <<
endl;
1088 meshMod.
faces().size()+splitFaces.size(),
1093 doSplitFaces(splitFaces, splits, meshMod);
1100 mesh_.updateMesh(map);
1110 setInstance(mesh_.facesInstance());
1122 Map<label> splitFaceToIndex(2*splitFaces.size());
1125 splitFaceToIndex.insert(splitFaces[i], i);
1132 const auto oldFaceFnd = splitFaceToIndex.cfind(oldFacei);
1134 if (oldFaceFnd.found())
1136 labelPair& twoFaces = facePairs[oldFaceFnd.val()];
1137 if (twoFaces[0] == -1)
1139 twoFaces[0] = facei;
1141 else if (twoFaces[1] == -1)
1143 twoFaces[1] = facei;
1148 <<
"problem: twoFaces:" << twoFaces
1159 if (duplicateFace.size())
1173 baffle.first() = oldToNewFaces[baffle.first()];
1176 if (baffle.first() == -1 || baffle.
second() == -1)
1179 <<
"Removed baffle : faces:" << baffle
1192 changedFaces.
append(facePairs[i].first());
1193 changedFaces.
append(facePairs[i].second());
1197 updateMesh(map, growFaceCellFace(changedFaces));
1210 for (
label iteration = 0; iteration < 100; iteration++)
1213 <<
"Undo iteration " << iteration <<
nl
1214 <<
"----------------" <<
endl;
1220 faceSet errorFaces(mesh_,
"errorFaces", mesh_.nBoundaryFaces());
1236 const labelList grownFaces(growFaceCellFace(errorFaces));
1238 errorFaces.insert(grownFaces);
1252 const labelPair& twoFaces = facePairs[index];
1256 errorFaces.found(twoFaces.first())
1257 || errorFaces.found(twoFaces.
second())
1260 const face& originalFace = originalFaces[index];
1264 label own = mesh_.faceOwner()[twoFaces[0]];
1267 if (twoFaces[0] >= mesh_.nInternalFaces())
1269 patchi = mesh_.boundaryMesh().whichPatch(twoFaces[0]);
1273 nei = mesh_.faceNeighbour()[twoFaces[0]];
1276 label zonei = mesh_.faceZones().whichZone(twoFaces[0]);
1277 bool zoneFlip =
false;
1280 const faceZone& fz = mesh_.faceZones()[zonei];
1297 meshMod.
removeFace(twoFaces[1], twoFaces[0]);
1299 mergedIndices.insert(index);
1305 Info<<
"Detected " <<
n
1306 <<
" split faces that will be restored to their original faces."
1323 mesh_.updateMesh(map);
1333 setInstance(mesh_.facesInstance());
1349 const labelPair& oldSplit = facePairs[index];
1350 label new0 = oldToNewFaces[oldSplit[0]];
1351 label new1 = oldToNewFaces[oldSplit[1]];
1353 if (!mergedIndices.found(index))
1356 if (new0 < 0 || new1 < 0)
1359 <<
"Problem: oldFaces:" << oldSplit
1360 <<
" newFaces:" <<
labelPair(new0, new1)
1364 facePairs[newIndex] =
labelPair(new0, new1);
1368 originalFaces[index]
1375 if (new0 < 0 || new1 == -1)
1378 <<
"Problem: oldFaces:" << oldSplit
1382 changedFaces.
append(new0);
1386 facePairs.setSize(newIndex);
1387 originalFaces.
setSize(newIndex);
1391 updateMesh(map, growFaceCellFace(changedFaces));
1397 if (duplicateFace.size())
1411 baffle.first() = reverseFaceMap[baffle.first()];
1414 if (baffle.first() == -1 || baffle.
second() == -1)
1417 <<
"Removed baffle : faces:" << baffle
1431 Foam::meshRefinement::meshRefinement
1434 const scalar mergeDistance,
1435 const bool overwrite,
1445 mergeDistance_(mergeDistance),
1446 overwrite_(overwrite),
1448 surfaces_(surfaces),
1449 features_(features),
1451 limitShells_(limitShells),
1463 mesh_.facesInstance(),
1475 updateIntersections(checkFaces);
1483 if (surfaceIndex_.size() != mesh_.nFaces())
1490 return surfaceIndex_;
1496 if (surfaceIndex_.size() != mesh_.nFaces())
1498 updateIntersections(
identity(mesh_.nFaces()));
1500 return surfaceIndex_;
1511 const labelList& surfIndex = surfaceIndex();
1515 if (surfIndex[facei] >= 0 && isMasterFace.
test(facei))
1526 const bool keepZoneFaces,
1527 const bool keepBaffles,
1544 label nUnblocked = 0;
1558 specifiedProcessorFaces,
1564 if (keepZoneFaces || keepBaffles)
1584 const faceZone& fZone = fZones[zonei];
1588 label facei = fZone[i];
1589 if (blockedFace[facei])
1593 mesh_.isInternalFace(facei)
1597 blockedFace[facei] =
false;
1619 Info<<
"Found " << nUnblocked
1620 <<
" zoned faces to keep together." <<
endl;
1626 boolList separatedCoupledFace(mesh_.nFaces(),
false);
1627 selectSeparatedCoupledFaces(separatedCoupledFace);
1629 label nSeparated = 0;
1630 forAll(separatedCoupledFace, facei)
1632 if (separatedCoupledFace[facei])
1634 if (blockedFace[facei])
1636 blockedFace[facei] =
false;
1642 Info<<
"Found " << nSeparated
1643 <<
" separated coupled faces to keep together." <<
endl;
1645 nUnblocked += nSeparated;
1651 const label nBnd = mesh_.nBoundaryFaces();
1653 labelList coupledFace(mesh_.nFaces(), -1);
1666 coupledFace[baffle.first()] = baffle.
second();
1667 coupledFace[baffle.
second()] = baffle.first();
1671 const labelPair& baffle = allCouples[i];
1672 coupledFace[baffle.first()] = baffle.
second();
1673 coupledFace[baffle.
second()] = baffle.first();
1679 forAll(coupledFace, facei)
1681 if (coupledFace[facei] != -1 && facei < coupledFace[facei])
1683 couples[nCpl++] =
labelPair(facei, coupledFace[facei]);
1692 Info<<
"Found " << nCouples <<
" baffles to keep together."
1702 blockedFace[baffle.first()] =
false;
1703 blockedFace[baffle.
second()] =
false;
1711 specifiedProcessorFaces,
1719 Pout<<
"Wanted distribution:" << nProcCells <<
endl;
1724 Pout<<
"Wanted resulting decomposition:" <<
endl;
1725 forAll(nProcCells, proci)
1727 Pout<<
" " << proci <<
'\t' << nProcCells[proci] <<
endl;
1740 setInstance(mesh_.facesInstance());
1743 if (
debug && keepZoneFaces)
1751 const faceZone& fZone = fZones[zonei];
1755 label facei = fZone[i];
1758 if (patchi >= 0 && pbm[patchi].coupled())
1761 <<
"Face at " << mesh_.faceCentres()[facei]
1762 <<
" on zone " << fZone.
name()
1763 <<
" is on coupled patch " << pbm[patchi].
name()
1777 label nBoundaryFaces = 0;
1779 const labelList& surfIndex = surfaceIndex();
1783 if (surfIndex[facei] != -1)
1794 if (surfIndex[facei] != -1)
1796 surfaceFaces[nBoundaryFaces++] = facei;
1799 return surfaceFaces;
1805 const faceList& faces = mesh_.faces();
1808 bitSet isBoundaryPoint(mesh_.nPoints());
1809 label nBoundaryPoints = 0;
1811 const labelList& surfIndex = surfaceIndex();
1815 if (surfIndex[facei] != -1)
1817 const face&
f = faces[facei];
1821 if (isBoundaryPoint.set(
f[fp]))
1858 labelList boundaryPoints(nBoundaryPoints);
1859 nBoundaryPoints = 0;
1860 forAll(isBoundaryPoint, pointi)
1862 if (isBoundaryPoint.test(pointi))
1864 boundaryPoints[nBoundaryPoints++] = pointi;
1868 return boundaryPoints;
1888 nFaces += pp.size();
1903 addressing[nFaces++] = meshFacei++;
1928 pointPatches.size(),
1929 slipPointPatchVectorField::typeName
1934 patchFieldTypes[adaptPatchIDs[i]] =
1935 fixedValuePointPatchVectorField::typeName;
1938 forAll(pointPatches, patchi)
1940 if (isA<processorPointPatch>(pointPatches[patchi]))
1942 patchFieldTypes[patchi] = calculatedPointPatchVectorField::typeName;
1944 else if (isA<cyclicPointPatch>(pointPatches[patchi]))
1946 patchFieldTypes[patchi] = cyclicSlipPointPatchVectorField::typeName;
1956 "pointDisplacement",
1988 <<
"faceZones are not synchronised on processors." <<
nl
1989 <<
"Processor " << proci <<
" has faceZones "
1990 << zoneNames[proci] <<
nl
1992 <<
" has faceZones "
2006 const faceZone& fZone = fZones[zonei];
2014 if (faceToZone[bFacei] == -1)
2016 faceToZone[bFacei] = zonei;
2018 else if (faceToZone[bFacei] == zonei)
2021 <<
"Face " << fZone[i] <<
" in zone "
2023 <<
" is twice in zone!"
2029 <<
"Face " << fZone[i] <<
" in zone "
2031 <<
" is also in zone "
2032 << fZones[faceToZone[bFacei]].name()
2044 if (faceToZone[i] != neiFaceToZone[i])
2048 <<
" is in zone " << faceToZone[i]
2049 <<
", its coupled face is in zone " << neiFaceToZone[i]
2059 const bitSet& isMasterEdge,
2069 edgeWeights.setSize(isMasterEdge.
size());
2070 invSumWeight.setSize(meshPoints.size());
2074 const edge&
e = edges[edgei];
2080 pts[meshPoints[
e[1]]]
2081 - pts[meshPoints[
e[0]]]
2084 edgeWeights[edgei] = 1.0/eMag;
2100 forAll(invSumWeight, pointi)
2102 scalar w = invSumWeight[pointi];
2106 invSumWeight[pointi] = 1.0/w;
2115 const label insertPatchi,
2116 const word& patchName,
2127 label patchi = polyPatches.size();
2130 polyPatches.
setSize(patchi+1);
2148 polyPatches[patchi],
2153 addPatchFields<volScalarField>
2158 addPatchFields<volVectorField>
2163 addPatchFields<volSphericalTensorField>
2168 addPatchFields<volSymmTensorField>
2173 addPatchFields<volTensorField>
2181 addPatchFields<surfaceScalarField>
2186 addPatchFields<surfaceVectorField>
2191 addPatchFields<surfaceSphericalTensorField>
2196 addPatchFields<surfaceSymmTensorField>
2201 addPatchFields<surfaceTensorField>
2213 const word& patchName,
2229 label insertPatchi = polyPatches.size();
2232 forAll(polyPatches, patchi)
2234 const polyPatch& pp = polyPatches[patchi];
2236 if (isA<processorPolyPatch>(pp))
2238 insertPatchi = patchi;
2239 startFacei = pp.
start();
2245 patchDict.
set(
"nFaces", 0);
2246 patchDict.
set(
"startFace", startFacei);
2251 label addedPatchi = appendPatch(
mesh, insertPatchi, patchName, patchDict);
2257 for (
label i = 0; i < insertPatchi; i++)
2262 for (
label i = insertPatchi; i < addedPatchi; i++)
2267 oldToNew[addedPatchi] = insertPatchi;
2270 polyPatches.
reorder(oldToNew,
true);
2271 fvPatches.reorder(oldToNew);
2273 reorderPatchFields<volScalarField>(
mesh, oldToNew);
2274 reorderPatchFields<volVectorField>(
mesh, oldToNew);
2275 reorderPatchFields<volSphericalTensorField>(
mesh, oldToNew);
2276 reorderPatchFields<volSymmTensorField>(
mesh, oldToNew);
2277 reorderPatchFields<volTensorField>(
mesh, oldToNew);
2278 reorderPatchFields<surfaceScalarField>(
mesh, oldToNew);
2279 reorderPatchFields<surfaceVectorField>(
mesh, oldToNew);
2280 reorderPatchFields<surfaceSphericalTensorField>(
mesh, oldToNew);
2281 reorderPatchFields<surfaceSymmTensorField>(
mesh, oldToNew);
2282 reorderPatchFields<surfaceTensorField>(
mesh, oldToNew);
2284 return insertPatchi;
2294 label meshedi = meshedPatches_.find(
name);
2299 return mesh_.boundaryMesh().findPatchID(
name);
2304 label patchi = addPatch(mesh_,
name, patchInfo);
2329 meshedPatches_.append(
name);
2332 faceToCoupledPatch_.clear();
2344 forAll(meshedPatches_, i)
2351 <<
"Problem : did not find patch " << meshedPatches_[i]
2368 const word& masterPatch,
2369 const word& slavePatch,
2381 faceZoneToMasterPatch_.insert(fzName, masterPatch);
2382 faceZoneToSlavePatch_.insert(fzName, slavePatch);
2383 faceZoneToType_.insert(fzName, fzType);
2392 label& masterPatchID,
2393 label& slavePatchID,
2399 if (!faceZoneToMasterPatch_.found(fzName))
2405 const word& masterName = faceZoneToMasterPatch_[fzName];
2408 const word& slaveName = faceZoneToSlavePatch_[fzName];
2411 fzType = faceZoneToType_[fzName];
2425 if (isA<coupledPolyPatch>(
patches[patchi]))
2436 selected[cpp.
start()+i] =
true;
2448 const vector& perturbVec,
2460 regioni = cellToRegion[celli];
2470 regioni = cellToRegion[celli];
2484 const vector& perturbVec,
2488 const label nRegions,
2496 labelList insideRegions(locationsInMesh.size());
2500 label regioni = findRegion
2508 insideRegions[i] = regioni;
2511 forAll(cellRegion, celli)
2513 if (cellRegion[celli] == regioni)
2515 insideCell.set(celli);
2524 forAll(locationsOutsideMesh, i)
2527 label regioni = findRegion
2532 locationsOutsideMesh[i]
2539 label index = insideRegions.find(regioni);
2569 locationsOutsideMesh,
2578 label nSegments = 0;
2579 if (leakPath.segments().size())
2581 nSegments =
max(leakPath.segments())+1;
2586 for (
label segmenti : leakPath.segments())
2588 nElemsPerSegment[segmenti]++;
2590 segmentPoints.
setSize(nElemsPerSegment.size());
2591 segmentDist.
setSize(nElemsPerSegment.size());
2592 forAll(nElemsPerSegment, i)
2594 segmentPoints[i].setSize(nElemsPerSegment[i]);
2595 segmentDist[i].
setSize(nElemsPerSegment[i]);
2597 nElemsPerSegment = 0;
2601 label segmenti = leakPath.segments()[elemi];
2604 label&
n = nElemsPerSegment[segmenti];
2607 dist[
n] = leakPath.curveDist()[elemi];
2613 forAll(allLeakPaths, segmenti)
2618 std::move(segmentPoints[segmenti]);
2623 std::move(segmentDist[segmenti]);
2629 ListListOps::combine<pointList>
2636 ListListOps::combine<scalarList>
2664 varData.
setSize(allLeakPaths.size());
2665 forAll(allLeakPaths, segmenti)
2667 varData[segmenti] = allLeakPaths[segmenti].curveDist();
2670 const wordList valueSetNames(1,
"leakPath");
2685 leakPathFormatter.
write
2699 <<
"Location in mesh " << locationsInMesh[index]
2700 <<
" is inside same mesh region " << regioni
2701 <<
" as one of the locations outside mesh "
2702 << locationsOutsideMesh
2703 <<
nl <<
" Dumped leak path to " << fName
2713 forAll(insideCell, celli)
2715 if (!insideCell.test(celli))
2717 cellRegion[celli] = -1;
2720 else if (cellRegion[celli] == -1)
2740 (void)mesh_.tetBasePtIs();
2745 boolList blockedFace(mesh_.nFaces(),
false);
2746 selectSeparatedCoupledFaces(blockedFace);
2750 label nRemove = findRegions
2755 locationsOutsideMesh,
2767 forAll(cellRegion, celli)
2769 if (cellRegion[celli] == -1)
2771 cellsToRemove.append(celli);
2774 cellsToRemove.shrink();
2778 cellsToRemove.size(),
2784 if (nTotCellsToRemove > 0)
2786 label nCellsToKeep =
2787 mesh_.globalData().nTotalCells()
2788 - nTotCellsToRemove;
2790 Info<<
"Keeping all cells containing points " << locationsInMesh <<
endl
2791 <<
"Selected for keeping : "
2793 <<
" cells." <<
endl;
2811 label defaultPatch = 0;
2812 if (globalToMasterPatch.size())
2814 defaultPatch = globalToMasterPatch[0];
2818 <<
"Removing non-reachable cells exposes "
2819 << nExposedFaces <<
" internal or coupled faces." <<
endl
2820 <<
" These get put into patch " << defaultPatch <<
endl;
2821 exposedPatch.setSize(exposedFaces.size(), defaultPatch);
2824 mapPtr = doRemoveCells
2843 meshCutter_.distribute(map);
2850 faceToCoupledPatch_.clear();
2876 geometry[i].distribute
2887 geometry[i].instance() = geometry[i].time().timeName();
2905 updateMesh(map, changedFaces, dummyMap, dummyMap, dummyMap);
2917 meshCutter_.storeData
2938 meshCutter_.updateMesh
2951 Map<label> newFaceToPatch(faceToCoupledPatch_.size());
2958 newFaceToPatch.insert(newFacei, iter.val());
2961 faceToCoupledPatch_.
transfer(newFaceToPatch);
2966 updateIntersections(changedFaces);
2973 if (userFaceData_[i].first() == KEEPALL)
2978 else if (userFaceData_[i].first() == MASTERONLY)
2983 forAll(newFaceData, facei)
2989 newFaceData[facei] =
data[oldFacei];
3009 if (reverseFaceMap[oldFacei] != facei)
3012 reverseFaceMap[oldFacei] = -1;
3019 forAll(newFaceData, facei)
3025 if (reverseFaceMap[oldFacei] == facei)
3027 newFaceData[facei] =
data[oldFacei];
3039 bool writeOk = mesh_.write();
3056 s.instance() !=
s.time().system()
3057 &&
s.instance() !=
s.time().caseSystem()
3058 &&
s.instance() !=
s.time().constant()
3059 &&
s.instance() !=
s.time().caseConstant()
3063 s.instance() =
s.time().timeName();
3064 writeOk = writeOk &&
s.write();
3095 bitSet isPatchMasterPoint(meshPoints.size());
3096 forAll(meshPoints, pointi)
3100 isPatchMasterPoint.set(pointi);
3104 return isPatchMasterPoint;
3118 identity(globalEdges.localSize(), globalEdges.localStart())
3131 bitSet isMasterEdge(meshEdges.size());
3134 if (myEdges[edgei] == globalEdges.toGlobal(edgei))
3136 isMasterEdge.
set(edgei);
3140 return isMasterEdge;
3152 <<
" : cells(local):" << mesh_.nCells()
3153 <<
" faces(local):" << mesh_.nFaces()
3154 <<
" points(local):" << mesh_.nPoints()
3163 label nMasterPoints = isMeshMasterPoint.
count();
3175 const labelList& cellLevel = meshCutter_.cellLevel();
3181 nCells[cellLevel[celli]]++;
3187 Info<<
"Cells per refinement level:" <<
endl;
3190 Info<<
" " << leveli <<
'\t' << nCells[leveli]
3199 if (overwrite_ && mesh_.time().timeIndex() == 0)
3201 return oldInstance_;
3204 return mesh_.time().timeName();
3218 mesh_.time().timeName(),
3226 zeroGradientFvPatchScalarField::typeName
3229 const labelList& cellLevel = meshCutter_.cellLevel();
3231 forAll(volRefLevel, celli)
3233 volRefLevel[celli] = cellLevel[celli];
3236 volRefLevel.write();
3248 mesh_.time().timeName(),
3258 const labelList& pointLevel = meshCutter_.pointLevel();
3260 forAll(pointRefLevel, pointi)
3262 pointRefLevel[pointi] = pointLevel[pointi];
3265 pointRefLevel.write();
3273 OFstream str(prefix +
"_edges.obj");
3275 Pout<<
"meshRefinement::dumpIntersections :"
3276 <<
" Writing cellcentre-cellcentre intersections to file "
3284 labelList neiLevel(mesh_.nBoundaryFaces());
3286 calcNeighbourData(neiLevel, neiCc);
3288 labelList intersectionFaces(intersectedFaces());
3310 surfaces_.findAnyIntersection
3318 forAll(intersectionFaces, i)
3320 if (surfaceHit[i] != -1)
3328 str <<
"l " << verti-2 <<
' ' << verti-1 <<
nl
3329 <<
"l " << verti-1 <<
' ' << verti <<
nl;
3345 if (writeFlags & WRITEMESH)
3350 if (writeFlags && !(writeFlags & NOWRITEREFINEMENT))
3352 meshCutter_.write();
3355 (void)surfaceIndex();
3356 surfaceIndex_.write();
3359 if (writeFlags & WRITELEVELS)
3361 dumpRefinementLevel();
3364 if ((debugFlags & OBJINTERSECTIONS) && prefix.size())
3366 dumpIntersections(prefix);
3385 if (
exists(setsDir/
"surfaceIndex"))
3387 rm(setsDir/
"surfaceIndex");
3403 writeLevel_ = flags;
3422 const word& keyword,
3438 if (!finder.found())
3441 <<
"Entry '" << keyword <<
"' not found in dictionary "
3447 return finder.dict();
3458 const word& keyword,
3469 if (!finder.found())
3472 <<
"Entry '" << keyword <<
"' not found in dictionary "
3475 return dict.first()->stream();
3479 return finder.ref().stream();
int debug
Static debugging option.
const T & second() const noexcept
Return second element, which is also the last element.
static autoPtr< T > New(Args &&... args)
Construct autoPtr of T with forwarding arguments.
List< label > labelList
A List of labels.
vectorField pointField
pointField is a vectorField.
static labelList countCells(const labelList &)
Helper function: count cells per processor in wanted distribution.
virtual const pointField & points() const
Return raw points.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
List< scalar > scalarList
A List of scalars.
Accumulating histogram of values. Specified bin resolution automatic generation of bins.
treeBoundBox extend(Random &rndGen, const scalar s) const
Return slightly wider bounding box.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
const pointBoundaryMesh & boundary() const
Return reference to boundary mesh.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Dimensionless.
static const Vector< scalar > one
bool exists(const fileName &name, const bool checkGzip=true, const bool followLink=true)
Does the name exist (as DIRECTORY or FILE) in the file system?
cellDecomposition
Enumeration defining the decomposition of the cell for.
Calculates points shared by more than two processor patches or cyclic patches.
faceZoneType
What to do with faceZone faces.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
void dumpIntersections(const fileName &prefix) const
Debug: Write intersection information to OBJ format.
const word & name() const
Return name.
A class for handling words, derived from Foam::string.
const labelIOList & cellLevel() const
bool opened() const
Return true if stream has been opened.
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
A class for handling file names.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
static label findRegion(const polyMesh &, const labelList &cellRegion, const vector &perturbVec, const point &p)
Find region point is in. Uses optional perturbation to re-test.
virtual const fileName & name() const
Read/write access to the name of the stream.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
A class for managing temporary objects.
labelList intersectedPoints() const
Get points on surfaces with intersection and boundary faces.
static constexpr const zero Zero
Global zero.
Given list of cells to remove, insert all the topology changes.
autoPtr< mapPolyMesh > changeMesh(polyMesh &mesh, const bool inflate, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
Inplace changes mesh without change of patches.
const DynamicList< point > & points() const
Points. Shrunk after constructing mesh (or calling of compact())
label nInternalFaces() const
Number of internal faces.
static void scatterList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Scatter data. Reverse of gatherList.
A List obtained as a section of another List.
label nFaces() const
Number of mesh faces.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
label addFace(const face &f, const label own, const label nei, const label masterPointID, const label masterEdgeID, const label masterFaceID, const bool flipFaceFlux, const label patchID, const label zoneID, const bool zoneFlip)
Add face to cells. Return new face label.
Standard boundBox with extra functionality for use in octree.
static writeType writeLevel()
Get/set write level.
labelList intersectedFaces() const
Get faces with intersection.
void printMeshInfo(const bool, const string &) const
Print some mesh stats.
label addFaceZone(const word &fzName, const word &masterPatch, const word &slavePatch, const surfaceZonesInfo::faceZoneType &fzType)
Add/lookup faceZone and update information. Return index of.
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
const HashTable< labelList > & groupPatchIDs() const
The patch indices per patch group.
static bool & parRun()
Is this a parallel run?
static const pointMesh & New(const polyMesh &mesh, Args &&... args)
Get existing or create a new MeshObject.
void reorder(const labelUList &oldToNew, const bool validBoundary)
Reorders patches. Ordering does not have to be done in.
static word timeName(const scalar t, const int precision=precision_)
Direct mesh changes based on v1.3 polyTopoChange syntax.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
label countHits() const
Count number of intersections (local)
static autoPtr< fvPatch > New(const polyPatch &, const fvBoundaryMesh &)
Return a pointer to a new patch created on freestore from polyPatch.
label nTotalCells() const
Return total number of cells in decomposed mesh.
virtual void write(const coordSet &, const wordList &, const List< const Field< Type > * > &, Ostream &) const =0
General entry point for writing.
const fileName & facesInstance() const
Return the current instance directory for faces.
void updateMesh(const mapPolyMesh &)
Force recalculation of locally stored data on topological change.
void set(const bitSet &bitset)
Set specified bits from another bitset.
label splitFacesUndo(const labelList &splitFaces, const labelPairList &splits, const dictionary &motionDict, labelList &duplicateFace, List< labelPair > &baffles)
Split faces along diagonal. Maintain mesh quality. Return.
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
List< bool > boolList
A List of bools.
bool rm(const fileName &file)
Remove a file (or its gz equivalent), returning true if successful.
void append(const T &val)
Append an element at the end of the list.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
static bool checkMesh(const bool report, const polyMesh &mesh, const dictionary &dict, labelHashSet &wrongFaces, const bool dryRun=false)
Check mesh with mesh settings in dict. Collects incorrect faces.
Ostream & endl(Ostream &os)
Add newline and flush stream.
The coupledPolyPatch is an abstract base class for patches that couple regions of the computational d...
const pointField & preMotionPoints() const
Pre-motion point positions.
entry * set(entry *entryPtr)
Assign a new entry, overwriting any existing entry.
List< treeBoundBox > meshBb(1, treeBoundBox(boundBox(coarseMesh.points(), false)).extend(rndGen, 1e-3))
prefixOSstream Pout
An Ostream wrapper for parallel output to std::cout.
static void removeFiles(const polyMesh &)
Helper: remove all relevant files from mesh instance.
void setConstraints(const polyMesh &mesh, boolList &blockedFace, PtrList< labelList > &specifiedProcessorFaces, labelList &specifiedProcessor, List< labelPair > &explicitConnections) const
Helper: extract constraints:
bool test(const label pos) const
Test value at specified position, never auto-vivify entries.
static void removeFiles(const polyMesh &)
Helper: remove all relevant files from mesh instance.
unsigned int count(const bool on=true) const
Count number of bits set.
static label addPatch(fvMesh &, const word &name, const dictionary &)
Helper:add patch to mesh. Update all registered fields.
void doSplitFaces(const labelList &splitFaces, const labelPairList &splits, polyTopoChange &meshMod) const
Split faces into two.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
void inplaceRenumber(const labelUList &oldToNew, IntListType &input)
Inplace renumber the values (not the indices) of a list.
Mesh consisting of general polyhedral cells.
static void updateList(const labelList &newToOld, const T &nullValue, List< T > &elems)
Helper: reorder list according to map.
wordList names() const
Return a list of patch names.
void setRefinement(const bitSet &removedCell, const labelUList &facesToExpose, const labelUList &patchIDs, polyTopoChange &) const
Play commands into polyTopoChange to remove cells.
void transfer(dictionary &dict)
Transfer the contents of the argument and annul the argument.
#define forAll(list, i)
Loop across all elements in list.
Field< vector > vectorField
Specialisation of Field<T> for vector.
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
const faceZoneMesh & faceZones() const
Return face zone mesh.
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
void setCapacity(const label nPoints, const label nFaces, const label nCells)
Explicitly pre-size the dynamic storage for expected mesh.
static bitSet getMasterEdges(const polyMesh &mesh, const labelList &meshEdges)
Determine master edge for subset of edges. If coupled.
virtual fileName getFileName(const coordSet &, const wordList &) const =0
Generate file name with correct extension.
Pair< label > labelPair
A pair of labels.
static void calculateEdgeWeights(const polyMesh &mesh, const bitSet &isMasterEdge, const labelList &meshPoints, const edgeList &edges, scalarField &edgeWeights, scalarField &invSumWeight)
Helper: calculate edge weights (1/length)
virtual bool parallel() const
Are the cyclic planes parallel.
Generic const/non-const dictionary entry searcher.
static label findRegions(const polyMesh &, const vector &perturbVec, const pointField &locationsInMesh, const pointField &locationsOutsideMesh, const writer< scalar > &leakPathFormatter, const label nRegions, labelList &cellRegion, const boolList &blockedFace)
Find regions points are in.
const fileName & pointsInstance() const
Return the current instance directory for points.
virtual bool separated() const
Are the planes separated.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
const fileName & name() const
The dictionary name.
Encapsulates queries for volume refinement ('refine all cells within shell').
label nCells() const
Number of mesh cells.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const DynamicList< face > & faces() const
static void checkCoupledFaceZones(const polyMesh &)
Helper function: check that face zones are synced.
An input stream of tokens.
A subset of mesh faces organised as a primitive patch.
messageStream Info
Information stream (uses stdout - output is on the master only)
A patch is a list of labels that address the faces in the global face list.
word name(const complex &c)
Return string representation of complex.
const labelList & surfaceIndex() const
Per start-end edge the index of the surface hit.
static label appendPatch(fvMesh &, const label insertPatchi, const word &, const dictionary &)
Helper:append patch to end of mesh.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
labelList meshedPatches() const
Get patchIDs for patches added in addMeshedPatch.
void modifyFace(const face &f, const label facei, const label own, const label nei, const bool flipFaceFlux, const label patchID, const label zoneID, const bool zoneFlip)
Modify vertices or cell of face.
void transfer(List< T > &list)
static const Foam::polyMesh::cellDecomposition findCellMode(Foam::polyMesh::FACE_DIAG_TRIS)
const_searcher csearch(const word &keyword, enum keyType::option=keyType::REGEX) const
Search dictionary for given keyword.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
A List with indirect addressing.
void setSize(const label newLen)
Same as resize()
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
This class separates the mesh into distinct unconnected regions, each of which is then given a label ...
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
label nRegions() const
Return total number of regions.
static word outputPrefix
Directory prefix.
label findPatchID(const word &patchName, const bool allowNotFound=true) const
Find patch index given a name, return -1 if not found.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
static bool constraintType(const word &pt)
Return true if the given type is a constraint type.
void distribute(const mapDistributePolyMesh &)
Update local numbering for mesh redistribution.
ITstream & lookup(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
static const Enum< writeType > writeTypeNames
Finds shortest path (in terms of cell centres) to walk on mesh from any point in insidePoints to any ...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
label nBoundaryFaces() const
Number of boundary faces (== nFaces - nInternalFaces)
Various mesh related information for a parallel run. Upon construction, constructs all info using par...
static autoPtr< polyPatch > New(const word &patchType, const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm)
Return a pointer to a new patch created on freestore from.
static autoPtr< indirectPrimitivePatch > makePatch(const polyMesh &, const labelList &)
Create patch from set of patches.
Abstract base class for domain decomposition.
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
static labelList findDuplicateFaces(const primitiveMesh &, const labelList &)
Helper routine to find baffles (two boundary faces using the.
Holds list of sampling positions.
void distributeFaceData(List< T > &lst) const
Distribute list of face data.
Mesh data needed to do the Finite Volume discretisation.
This boundary condition is not designed to be evaluated; it is assmued that the value is assigned via...
Mesh representing a set of points created from polyMesh.
label whichFace(const label globalCellID) const
Helper function to re-direct to zone::localID(...)
errorManip< error > abort(error &err)
const T * set(const label i) const
Return const pointer to element (if set) or nullptr.
const word & name() const
Return name.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
void updateMesh(const mapPolyMesh &, const labelList &changedFaces)
Update for external change to mesh. changedFaces are in new mesh.
Vector< scalar > vector
A scalar version of the templated Vector.
label start() const
Return start label of this patch in the polyMesh face list.
void removeFace(const label facei, const label mergeFacei)
Remove/merge face.
autoPtr< mapDistributePolyMesh > balance(const bool keepZoneFaces, const bool keepBaffles, const scalarField &cellWeights, decompositionMethod &decomposer, fvMeshDistribute &distributor)
Redecompose according to cell count.
wordList names() const
A list of the zone names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Output to file stream, using an OSstream.
void setInstance(const fileName &)
Set instance of all local IOobjects.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
static bool master(const label communicator=0)
Am I the master process.
const labelList & reverseFaceMap() const
Reverse face map.
VectorSpace< Form, Cmpt, Ncmpts > normalised(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
void selectSeparatedCoupledFaces(boolList &) const
Select coupled faces that are not collocated.
static void listCombineGather(const List< commsStruct > &comms, List< T > &Value, const CombineOp &cop, const int tag, const label comm)
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
label findCell(const point &p, const cellDecomposition=CELL_TETS) const
Find cell enclosing this location and return index.
IntListType renumber(const labelUList &oldToNew, const IntListType &input)
Renumber the values (not the indices) of a list.
const vectorField & cellCentres() const
virtual const faceList & faces() const
Return raw faces.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
static ITstream & lookup(const dictionary &dict, const word &keyword, const bool noExit)
Wrapper around dictionary::lookup which does not exit.
An ordered pair of two objects of type <T> with first() and second() elements.
forAllConstIters(mixture.phases(), phase)
static const Enum< coordFormat > coordFormatNames
String representation of coordFormat enum.
Encapsulates queries for features.
const labelList & reversePointMap() const
Reverse point map.
writeType
Enumeration for what to write. Used as a bit-pattern.
virtual labelList decompose(const pointField &points, const scalarField &pointWeights) const
Return for every coordinate the wanted processor number.
autoPtr< mapPolyMesh > splitMeshRegions(const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const pointField &locationsInMesh, const pointField &locationsOutsideMesh, const writer< scalar > &leakPathFormatter)
Split mesh. Keep part containing point. Return empty map if.
Container for searchableSurfaces. The collection is specified as a dictionary. For example,...
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label ListType::const_reference const label start
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
label size() const noexcept
Number of entries.
void checkData()
Debugging: check that all faces still obey start()>end()
Helper class which maintains intersections of (changing) mesh with (static) surfaces.
const dimensionedScalar e
Elementary charge.
bool write() const
Write mesh and all data.
label nPoints() const
Number of mesh points.
labelList identity(const label len, label start=0)
Create identity map of the given length with (map[i] == i)
static tmp< T > New(Args &&... args)
Construct tmp of T with forwarding arguments.
label addMeshedPatch(const word &name, const dictionary &)
Add patch originating from meshing. Update meshedPatches_.
void storeData(const labelList &pointsToStore, const labelList &facesToStore, const labelList &cellsToStore)
Signal points/face/cells for which to store data.
autoPtr< mapDistributePolyMesh > distribute(const labelList &dist)
Send cells to neighbours according to distribution.
const polyBoundaryMesh & patches
const labelList & faceMap() const
Old face map.
static void testSyncPointList(const string &msg, const polyMesh &mesh, const List< scalar > &fld)
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
void clear() noexcept
Delete managed object and set pointer to nullptr.
static bool split(const std::string &line, std::string &key, std::string &val)
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
bool hasMotionPoints() const
Has valid preMotionPoints?
fileName globalPath() const
Return global path for the case.
static bool clean(std::string &str)
Cleanup filename.
const Time & time() const
Return the top-level database.
static const Vector< scalar > zero
A List with indirect addressing.
SubField< vector > subField
Declare type of subField.
A face is a list of labels corresponding to mesh vertices.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
void updateIntersections(const labelList &changedFaces)
Find any intersection of surface. Store in surfaceIndex_.
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
List< point > pointList
A List of points.
label faceLevel(const label facei) const
Gets level such that the face has four points <= level.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
static void listCombineScatter(const List< commsStruct > &comms, List< T > &Value, const int tag, const label comm)
Scatter data. Reverse of combineGather.
vector point
Point is a vector.
UList< label > labelUList
A UList of labels.
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys and label hasher.
static const Enum< debugType > debugTypeNames
void setSize(const label newSize)
Alias for resize(const label)
Container for data on surfaces used for surface-driven refinement. Contains all the data about the le...
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
static const dictionary & subDict(const dictionary &dict, const word &keyword, const bool noExit)
Wrapper around dictionary::subDict which does not exit.
const boolList & flipMap() const
Return face flip map.
#define DebugVar(var)
Report a variable name and value.
defineTypeNameAndDebug(combustionModel, 0)
static tmp< pointVectorField > makeDisplacementField(const pointMesh &pMesh, const labelList &adaptPatchIDs)
Helper function to make a pointVectorField with correct.
#define WarningInFunction
Report a warning using Foam::Warning.
Sends/receives parts of mesh+fvfields to neighbouring processors. Used in load balancing.
Database for solution data, solver performance and other reduced data.
Type gMax(const FieldField< Field, Type > &f)
static bitSet getMasterPoints(const polyMesh &mesh, const labelList &meshPoints)
Determine master point for subset of points. If coupled.
bool getFaceZoneInfo(const word &fzName, label &masterPatchID, label &slavePatchID, surfaceZonesInfo::faceZoneType &fzType) const
Lookup faceZone information. Return false if no information.
static labelPairList findDuplicateFacePairs(const polyMesh &)
Helper routine to find all baffles (two boundary faces.
void clearOut()
Clear all geometry and addressing.
labelList getExposedFaces(const bitSet &removedCell) const
Get labels of faces exposed after cells removal.
void dumpRefinementLevel() const
Write refinement level as volScalarFields for postprocessing.
debugType
Enumeration for what to debug. Used as a bit-pattern.
static label addFaceZone(const word &name, const labelList &addressing, const boolList &flipMap, polyMesh &mesh)
const labelIOList & tetBasePtIs() const
Return the tetBasePtIs.