52 bool Foam::fvMeshSubset::checkCellSubset()
const
54 if (fvMeshSubsetPtr_.empty())
57 <<
"void setCellSubset(const labelHashSet& cellsToSubset)" <<
endl
58 <<
"before attempting to access subset data"
70 void Foam::fvMeshSubset::markPoints
79 pointMap.insert(curPoints[pointi], 0);
84 void Foam::fvMeshSubset::markPoints
92 pointMap[curPoints[pointi]] = 0;
97 void Foam::fvMeshSubset::doCoupledPatches
100 Map<label>& facesToSubset,
107 const polyBoundaryMesh& oldPatches = baseMesh().boundaryMesh();
109 label nUncoupled = 0;
116 forAll(oldPatches, oldPatchi)
118 const polyPatch& pp = oldPatches[oldPatchi];
120 if (isA<processorPolyPatch>(pp))
122 const processorPolyPatch& procPatch =
123 refCast<const processorPolyPatch>(pp);
125 UOPstream toNeighbour(procPatch.neighbProcNo(), pBufs);
127 if (!facesToSubset.empty())
129 DynamicList<label> patchFacesToSubset;
134 facesToSubset.found(pp.start()+i)
135 && facesToSubset[pp.start()+i] == 1
138 patchFacesToSubset.append(i);
141 toNeighbour << patchFacesToSubset;
143 else if (!nCellsUsingFace.empty())
146 SubList<label>(nCellsUsingFace, pp.size(), pp.start());
155 pBufs.finishedSends();
158 forAll(oldPatches, oldPatchi)
160 const polyPatch& pp = oldPatches[oldPatchi];
162 if (isA<processorPolyPatch>(pp))
164 const processorPolyPatch& procPatch =
165 refCast<const processorPolyPatch>(pp);
167 UIPstream fromNeighbour(procPatch.neighbProcNo(), pBufs);
173 if (!facesToSubset.empty())
181 facesToSubset.found(pp.start()+i)
182 && facesToSubset[pp.start()+i] == 1
183 && !nbrPatchFacesToSubset.found(i)
188 facesToSubset[pp.start()+i] = 3;
193 else if (!nCellsUsingFace.empty())
195 const labelList& nbrCellsUsingFace(nbrList);
203 nCellsUsingFace[pp.start()+i] == 1
204 && nbrCellsUsingFace[i] == 0
209 nCellsUsingFace[pp.start()+i] = 3;
219 forAll(oldPatches, oldPatchi)
221 const polyPatch& pp = oldPatches[oldPatchi];
223 if (isA<cyclicPolyPatch>(pp))
225 const cyclicPolyPatch& cycPatch =
226 refCast<const cyclicPolyPatch>(pp);
228 if (!facesToSubset.empty())
232 const label thisFacei = cycPatch.start() + i;
233 const label otherFacei =
234 cycPatch.transformGlobalFace(thisFacei);
238 facesToSubset.found(thisFacei)
239 && facesToSubset[thisFacei] == 1
240 && !facesToSubset.found(otherFacei)
243 facesToSubset[thisFacei] = 3;
248 else if (!nCellsUsingFace.empty())
252 const label thisFacei = cycPatch.start() + i;
253 const label otherFacei =
254 cycPatch.transformGlobalFace(thisFacei);
258 nCellsUsingFace[thisFacei] == 1
259 && nCellsUsingFace[otherFacei] == 0
262 nCellsUsingFace[thisFacei] = 3;
272 reduce(nUncoupled, sumOp<label>());
275 if (debug && nUncoupled > 0)
277 Info<<
"Uncoupled " << nUncoupled <<
" faces on coupled patches. "
278 <<
"(processorPolyPatch, cyclicPolyPatch)" <<
endl;
292 forAll(selectedElements, i)
294 selected[selectedElements[i]] =
true;
301 if (selected[subsetMap[i]])
313 if (selected[subsetMap[i]])
315 subsettedElements[
n++] = i;
319 return subsettedElements;
323 void Foam::fvMeshSubset::subsetZones()
327 const pointZoneList& pointZones = baseMesh().pointZones();
330 List<pointZone*> pZonePtrs(pointZones.size());
334 const pointZone& pz = pointZones[i];
336 pZonePtrs[i] =
new pointZone
340 fvMeshSubsetPtr_().pointZones()
346 const faceZoneList& faceZones = baseMesh().faceZones();
350 List<faceZone*> fZonePtrs(faceZones.size());
354 const faceZone& fz = faceZones[i];
388 if (zone[meshFacei] != 0)
390 subAddressing[nSub] = subFacei;
391 const label subOwner = subMesh().faceOwner()[subFacei];
392 const label baseOwner = baseMesh().faceOwner()[meshFacei];
394 const bool sameOwner = (cellMap()[subOwner] == baseOwner);
395 const bool flip = (zone[meshFacei] == 1);
396 subFlipStatus[nSub] = (sameOwner == flip);
402 fZonePtrs[i] =
new faceZone
407 fvMeshSubsetPtr_().faceZones()
412 const cellZoneList& cellZones = baseMesh().cellZones();
414 List<cellZone*> cZonePtrs(cellZones.size());
418 const cellZone& cz = cellZones[i];
420 cZonePtrs[i] =
new cellZone
423 subset(baseMesh().nCells(), cz, cellMap()),
424 fvMeshSubsetPtr_().cellZones()
430 fvMeshSubsetPtr_().addZones(pZonePtrs, fZonePtrs, cZonePtrs);
437 const label currentRegion
444 if (region[cellI] == currentRegion)
451 label nRemove = baseMesh().nCells() - nKeep;
457 if (region[cellI] != currentRegion)
459 cellsToRemove[nRemove++] = cellI;
463 return cellsToRemove;
472 fvMeshSubsetPtr_(nullptr),
498 const cellList& oldCells = baseMesh().cells();
499 const faceList& oldFaces = baseMesh().faces();
500 const pointField& oldPoints = baseMesh().points();
501 const labelList& oldOwner = baseMesh().faceOwner();
502 const labelList& oldNeighbour = baseMesh().faceNeighbour();
504 label wantedPatchID = patchID;
506 if (wantedPatchID == -1)
510 wantedPatchID = oldPatches.
findIndex(
"oldInternalFaces");
512 else if (wantedPatchID < 0 || wantedPatchID >= oldPatches.
size())
515 <<
"Non-existing patch index " << wantedPatchID <<
endl
516 <<
"Should be between 0 and " << oldPatches.
size()-1
522 faceFlipMapPtr_.clear();
525 cellMap_ = globalCellMap.
toc();
531 const label avgNFacesPerCell = 6;
532 const label avgNPointsPerFace = 4;
535 const label nCellsInSet = cellMap_.size();
539 Map<label> facesToSubset(avgNFacesPerCell*nCellsInSet);
544 const labelList& curFaces = oldCells[cellMap_[celli]];
548 if (!facesToSubset.
found(curFaces[facei]))
550 facesToSubset.
insert(curFaces[facei], 1);
554 facesToSubset[curFaces[facei]]++;
561 doCoupledPatches(syncPar, facesToSubset, empty);
567 Map<label> globalPointMap(avgNPointsPerFace*facesToSubset.
size());
574 faceMap_.setSize(facesToc.
size());
579 if (facesToSubset[facesToc[facei]] == 2)
582 faceMap_[globalFaceMap.
size()] = facesToc[facei];
583 globalFaceMap.
insert(facesToc[facei], globalFaceMap.
size());
586 markPoints(oldFaces[facesToc[facei]], globalPointMap);
591 const label nInternalFaces = globalFaceMap.
size();
596 if (wantedPatchID != -1)
598 oldPatchStart = oldPatches[wantedPatchID].start();
605 for (; facei< facesToc.
size(); facei++)
607 if (facesToc[facei] >= oldPatchStart)
613 !baseMesh().isInternalFace(facesToc[facei])
614 && facesToSubset[facesToc[facei]] == 1
618 faceMap_[globalFaceMap.
size()] = facesToc[facei];
619 globalFaceMap.
insert(facesToc[facei], globalFaceMap.
size());
622 markPoints(oldFaces[facesToc[facei]], globalPointMap);
627 forAll(facesToc, intFacei)
632 baseMesh().isInternalFace(facesToc[intFacei])
633 && facesToSubset[facesToc[intFacei]] == 1
636 !baseMesh().isInternalFace(facesToc[intFacei])
637 && facesToSubset[facesToc[intFacei]] == 3
642 faceMap_[globalFaceMap.
size()] = facesToc[intFacei];
643 globalFaceMap.
insert(facesToc[intFacei], globalFaceMap.
size());
646 markPoints(oldFaces[facesToc[intFacei]], globalPointMap);
651 for (; facei< facesToc.
size(); facei++)
655 !baseMesh().isInternalFace(facesToc[facei])
656 && facesToSubset[facesToc[facei]] == 1
660 faceMap_[globalFaceMap.
size()] = facesToc[facei];
661 globalFaceMap.
insert(facesToc[facei], globalFaceMap.
size());
664 markPoints(oldFaces[facesToc[facei]], globalPointMap);
671 pointMap_ = globalPointMap.
toc();
676 globalPointMap[pointMap_[pointi]] = pointi;
682 label nNewPoints = 0;
686 newPoints[nNewPoints] = oldPoints[pointMap_[pointi]];
695 for (
label facei = 0; facei < nInternalFaces; facei++)
697 const face& oldF = oldFaces[faceMap_[facei]];
703 newF[i] = globalPointMap[oldF[i]];
706 newFaces[nNewFaces] = newF;
713 label oldInternalPatchID = -1;
715 if (wantedPatchID == -1)
719 oldInternalPatchID = nbSize;
725 oldInternalPatchID = wantedPatchID;
735 for (
label facei = nInternalFaces; facei < faceMap_.size(); facei++)
737 const label oldFacei = faceMap_[facei];
739 face oldF = oldFaces[oldFacei];
742 if (baseMesh().isInternalFace(oldFacei))
747 !globalCellMap.
found(oldOwner[oldFacei])
748 && globalCellMap.
found(oldNeighbour[oldFacei])
751 oldF = oldFaces[oldFacei].reverseFace();
755 boundaryPatchSizes[oldInternalPatchID]++;
757 else if (facesToSubset[oldFacei] == 3)
760 boundaryPatchSizes[oldInternalPatchID]++;
768 boundaryPatchSizes[patchOfFace]++;
775 newF[i] = globalPointMap[oldF[i]];
778 newFaces[nNewFaces] = newF;
791 const labelList& oldC = oldCells[cellMap_[celli]];
797 newC[i] = globalFaceMap[oldC[i]];
800 newCells[nNewCells] =
cell(newC);
806 fvMeshSubsetPtr_.clear();
809 fvMeshSubsetPtr_.reset
815 baseMesh().
name() +
"SubSet",
816 baseMesh().time().
name(),
830 patchMap_.setSize(nbSize);
831 label nNewPatches = 0;
832 label patchStart = nInternalFaces;
837 if (boundaryPatchSizes[
patchi] > 0)
840 newBoundary[nNewPatches] = oldPatches[
patchi].
clone
842 fvMeshSubsetPtr_().boundaryMesh(),
844 boundaryPatchSizes[
patchi],
848 patchStart += boundaryPatchSizes[
patchi];
849 patchMap_[nNewPatches] =
patchi;
854 if (wantedPatchID == -1)
857 if (boundaryPatchSizes[oldInternalPatchID] > 0)
862 boundaryPatchSizes[oldInternalPatchID],
865 fvMeshSubsetPtr_().boundaryMesh(),
866 internalPolyPatch::typeName
871 patchMap_[nNewPatches] = -1;
881 newBoundary.
setSize(nNewPatches);
882 patchMap_.setSize(nNewPatches);
885 fvMeshSubsetPtr_().addFvPatches(newBoundary);
895 const label currentRegion,
900 const cellList& oldCells = baseMesh().cells();
901 const faceList& oldFaces = baseMesh().faces();
902 const pointField& oldPoints = baseMesh().points();
903 const labelList& oldOwner = baseMesh().faceOwner();
904 const labelList& oldNeighbour = baseMesh().faceNeighbour();
906 const label oldNInternalFaces = baseMesh().nInternalFaces();
910 if (region.
size() != oldCells.
size())
913 <<
"Size of region " << region.
size()
914 <<
" is not equal to number of cells in mesh " << oldCells.
size()
919 label wantedPatchID = patchID;
921 if (wantedPatchID == -1)
925 wantedPatchID = oldPatches.
findIndex(
"oldInternalFaces");
927 else if (wantedPatchID < 0 || wantedPatchID >= oldPatches.
size())
930 <<
"Non-existing patch index " << wantedPatchID <<
endl
931 <<
"Should be between 0 and " << oldPatches.
size()-1
936 faceFlipMapPtr_.clear();
939 cellMap_.setSize(oldCells.
size());
940 label nCellsInSet = 0;
944 if (region[oldCelli] == currentRegion)
946 cellMap_[nCellsInSet++] = oldCelli;
949 cellMap_.setSize(nCellsInSet);
964 label nFacesInSet = 0;
965 forAll(oldFaces, oldFacei)
967 bool faceUsed =
false;
969 if (region[oldOwner[oldFacei]] == currentRegion)
971 nCellsUsingFace[oldFacei]++;
977 baseMesh().isInternalFace(oldFacei)
978 && (region[oldNeighbour[oldFacei]] == currentRegion)
981 nCellsUsingFace[oldFacei]++;
994 doCoupledPatches(syncPar, empty, nCellsUsingFace);
998 label oldInternalPatchID = 0;
1009 if (wantedPatchID == -1)
1017 if (isA<processorPolyPatch>(oldPatches[
patchi]))
1022 oldInternalPatchID++;
1028 for (
label oldPatchi = 0; oldPatchi < nextPatchID; oldPatchi++)
1030 globalPatchMap[oldPatchi] = oldPatchi;
1034 label oldPatchi = nextPatchID;
1035 oldPatchi < oldPatches.
size();
1039 globalPatchMap[oldPatchi] = oldPatchi + 1;
1044 oldInternalPatchID = wantedPatchID;
1045 nextPatchID = wantedPatchID + 1;
1051 labelList boundaryPatchSizes(nbSize, 0);
1061 for (
label oldFacei = 0; oldFacei < oldNInternalFaces; oldFacei++)
1063 if (nCellsUsingFace[oldFacei] == 2)
1065 globalFaceMap[oldFacei] = facei;
1066 faceMap_[facei++] = oldFacei;
1069 markPoints(oldFaces[oldFacei], globalPointMap);
1074 label nInternalFaces = facei;
1079 label oldPatchi = 0;
1080 oldPatchi < oldPatches.
size()
1081 && oldPatchi < nextPatchID;
1085 const polyPatch& oldPatch = oldPatches[oldPatchi];
1091 if (nCellsUsingFace[oldFacei] == 1)
1096 globalFaceMap[oldFacei] = facei;
1097 faceMap_[facei++] = oldFacei;
1100 markPoints(oldFaces[oldFacei], globalPointMap);
1103 boundaryPatchSizes[globalPatchMap[oldPatchi]]++;
1110 for (
label oldFacei = 0; oldFacei < oldNInternalFaces; oldFacei++)
1112 if (nCellsUsingFace[oldFacei] == 1)
1114 globalFaceMap[oldFacei] = facei;
1115 faceMap_[facei++] = oldFacei;
1118 markPoints(oldFaces[oldFacei], globalPointMap);
1121 boundaryPatchSizes[oldInternalPatchID]++;
1128 label oldFacei = oldNInternalFaces;
1129 oldFacei < oldFaces.
size();
1133 if (nCellsUsingFace[oldFacei] == 3)
1135 globalFaceMap[oldFacei] = facei;
1136 faceMap_[facei++] = oldFacei;
1139 markPoints(oldFaces[oldFacei], globalPointMap);
1142 boundaryPatchSizes[oldInternalPatchID]++;
1149 label oldPatchi = nextPatchID;
1150 oldPatchi < oldPatches.
size();
1154 const polyPatch& oldPatch = oldPatches[oldPatchi];
1160 if (nCellsUsingFace[oldFacei] == 1)
1165 globalFaceMap[oldFacei] = facei;
1166 faceMap_[facei++] = oldFacei;
1169 markPoints(oldFaces[oldFacei], globalPointMap);
1172 boundaryPatchSizes[globalPatchMap[oldPatchi]]++;
1178 if (facei != nFacesInSet)
1186 label nPointsInSet = 0;
1188 forAll(globalPointMap, pointi)
1190 if (globalPointMap[pointi] != -1)
1195 pointMap_.setSize(nPointsInSet);
1199 forAll(globalPointMap, pointi)
1201 if (globalPointMap[pointi] != -1)
1203 pointMap_[nPointsInSet] = pointi;
1204 globalPointMap[pointi] = nPointsInSet;
1213 label nNewPoints = 0;
1215 forAll(pointMap_, pointi)
1217 newPoints[nNewPoints] = oldPoints[pointMap_[pointi]];
1221 faceList newFaces(faceMap_.size());
1223 label nNewFaces = 0;
1226 for (
label facei = 0; facei < nInternalFaces; facei++)
1228 const face& oldF = oldFaces[faceMap_[facei]];
1234 newF[i] = globalPointMap[oldF[i]];
1237 newFaces[nNewFaces] = newF;
1244 for (
label facei = nInternalFaces; facei < faceMap_.size(); facei++)
1246 const label oldFacei = faceMap_[facei];
1248 face oldF = oldFaces[oldFacei];
1251 if (baseMesh().isInternalFace(oldFacei))
1256 region[oldOwner[oldFacei]] != currentRegion
1257 && region[oldNeighbour[oldFacei]] == currentRegion
1260 oldF = oldFaces[oldFacei].reverseFace();
1269 newF[i] = globalPointMap[oldF[i]];
1272 newFaces[nNewFaces] = newF;
1281 label nNewCells = 0;
1285 const labelList& oldC = oldCells[cellMap_[celli]];
1291 newC[i] = globalFaceMap[oldC[i]];
1294 newCells[nNewCells] =
cell(newC);
1300 fvMeshSubsetPtr_.clear();
1308 fvMeshSubsetPtr_.reset
1315 baseMesh().time().
name(),
1329 patchMap_.setSize(nbSize);
1330 label nNewPatches = 0;
1331 label patchStart = nInternalFaces;
1339 labelList globalPatchSizes(boundaryPatchSizes);
1340 globalPatchSizes.
setSize(nextPatchID);
1360 bool samePatches =
true;
1366 samePatches =
false;
1384 label oldPatchi = 0;
1385 oldPatchi < oldPatches.
size()
1386 && oldPatchi < nextPatchID;
1390 const label newSize = boundaryPatchSizes[globalPatchMap[oldPatchi]];
1393 newBoundary[nNewPatches] = oldPatches[oldPatchi].
clone
1395 fvMeshSubsetPtr_().boundaryMesh(),
1401 patchStart += newSize;
1402 patchMap_[nNewPatches] = oldPatchi;
1408 if (wantedPatchID == -1)
1410 label oldInternalSize = boundaryPatchSizes[oldInternalPatchID];
1418 if (oldInternalSize > 0)
1423 boundaryPatchSizes[oldInternalPatchID],
1426 fvMeshSubsetPtr_().boundaryMesh(),
1427 internalPolyPatch::typeName
1432 patchStart += boundaryPatchSizes[oldInternalPatchID];
1433 patchMap_[nNewPatches] = -1;
1446 label oldPatchi = nextPatchID;
1447 oldPatchi < oldPatches.
size();
1451 const label newSize = boundaryPatchSizes[globalPatchMap[oldPatchi]];
1454 newBoundary[nNewPatches] = oldPatches[oldPatchi].
clone
1456 fvMeshSubsetPtr_().boundaryMesh(),
1462 patchStart += newSize;
1463 patchMap_[nNewPatches] = oldPatchi;
1469 newBoundary.
setSize(nNewPatches);
1470 patchMap_.setSize(nNewPatches);
1474 fvMeshSubsetPtr_().addFvPatches(newBoundary, syncPar);
1484 const label patchID,
1488 labelList region(baseMesh().nCells(), 0);
1492 region[iter.key()] = 1;
1494 setLargeCellSubset(region, 1, patchID, syncPar);
1501 const label currentRegion,
1502 const bool syncCouples
1506 const labelList cellsToRemove(getCellsToRemove(region, currentRegion));
1515 const label currentRegion,
1518 const bool syncCouples
1522 labelList cellsToRemove(getCellsToRemove(region, currentRegion));
1544 baseMesh().time().
name(),
1553 pointMap_ = map().pointMap();
1554 faceMap_ = map().faceMap();
1555 cellMap_ = map().cellMap();
1556 patchMap_ =
identityMap(baseMesh().boundaryMesh().size());
1562 return fvMeshSubsetPtr_.valid();
1570 return fvMeshSubsetPtr_();
1578 return fvMeshSubsetPtr_();
1600 if (!faceFlipMapPtr_.valid())
1603 const labelList& subToBaseCell = cellMap();
1606 labelList& faceFlipMap = faceFlipMapPtr_();
1610 label subInt = subMesh().nInternalFaces();
1611 const labelList& subOwn = subMesh().faceOwner();
1612 const labelList& own = baseMesh_.faceOwner();
1614 for (
label subFacei = 0; subFacei < subInt; subFacei++)
1616 faceFlipMap[subFacei] = subToBaseFace[subFacei] + 1;
1618 for (
label subFacei = subInt; subFacei < subOwn.
size(); subFacei++)
1620 const label facei = subToBaseFace[subFacei];
1621 if (subToBaseCell[subOwn[subFacei]] == own[facei])
1623 faceFlipMap[subFacei] = facei + 1;
1627 faceFlipMap[subFacei] = -facei - 1;
1632 return faceFlipMapPtr_();
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
List< Key > toc() const
Return the table of contents.
label size() const
Return number of elements in table.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
bool found(const Key &) const
Return true if hashedEntry is found in table.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
autoPtr< IOobject > clone() const
Clone.
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
static void scatterList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Scatter data. Reverse of gatherList.
static void listCombineGather(const List< commsStruct > &comms, List< T > &Value, const CombineOp &cop, const int tag, const label comm)
static void listCombineScatter(const List< commsStruct > &comms, List< T > &Value, const int tag, const label comm)
Scatter data. Reverse of combineGather.
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
static bool & parRun()
Is this a parallel run?
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
label size() const
Return the number of elements in the UPtrList.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
A cell is defined as a list of faces with extra functionality.
A face is a list of labels corresponding to mesh vertices.
Post-processing mesh subset tool. Given the original mesh and the list of selected cells,...
const labelList & faceMap() const
Return face map.
void setCellSubset(const labelHashSet &globalCellMap, const label patchID=-1, const bool syncPar=true)
Set the subset. Create "oldInternalFaces" patch for exposed.
const labelList & cellMap() const
Return cell map.
fvMeshSubset(const fvMesh &)
Construct given a mesh to subset.
bool hasSubMesh() const
Have subMesh?
const labelList & faceFlipMap() const
Return face map with sign to encode flipped faces.
virtual ~fvMeshSubset()
Destructor.
void setLargeCellSubset(const labelList ®ion, const label currentRegion, const label patchID=-1, const bool syncCouples=true)
Set the subset from all cells with region == currentRegion.
const fvMesh & subMesh() const
Return reference to subset mesh.
const labelList & patchMap() const
Return patch map.
const labelList & pointMap() const
Return point map.
labelList getExposedFaces(const labelList ®ion, const label currentRegion, const bool syncCouples=true) const
Get labels of exposed faces.
Mesh data needed to do the Finite Volume discretisation.
Constraint patch to hold internal faces exposed by sub-setting.
label findIndex(const word &patchName) const
Find patch index given a name.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
wordList names() const
Return the list of patch names.
A patch is a list of labels that address the faces in the global face list.
label start() const
Return start label of this patch in the polyMesh face list.
Direct mesh changes based on v1.3 polyTopoChange syntax.
autoPtr< polyTopoChangeMap > makeMesh(autoPtr< fvMesh > &newMesh, const IOobject &io, const polyMesh &mesh, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
Create new mesh with old mesh patches.
Given list of cells to remove insert all the topology changes.
void setRefinement(const labelList &cellsToRemove, const labelList &facesToExpose, const labelList &patchIDs, polyTopoChange &) const
Play commands into polyTopoChange to remove cells.
labelList getExposedFaces(const labelList &cellsToRemove) const
Get labels of exposed faces.
Template functions to aid in the implementation of demand driven data.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
errorManip< error > abort(error &err)
List< bool > boolList
Bool container classes.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
defineTypeNameAndDebug(combustionModel, 0)
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
static const label labelMax
labelList identityMap(const label len)
Create identity map (map[i] == i) of given length.
ListType subset(const UList< T > &select, const T &value, const ListType &)
Extract elements of List when select is a certain value.
wordList patchNames(nPatches)