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];
364 const boolList& flipMap = fz.flipMap();
400 if (zone[meshFacei] != 0)
402 subAddressing[nSub] = subFacei;
403 const label subOwner = subMesh().faceOwner()[subFacei];
404 const label baseOwner = baseMesh().faceOwner()[meshFacei];
406 const bool sameOwner = (cellMap()[subOwner] == baseOwner);
407 const bool flip = (zone[meshFacei] == 1);
408 subFlipStatus[nSub] = (sameOwner == flip);
416 fZonePtrs[i] =
new faceZone
421 fvMeshSubsetPtr_().faceZones()
426 fZonePtrs[i] =
new faceZone
430 fvMeshSubsetPtr_().faceZones()
436 const cellZoneList& cellZones = baseMesh().cellZones();
438 List<cellZone*> cZonePtrs(cellZones.size());
442 const cellZone& cz = cellZones[i];
444 cZonePtrs[i] =
new cellZone
447 subset(baseMesh().nCells(), cz, cellMap()),
448 fvMeshSubsetPtr_().cellZones()
454 fvMeshSubsetPtr_().addZones(pZonePtrs, fZonePtrs, cZonePtrs);
461 const label currentRegion
468 if (region[cellI] == currentRegion)
475 label nRemove = baseMesh().nCells() - nKeep;
481 if (region[cellI] != currentRegion)
483 cellsToRemove[nRemove++] = cellI;
487 return cellsToRemove;
496 fvMeshSubsetPtr_(nullptr),
522 const cellList& oldCells = baseMesh().cells();
523 const faceList& oldFaces = baseMesh().faces();
524 const pointField& oldPoints = baseMesh().points();
525 const labelList& oldOwner = baseMesh().faceOwner();
526 const labelList& oldNeighbour = baseMesh().faceNeighbour();
528 label wantedPatchID = patchID;
530 if (wantedPatchID == -1)
534 wantedPatchID = oldPatches.
findIndex(
"oldInternalFaces");
536 else if (wantedPatchID < 0 || wantedPatchID >= oldPatches.
size())
539 <<
"Non-existing patch index " << wantedPatchID <<
endl
540 <<
"Should be between 0 and " << oldPatches.
size()-1
546 faceFlipMapPtr_.clear();
549 cellMap_ = globalCellMap.
toc();
555 const label avgNFacesPerCell = 6;
556 const label avgNPointsPerFace = 4;
559 const label nCellsInSet = cellMap_.size();
563 Map<label> facesToSubset(avgNFacesPerCell*nCellsInSet);
568 const labelList& curFaces = oldCells[cellMap_[celli]];
572 if (!facesToSubset.
found(curFaces[facei]))
574 facesToSubset.
insert(curFaces[facei], 1);
578 facesToSubset[curFaces[facei]]++;
585 doCoupledPatches(syncPar, facesToSubset, empty);
591 Map<label> globalPointMap(avgNPointsPerFace*facesToSubset.
size());
598 faceMap_.setSize(facesToc.
size());
603 if (facesToSubset[facesToc[facei]] == 2)
606 faceMap_[globalFaceMap.
size()] = facesToc[facei];
607 globalFaceMap.
insert(facesToc[facei], globalFaceMap.
size());
610 markPoints(oldFaces[facesToc[facei]], globalPointMap);
615 const label nInternalFaces = globalFaceMap.
size();
620 if (wantedPatchID != -1)
622 oldPatchStart = oldPatches[wantedPatchID].start();
629 for (; facei< facesToc.
size(); facei++)
631 if (facesToc[facei] >= oldPatchStart)
637 !baseMesh().isInternalFace(facesToc[facei])
638 && facesToSubset[facesToc[facei]] == 1
642 faceMap_[globalFaceMap.
size()] = facesToc[facei];
643 globalFaceMap.
insert(facesToc[facei], globalFaceMap.
size());
646 markPoints(oldFaces[facesToc[facei]], globalPointMap);
651 forAll(facesToc, intFacei)
656 baseMesh().isInternalFace(facesToc[intFacei])
657 && facesToSubset[facesToc[intFacei]] == 1
660 !baseMesh().isInternalFace(facesToc[intFacei])
661 && facesToSubset[facesToc[intFacei]] == 3
666 faceMap_[globalFaceMap.
size()] = facesToc[intFacei];
667 globalFaceMap.
insert(facesToc[intFacei], globalFaceMap.
size());
670 markPoints(oldFaces[facesToc[intFacei]], globalPointMap);
675 for (; facei< facesToc.
size(); facei++)
679 !baseMesh().isInternalFace(facesToc[facei])
680 && facesToSubset[facesToc[facei]] == 1
684 faceMap_[globalFaceMap.
size()] = facesToc[facei];
685 globalFaceMap.
insert(facesToc[facei], globalFaceMap.
size());
688 markPoints(oldFaces[facesToc[facei]], globalPointMap);
695 pointMap_ = globalPointMap.
toc();
700 globalPointMap[pointMap_[pointi]] = pointi;
706 label nNewPoints = 0;
710 newPoints[nNewPoints] = oldPoints[pointMap_[pointi]];
719 for (
label facei = 0; facei < nInternalFaces; facei++)
721 const face& oldF = oldFaces[faceMap_[facei]];
727 newF[i] = globalPointMap[oldF[i]];
730 newFaces[nNewFaces] = newF;
737 label oldInternalPatchID = -1;
739 if (wantedPatchID == -1)
743 oldInternalPatchID = nbSize;
749 oldInternalPatchID = wantedPatchID;
759 for (
label facei = nInternalFaces; facei < faceMap_.size(); facei++)
761 const label oldFacei = faceMap_[facei];
763 face oldF = oldFaces[oldFacei];
766 if (baseMesh().isInternalFace(oldFacei))
771 !globalCellMap.
found(oldOwner[oldFacei])
772 && globalCellMap.
found(oldNeighbour[oldFacei])
775 oldF = oldFaces[oldFacei].reverseFace();
779 boundaryPatchSizes[oldInternalPatchID]++;
781 else if (facesToSubset[oldFacei] == 3)
784 boundaryPatchSizes[oldInternalPatchID]++;
792 boundaryPatchSizes[patchOfFace]++;
799 newF[i] = globalPointMap[oldF[i]];
802 newFaces[nNewFaces] = newF;
815 const labelList& oldC = oldCells[cellMap_[celli]];
821 newC[i] = globalFaceMap[oldC[i]];
824 newCells[nNewCells] =
cell(newC);
830 fvMeshSubsetPtr_.clear();
833 fvMeshSubsetPtr_.reset
839 baseMesh().
name() +
"SubSet",
840 baseMesh().time().
name(),
854 patchMap_.setSize(nbSize);
855 label nNewPatches = 0;
856 label patchStart = nInternalFaces;
861 if (boundaryPatchSizes[
patchi] > 0)
864 newBoundary[nNewPatches] = oldPatches[
patchi].
clone
866 fvMeshSubsetPtr_().boundaryMesh(),
868 boundaryPatchSizes[
patchi],
872 patchStart += boundaryPatchSizes[
patchi];
873 patchMap_[nNewPatches] =
patchi;
878 if (wantedPatchID == -1)
881 if (boundaryPatchSizes[oldInternalPatchID] > 0)
886 boundaryPatchSizes[oldInternalPatchID],
889 fvMeshSubsetPtr_().boundaryMesh(),
890 internalPolyPatch::typeName
895 patchMap_[nNewPatches] = -1;
905 newBoundary.
setSize(nNewPatches);
906 patchMap_.setSize(nNewPatches);
909 fvMeshSubsetPtr_().addFvPatches(newBoundary);
919 const label currentRegion,
924 const cellList& oldCells = baseMesh().cells();
925 const faceList& oldFaces = baseMesh().faces();
926 const pointField& oldPoints = baseMesh().points();
927 const labelList& oldOwner = baseMesh().faceOwner();
928 const labelList& oldNeighbour = baseMesh().faceNeighbour();
930 const label oldNInternalFaces = baseMesh().nInternalFaces();
934 if (region.
size() != oldCells.
size())
937 <<
"Size of region " << region.
size()
938 <<
" is not equal to number of cells in mesh " << oldCells.
size()
943 label wantedPatchID = patchID;
945 if (wantedPatchID == -1)
949 wantedPatchID = oldPatches.
findIndex(
"oldInternalFaces");
951 else if (wantedPatchID < 0 || wantedPatchID >= oldPatches.
size())
954 <<
"Non-existing patch index " << wantedPatchID <<
endl
955 <<
"Should be between 0 and " << oldPatches.
size()-1
960 faceFlipMapPtr_.clear();
963 cellMap_.setSize(oldCells.
size());
964 label nCellsInSet = 0;
968 if (region[oldCelli] == currentRegion)
970 cellMap_[nCellsInSet++] = oldCelli;
973 cellMap_.setSize(nCellsInSet);
988 label nFacesInSet = 0;
989 forAll(oldFaces, oldFacei)
991 bool faceUsed =
false;
993 if (region[oldOwner[oldFacei]] == currentRegion)
995 nCellsUsingFace[oldFacei]++;
1001 baseMesh().isInternalFace(oldFacei)
1002 && (region[oldNeighbour[oldFacei]] == currentRegion)
1005 nCellsUsingFace[oldFacei]++;
1014 faceMap_.
setSize(nFacesInSet);
1018 doCoupledPatches(syncPar, empty, nCellsUsingFace);
1022 label oldInternalPatchID = 0;
1033 if (wantedPatchID == -1)
1041 if (isA<processorPolyPatch>(oldPatches[
patchi]))
1046 oldInternalPatchID++;
1052 for (
label oldPatchi = 0; oldPatchi < nextPatchID; oldPatchi++)
1054 globalPatchMap[oldPatchi] = oldPatchi;
1058 label oldPatchi = nextPatchID;
1059 oldPatchi < oldPatches.
size();
1063 globalPatchMap[oldPatchi] = oldPatchi + 1;
1068 oldInternalPatchID = wantedPatchID;
1069 nextPatchID = wantedPatchID + 1;
1075 labelList boundaryPatchSizes(nbSize, 0);
1085 for (
label oldFacei = 0; oldFacei < oldNInternalFaces; oldFacei++)
1087 if (nCellsUsingFace[oldFacei] == 2)
1089 globalFaceMap[oldFacei] = facei;
1090 faceMap_[facei++] = oldFacei;
1093 markPoints(oldFaces[oldFacei], globalPointMap);
1098 label nInternalFaces = facei;
1103 label oldPatchi = 0;
1104 oldPatchi < oldPatches.
size()
1105 && oldPatchi < nextPatchID;
1109 const polyPatch& oldPatch = oldPatches[oldPatchi];
1115 if (nCellsUsingFace[oldFacei] == 1)
1120 globalFaceMap[oldFacei] = facei;
1121 faceMap_[facei++] = oldFacei;
1124 markPoints(oldFaces[oldFacei], globalPointMap);
1127 boundaryPatchSizes[globalPatchMap[oldPatchi]]++;
1134 for (
label oldFacei = 0; oldFacei < oldNInternalFaces; oldFacei++)
1136 if (nCellsUsingFace[oldFacei] == 1)
1138 globalFaceMap[oldFacei] = facei;
1139 faceMap_[facei++] = oldFacei;
1142 markPoints(oldFaces[oldFacei], globalPointMap);
1145 boundaryPatchSizes[oldInternalPatchID]++;
1152 label oldFacei = oldNInternalFaces;
1153 oldFacei < oldFaces.
size();
1157 if (nCellsUsingFace[oldFacei] == 3)
1159 globalFaceMap[oldFacei] = facei;
1160 faceMap_[facei++] = oldFacei;
1163 markPoints(oldFaces[oldFacei], globalPointMap);
1166 boundaryPatchSizes[oldInternalPatchID]++;
1173 label oldPatchi = nextPatchID;
1174 oldPatchi < oldPatches.
size();
1178 const polyPatch& oldPatch = oldPatches[oldPatchi];
1184 if (nCellsUsingFace[oldFacei] == 1)
1189 globalFaceMap[oldFacei] = facei;
1190 faceMap_[facei++] = oldFacei;
1193 markPoints(oldFaces[oldFacei], globalPointMap);
1196 boundaryPatchSizes[globalPatchMap[oldPatchi]]++;
1202 if (facei != nFacesInSet)
1210 label nPointsInSet = 0;
1212 forAll(globalPointMap, pointi)
1214 if (globalPointMap[pointi] != -1)
1219 pointMap_.setSize(nPointsInSet);
1223 forAll(globalPointMap, pointi)
1225 if (globalPointMap[pointi] != -1)
1227 pointMap_[nPointsInSet] = pointi;
1228 globalPointMap[pointi] = nPointsInSet;
1237 label nNewPoints = 0;
1239 forAll(pointMap_, pointi)
1241 newPoints[nNewPoints] = oldPoints[pointMap_[pointi]];
1245 faceList newFaces(faceMap_.size());
1247 label nNewFaces = 0;
1250 for (
label facei = 0; facei < nInternalFaces; facei++)
1252 const face& oldF = oldFaces[faceMap_[facei]];
1258 newF[i] = globalPointMap[oldF[i]];
1261 newFaces[nNewFaces] = newF;
1268 for (
label facei = nInternalFaces; facei < faceMap_.size(); facei++)
1270 const label oldFacei = faceMap_[facei];
1272 face oldF = oldFaces[oldFacei];
1275 if (baseMesh().isInternalFace(oldFacei))
1280 region[oldOwner[oldFacei]] != currentRegion
1281 && region[oldNeighbour[oldFacei]] == currentRegion
1284 oldF = oldFaces[oldFacei].reverseFace();
1293 newF[i] = globalPointMap[oldF[i]];
1296 newFaces[nNewFaces] = newF;
1305 label nNewCells = 0;
1309 const labelList& oldC = oldCells[cellMap_[celli]];
1315 newC[i] = globalFaceMap[oldC[i]];
1318 newCells[nNewCells] =
cell(newC);
1324 fvMeshSubsetPtr_.clear();
1332 fvMeshSubsetPtr_.reset
1339 baseMesh().time().
name(),
1353 patchMap_.setSize(nbSize);
1354 label nNewPatches = 0;
1355 label patchStart = nInternalFaces;
1363 labelList globalPatchSizes(boundaryPatchSizes);
1364 globalPatchSizes.
setSize(nextPatchID);
1384 bool samePatches =
true;
1390 samePatches =
false;
1408 label oldPatchi = 0;
1409 oldPatchi < oldPatches.
size()
1410 && oldPatchi < nextPatchID;
1414 const label newSize = boundaryPatchSizes[globalPatchMap[oldPatchi]];
1417 newBoundary[nNewPatches] = oldPatches[oldPatchi].
clone
1419 fvMeshSubsetPtr_().boundaryMesh(),
1425 patchStart += newSize;
1426 patchMap_[nNewPatches] = oldPatchi;
1432 if (wantedPatchID == -1)
1434 label oldInternalSize = boundaryPatchSizes[oldInternalPatchID];
1442 if (oldInternalSize > 0)
1447 boundaryPatchSizes[oldInternalPatchID],
1450 fvMeshSubsetPtr_().boundaryMesh(),
1451 internalPolyPatch::typeName
1456 patchStart += boundaryPatchSizes[oldInternalPatchID];
1457 patchMap_[nNewPatches] = -1;
1470 label oldPatchi = nextPatchID;
1471 oldPatchi < oldPatches.
size();
1475 const label newSize = boundaryPatchSizes[globalPatchMap[oldPatchi]];
1478 newBoundary[nNewPatches] = oldPatches[oldPatchi].
clone
1480 fvMeshSubsetPtr_().boundaryMesh(),
1486 patchStart += newSize;
1487 patchMap_[nNewPatches] = oldPatchi;
1493 newBoundary.
setSize(nNewPatches);
1494 patchMap_.setSize(nNewPatches);
1498 fvMeshSubsetPtr_().addFvPatches(newBoundary, syncPar);
1508 const label patchID,
1512 labelList region(baseMesh().nCells(), 0);
1516 region[iter.key()] = 1;
1518 setLargeCellSubset(region, 1, patchID, syncPar);
1525 const label currentRegion,
1526 const bool syncCouples
1530 const labelList cellsToRemove(getCellsToRemove(region, currentRegion));
1539 const label currentRegion,
1542 const bool syncCouples
1546 labelList cellsToRemove(getCellsToRemove(region, currentRegion));
1568 baseMesh().time().
name(),
1577 pointMap_ = map().pointMap();
1578 faceMap_ = map().faceMap();
1579 cellMap_ = map().cellMap();
1580 patchMap_ =
identityMap(baseMesh().boundaryMesh().size());
1586 return fvMeshSubsetPtr_.valid();
1594 return fvMeshSubsetPtr_();
1602 return fvMeshSubsetPtr_();
1624 if (!faceFlipMapPtr_.valid())
1627 const labelList& subToBaseCell = cellMap();
1630 labelList& faceFlipMap = faceFlipMapPtr_();
1634 label subInt = subMesh().nInternalFaces();
1635 const labelList& subOwn = subMesh().faceOwner();
1636 const labelList& own = baseMesh_.faceOwner();
1638 for (
label subFacei = 0; subFacei < subInt; subFacei++)
1640 faceFlipMap[subFacei] = subToBaseFace[subFacei] + 1;
1642 for (
label subFacei = subInt; subFacei < subOwn.
size(); subFacei++)
1644 const label facei = subToBaseFace[subFacei];
1645 if (subToBaseCell[subOwn[subFacei]] == own[facei])
1647 faceFlipMap[subFacei] = facei + 1;
1651 faceFlipMap[subFacei] = -facei - 1;
1656 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.
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)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
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)