48 DynamicList<word>& allPatchNames,
49 DynamicList<word>& allPatchTypes
54 const word& pType = p.type();
55 const word& pName = p.name();
62 allPatchNames.append(pName);
63 allPatchTypes.append(pType);
65 return allPatchNames.size() - 1;
67 else if (allPatchTypes[patchi] == pType)
78 const word& caseName = p.boundaryMesh().mesh().time().caseName();
80 allPatchNames.append(pName +
"_" + caseName);
81 allPatchTypes.append(pType);
83 Pout<<
"label patchIndex(const polyPatch& p) : " 84 <<
"Patch " << p.index() <<
" named " 85 << pName <<
" in mesh " << caseName
86 <<
" already exists, but patch types" 87 <<
" do not match.\nCreating a composite name as " 88 << allPatchNames.last() <<
endl;
90 return allPatchNames.size() - 1;
99 DynamicList<word>& names
111 names.append(curName);
113 return names.size() - 1;
118 void Foam::polyMeshAdder::mergePatchNames
120 const polyBoundaryMesh& patches0,
121 const polyBoundaryMesh& patches1,
123 DynamicList<word>& allPatchNames,
124 DynamicList<word>& allPatchTypes,
131 allPatchNames.append(patches0.names());
132 allPatchTypes.append(patches0.types());
142 from1ToAllPatches.setSize(patches1.size());
146 from1ToAllPatches[
patchi] = patchIndex
153 allPatchTypes.shrink();
154 allPatchNames.shrink();
157 fromAllTo1Patches.setSize(allPatchNames.size());
158 fromAllTo1Patches = -1;
160 forAll(from1ToAllPatches, i)
162 fromAllTo1Patches[from1ToAllPatches[i]] = i;
169 const polyBoundaryMesh& patches
183 const polyBoundaryMesh& patches
197 const polyMesh& mesh0,
198 const polyMesh& mesh1,
199 const polyBoundaryMesh& allBoundaryMesh,
200 const label nAllPatches,
203 const label nInternalFaces,
210 const polyBoundaryMesh& patches0 = mesh0.boundaryMesh();
211 const polyBoundaryMesh& patches1 = mesh1.boundaryMesh();
215 DynamicList<polyPatch*> allPatches(nAllPatches);
219 from0ToAllPatches.setSize(patches0.size());
220 from0ToAllPatches = -1;
222 label startFacei = nInternalFaces;
230 label filteredPatchi;
232 if (nFaces[patchi] == 0 && isA<processorPolyPatch>(patches0[patchi]))
240 filteredPatchi = allPatches.size();
244 patches0[patchi].
clone 252 startFacei += nFaces[
patchi];
256 from0ToAllPatches[
patchi] = filteredPatchi;
259 if (fromAllTo1Patches[patchi] != -1)
261 from1ToAllPatches[fromAllTo1Patches[
patchi]] = filteredPatchi;
266 forAll(from1ToAllPatches, patchi)
270 if (allPatchi >= patches0.size())
274 label filteredPatchi;
278 nFaces[allPatchi] == 0
279 && isA<processorPolyPatch>(patches1[patchi])
288 filteredPatchi = allPatches.size();
292 patches1[patchi].
clone 300 startFacei += nFaces[allPatchi];
303 from1ToAllPatches[
patchi] = filteredPatchi;
309 return move(allPatches);
316 const label nInternalFaces,
324 for (
label facei = nInternalFaces; facei < owner.size(); ++facei)
326 oldToNew[facei] = facei;
336 SortableList<label> nbr(cFaces.size());
340 label facei = cFaces[i];
342 label nbrCelli = neighbour[facei];
347 if (nbrCelli == celli)
349 nbrCelli = owner[facei];
352 if (celli < nbrCelli)
376 oldToNew[cFaces[nbr.indices()[i]]] = newFacei++;
385 if (oldToNew[facei] == -1)
388 <<
"Did not determine new position" 389 <<
" for face " << facei
400 void Foam::polyMeshAdder::insertVertices
403 const Map<label>& meshToMaster,
407 DynamicList<label>& workFace,
418 label v0 = masterF[fp];
419 label v1 = masterF.nextLabel(fp);
422 workFace.append(allF[fp]);
427 if (v0Fnd != meshToMaster.end())
430 if (v1Fnd != meshToMaster.end())
435 masterToCutPoints[v0Fnd()],
436 masterToCutPoints[v1Fnd()]
441 if (iter != cutEdgeToPoints.end())
443 const edge& e = iter.key();
447 if (e[0] == cutEdge[0])
451 workFace.append(addedPoints[i]);
458 workFace.append(addedPoints[i]);
466 if (workFace.size() != allF.size())
468 allF.transfer(workFace);
485 void Foam::polyMeshAdder::mergePrimitives
487 const polyMesh& mesh0,
488 const polyMesh& mesh1,
489 const faceCoupleInfo& coupleInfo,
491 const label nAllPatches,
502 label& nInternalFaces,
511 const polyBoundaryMesh& patches0 = mesh0.boundaryMesh();
512 const polyBoundaryMesh& patches1 = mesh1.boundaryMesh();
523 allPoints.setSize(mesh0.nPoints() + mesh1.nPoints());
526 from0ToAllPoints.setSize(mesh0.nPoints());
527 from0ToAllPoints = -1;
528 from1ToAllPoints.setSize(mesh1.nPoints());
529 from1ToAllPoints = -1;
533 const pointField& cutPoints = coupleInfo.cutPoints();
542 coupleInfo.masterToCutPoints()
553 coupleInfo.slaveToCutPoints()
559 allPoints[allPointi] = cutPoints[i];
563 const labelList& masterPoints = cutToMasterPoints[i];
567 label mesh0Pointi = masterPatch.meshPoints()[masterPoints[j]];
568 from0ToAllPoints[mesh0Pointi] = allPointi;
571 const labelList& slavePoints = cutToSlavePoints[i];
575 label mesh1Pointi = slavePatch.meshPoints()[slavePoints[j]];
576 from1ToAllPoints[mesh1Pointi] = allPointi;
583 forAll(mesh0.points(), pointi)
585 if (from0ToAllPoints[pointi] == -1)
587 allPoints[allPointi] = mesh0.points()[pointi];
588 from0ToAllPoints[pointi] = allPointi;
594 forAll(mesh1.points(), pointi)
596 if (from1ToAllPoints[pointi] == -1)
598 allPoints[allPointi] = mesh1.points()[pointi];
599 from1ToAllPoints[pointi] = allPointi;
604 allPoints.setSize(allPointi);
611 nFacesPerPatch.setSize(nAllPatches);
615 allFaces.setSize(mesh0.nFaces() + mesh1.nFaces());
616 allOwner.setSize(allFaces.size());
618 allNeighbour.setSize(allFaces.size());
622 from0ToAllFaces.setSize(mesh0.nFaces());
623 from0ToAllFaces = -1;
624 from1ToAllFaces.setSize(mesh1.nFaces());
625 from1ToAllFaces = -1;
628 for (
label facei = 0; facei < mesh0.nInternalFaces(); facei++)
630 allFaces[allFacei] =
renumber(from0ToAllPoints, mesh0.faces()[facei]);
631 allOwner[allFacei] = mesh0.faceOwner()[facei];
632 allNeighbour[allFacei] = mesh0.faceNeighbour()[facei];
633 from0ToAllFaces[facei] = allFacei++;
638 const labelList& cutToMasterFaces = coupleInfo.cutToMasterFaces();
639 const labelList& cutToSlaveFaces = coupleInfo.cutToSlaveFaces();
643 label masterFacei = cutToMasterFaces[i];
645 label mesh0Facei = masterPatch.addressing()[masterFacei];
647 if (from0ToAllFaces[mesh0Facei] == -1)
650 from0ToAllFaces[mesh0Facei] = allFacei;
653 label patch0 = patches0.whichPatch(mesh0Facei);
654 nFacesPerPatch[patch0]--;
657 label slaveFacei = cutToSlaveFaces[i];
659 label mesh1Facei = slavePatch.addressing()[slaveFacei];
661 if (from1ToAllFaces[mesh1Facei] == -1)
663 from1ToAllFaces[mesh1Facei] = allFacei;
665 label patch1 = patches1.whichPatch(mesh1Facei);
666 nFacesPerPatch[from1ToAllPatches[patch1]]--;
671 allFaces[allFacei] = cutFaces[i];
672 allOwner[allFacei] = mesh0.faceOwner()[mesh0Facei];
673 allNeighbour[allFacei] = mesh1.faceOwner()[mesh1Facei] + mesh0.nCells();
679 for (
label facei = 0; facei < mesh1.nInternalFaces(); facei++)
681 allFaces[allFacei] =
renumber(from1ToAllPoints, mesh1.faces()[facei]);
682 allOwner[allFacei] = mesh1.faceOwner()[facei] + mesh0.nCells();
683 allNeighbour[allFacei] = mesh1.faceNeighbour()[facei] + mesh0.nCells();
684 from1ToAllFaces[facei] = allFacei++;
687 nInternalFaces = allFacei;
690 for (
label allPatchi = 0; allPatchi < nAllPatches; allPatchi++)
692 if (allPatchi < patches0.size())
695 const polyPatch& pp = patches0[allPatchi];
697 nFacesPerPatch[allPatchi] += pp.size();
699 label facei = pp.start();
703 if (from0ToAllFaces[facei] == -1)
711 allOwner[allFacei] = mesh0.faceOwner()[facei];
712 allNeighbour[allFacei] = -1;
714 from0ToAllFaces[facei] = allFacei++;
719 if (fromAllTo1Patches[allPatchi] != -1)
722 const polyPatch& pp = patches1[fromAllTo1Patches[allPatchi]];
724 nFacesPerPatch[allPatchi] += pp.size();
726 label facei = pp.start();
730 if (from1ToAllFaces[facei] == -1)
739 mesh1.faceOwner()[facei]
741 allNeighbour[allFacei] = -1;
743 from1ToAllFaces[facei] = allFacei++;
749 allFaces.setSize(allFacei);
750 allOwner.setSize(allFacei);
751 allNeighbour.setSize(allFacei);
766 const edgeLookup& cutEdgeToPoints = coupleInfo.cutEdgeToPoints();
771 forAll(cutToMasterFaces, i)
773 label meshFacei = masterPatch.addressing()[cutToMasterFaces[i]];
775 masterCutFaces.insert(meshFacei);
778 DynamicList<label> workFace(100);
780 forAll(from0ToAllFaces, face0)
782 if (!masterCutFaces.found(face0))
784 label allFacei = from0ToAllFaces[face0];
789 masterPatch.meshPointMap(),
790 coupleInfo.masterToCutPoints(),
791 mesh0.faces()[face0],
802 forAll(cutToSlaveFaces, i)
804 label meshFacei = slavePatch.addressing()[cutToSlaveFaces[i]];
806 slaveCutFaces.insert(meshFacei);
809 forAll(from1ToAllFaces, face1)
811 if (!slaveCutFaces.found(face1))
813 label allFacei = from1ToAllFaces[face1];
818 slavePatch.meshPointMap(),
819 coupleInfo.slaveToCutPoints(),
820 mesh1.faces()[face1],
835 from1ToAllCells.setSize(mesh1.nCells());
836 from1ToAllCells = -1;
840 from1ToAllCells[i] = i + mesh0.nCells();
844 nCells = mesh0.nCells() + mesh1.nCells();
846 primitiveMesh::calcCells(allCells, allOwner, allNeighbour, nCells);
868 void Foam::polyMeshAdder::mergePointZones
870 const label nAllPoints,
876 DynamicList<word>& zoneNames,
878 List<DynamicList<label>>& pzPoints
881 zoneNames.setCapacity(pz0.size() + pz1.size());
882 zoneNames.append(pz0.names());
884 from1ToAll.setSize(pz1.size());
888 from1ToAll[zoneI] = zoneIndex(pz1[zoneI].
name(), zoneNames);
904 const pointZone& pz = pz0[zoneI];
908 label point0 = pz[i];
909 label allPointi = from0ToAllPoints[point0];
911 if (pointToZone[allPointi] == -1)
913 pointToZone[allPointi] = zoneI;
915 else if (pointToZone[allPointi] != zoneI)
917 labelList& pZones = addPointToZones[allPointi];
929 const pointZone& pz = pz1[zoneI];
930 const label allZoneI = from1ToAll[zoneI];
934 label point1 = pz[i];
935 label allPointi = from1ToAllPoints[point1];
937 if (pointToZone[allPointi] == -1)
939 pointToZone[allPointi] = allZoneI;
941 else if (pointToZone[allPointi] != allZoneI)
943 labelList& pZones = addPointToZones[allPointi];
956 forAll(pointToZone, allPointi)
958 label zoneI = pointToZone[allPointi];
964 forAll(addPointToZones, allPointi)
966 const labelList& pZones = addPointToZones[allPointi];
974 pzPoints.setSize(zoneNames.size());
977 pzPoints[zoneI].setCapacity(
nPoints[zoneI]);
979 forAll(pointToZone, allPointi)
981 label zoneI = pointToZone[allPointi];
984 pzPoints[zoneI].append(allPointi);
987 forAll(addPointToZones, allPointi)
989 const labelList& pZones = addPointToZones[allPointi];
992 pzPoints[pZones[i]].append(allPointi);
997 pzPoints[i].shrink();
1003 void Foam::polyMeshAdder::mergeFaceZones
1007 const polyMesh& mesh0,
1008 const polyMesh& mesh1,
1015 DynamicList<word>& zoneNames,
1017 List<DynamicList<label>>& fzFaces,
1018 List<DynamicList<bool>>& fzFlips
1022 const labelList& owner0 = mesh0.faceOwner();
1024 const labelList& owner1 = mesh1.faceOwner();
1027 zoneNames.setCapacity(fz0.size() + fz1.size());
1028 zoneNames.
append(fz0.names());
1030 from1ToAll.setSize(fz1.size());
1034 from1ToAll[zoneI] = zoneIndex(fz1[zoneI].
name(), zoneNames);
1040 labelList faceToZone(allOwner.size(), -1);
1042 boolList faceToFlip(allOwner.size(),
false);
1048 const labelList& addressing = fz0[zoneI];
1049 const boolList& flipMap = fz0[zoneI].flipMap();
1053 label face0 = addressing[i];
1054 bool flip0 = flipMap[i];
1056 label allFacei = from0ToAllFaces[face0];
1060 label allCell0 = owner0[face0];
1061 if (allOwner[allFacei] != allCell0)
1066 if (faceToZone[allFacei] == -1)
1068 faceToZone[allFacei] = zoneI;
1069 faceToFlip[allFacei] = flip0;
1071 else if (faceToZone[allFacei] != zoneI)
1073 labelList& fZones = addFaceToZones[allFacei];
1074 boolList& flipZones = addFaceToFlips[allFacei];
1079 flipZones.append(flip0);
1089 const labelList& addressing = fz1[zoneI];
1090 const boolList& flipMap = fz1[zoneI].flipMap();
1092 const label allZoneI = from1ToAll[zoneI];
1096 label face1 = addressing[i];
1097 bool flip1 = flipMap[i];
1099 label allFacei = from1ToAllFaces[face1];
1103 label allCell1 = from1ToAllCells[owner1[face1]];
1104 if (allOwner[allFacei] != allCell1)
1109 if (faceToZone[allFacei] == -1)
1111 faceToZone[allFacei] = allZoneI;
1112 faceToFlip[allFacei] = flip1;
1114 else if (faceToZone[allFacei] != allZoneI)
1116 labelList& fZones = addFaceToZones[allFacei];
1117 boolList& flipZones = addFaceToFlips[allFacei];
1122 flipZones.append(flip1);
1134 forAll(faceToZone, allFacei)
1136 label zoneI = faceToZone[allFacei];
1142 forAll(addFaceToZones, allFacei)
1144 const labelList& fZones = addFaceToZones[allFacei];
1147 nFaces[fZones[i]]++;
1152 fzFaces.setSize(zoneNames.size());
1153 fzFlips.setSize(zoneNames.size());
1156 fzFaces[zoneI].setCapacity(nFaces[zoneI]);
1157 fzFlips[zoneI].setCapacity(nFaces[zoneI]);
1159 forAll(faceToZone, allFacei)
1161 label zoneI = faceToZone[allFacei];
1162 bool flip = faceToFlip[allFacei];
1165 fzFaces[zoneI].append(allFacei);
1166 fzFlips[zoneI].append(flip);
1169 forAll(addFaceToZones, allFacei)
1171 const labelList& fZones = addFaceToZones[allFacei];
1172 const boolList& flipZones = addFaceToFlips[allFacei];
1176 label zoneI = fZones[i];
1177 fzFaces[zoneI].append(allFacei);
1178 fzFlips[zoneI].append(flipZones[i]);
1184 fzFaces[i].shrink();
1185 fzFlips[i].shrink();
1189 fzFaces[i] = UIndirectList<label>(fzFaces[i], order)();
1190 fzFlips[i] = UIndirectList<bool>(fzFlips[i], order)();
1195 void Foam::polyMeshAdder::mergeCellZones
1197 const label nAllCells,
1203 DynamicList<word>& zoneNames,
1205 List<DynamicList<label>>& czCells
1208 zoneNames.setCapacity(cz0.size() + cz1.size());
1209 zoneNames.append(cz0.names());
1211 from1ToAll.setSize(cz1.size());
1214 from1ToAll[zoneI] = zoneIndex(cz1[zoneI].
name(), zoneNames);
1229 const cellZone& cz = cz0[zoneI];
1232 label cell0 = cz[i];
1234 if (cellToZone[cell0] == -1)
1236 cellToZone[cell0] = zoneI;
1238 else if (cellToZone[cell0] != zoneI)
1240 labelList& cZones = addCellToZones[cell0];
1252 const cellZone& cz = cz1[zoneI];
1253 const label allZoneI = from1ToAll[zoneI];
1256 label cell1 = cz[i];
1257 label allCelli = from1ToAllCells[cell1];
1259 if (cellToZone[allCelli] == -1)
1261 cellToZone[allCelli] = allZoneI;
1263 else if (cellToZone[allCelli] != allZoneI)
1265 labelList& cZones = addCellToZones[allCelli];
1278 forAll(cellToZone, allCelli)
1280 label zoneI = cellToZone[allCelli];
1286 forAll(addCellToZones, allCelli)
1288 const labelList& cZones = addCellToZones[allCelli];
1291 nCells[cZones[i]]++;
1296 czCells.setSize(zoneNames.size());
1299 czCells[zoneI].setCapacity(nCells[zoneI]);
1301 forAll(cellToZone, allCelli)
1303 label zoneI = cellToZone[allCelli];
1306 czCells[zoneI].append(allCelli);
1309 forAll(addCellToZones, allCelli)
1311 const labelList& cZones = addCellToZones[allCelli];
1314 czCells[cZones[i]].append(allCelli);
1319 czCells[i].shrink();
1325 void Foam::polyMeshAdder::mergeZones
1327 const label nAllPoints,
1329 const label nAllCells,
1331 const polyMesh& mesh0,
1332 const polyMesh& mesh1,
1340 DynamicList<word>& pointZoneNames,
1341 List<DynamicList<label>>& pzPoints,
1343 DynamicList<word>& faceZoneNames,
1344 List<DynamicList<label>>& fzFaces,
1345 List<DynamicList<bool>>& fzFlips,
1347 DynamicList<word>& cellZoneNames,
1348 List<DynamicList<label>>& czCells
1396 void Foam::polyMeshAdder::addZones
1398 const DynamicList<word>& pointZoneNames,
1399 const List<DynamicList<label>>& pzPoints,
1401 const DynamicList<word>& faceZoneNames,
1402 const List<DynamicList<label>>& fzFaces,
1403 const List<DynamicList<bool>>& fzFlips,
1405 const DynamicList<word>& cellZoneNames,
1406 const List<DynamicList<label>>& czCells,
1411 List<pointZone*>
pZones(pzPoints.size());
1414 pZones[i] =
new pointZone
1423 List<faceZone*> fZones(fzFaces.size());
1426 fZones[i] =
new faceZone
1436 List<cellZone*> cZones(czCells.size());
1439 cZones[i] =
new cellZone
1482 labelList fromAllTo1Patches(allPatchNames.size(), -1);
1504 label nInternalFaces;
1512 labelList nFaces(allPatchNames.size(), 0);
1527 allPatchNames.size(),
1602 allPatchNames.
size(),
1604 mesh0.nInternalFaces()
1605 + mesh1.nInternalFaces()
1640 getPatchSizes(patches0),
1641 getPatchStarts(patches0)
1692 const bool validBoundary
1703 labelList fromAllTo1Patches(allPatchNames.size(), -1);
1727 label nInternalFaces;
1729 labelList nFaces(allPatchNames.size(), 0);
1744 allPatchNames.size(),
1811 labelList mesh0PatchSizes(getPatchSizes(patches0));
1812 labelList mesh0PatchStarts(getPatchStarts(patches0));
1819 labelList patchSizes(allPatchNames.size());
1820 labelList patchStarts(allPatchNames.size());
1822 label startFacei = nInternalFaces;
1826 label allPatchi = 0;
1828 forAll(from0ToAllPatches, patch0)
1833 if (nFaces[patch0] == 0 && isA<processorPolyPatch>(patches0[patch0]))
1838 from0ToAllPatches[patch0] = -1;
1841 if (fromAllTo1Patches[patch0] != -1)
1843 from1ToAllPatches[fromAllTo1Patches[patch0]] = -1;
1848 patchSizes[allPatchi] = nFaces[patch0];
1849 patchStarts[allPatchi] = startFacei;
1852 from0ToAllPatches[patch0] = allPatchi;
1855 if (fromAllTo1Patches[patch0] != -1)
1857 from1ToAllPatches[fromAllTo1Patches[patch0]] = allPatchi;
1860 startFacei += nFaces[patch0];
1868 const label sz0 = from0ToAllPatches.size();
1871 forAll(from0ToAllPatches, patchi)
1873 if (from0ToAllPatches[patchi] != -1)
1875 newToOld[nNew++] =
patchi;
1879 mesh0.reorderPatches(newToOld,
false);
1883 forAll(from1ToAllPatches, patch1)
1885 label uncompactAllPatchi = from1ToAllPatches[patch1];
1887 if (uncompactAllPatchi >= from0ToAllPatches.size())
1893 nFaces[uncompactAllPatchi] == 0
1894 && isA<processorPolyPatch>(patches1[patch1])
1899 from1ToAllPatches[patch1] = -1;
1903 patchSizes[allPatchi] = nFaces[uncompactAllPatchi];
1904 patchStarts[allPatchi] = startFacei;
1919 from1ToAllPatches[patch1] = allPatchi;
1921 startFacei += nFaces[uncompactAllPatchi];
1927 patchSizes.setSize(allPatchi);
1928 patchStarts.setSize(allPatchi);
1967 mesh0.resetMotion();
1968 mesh0.resetPrimitives
1980 mesh0.pointZones().
clear();
1981 mesh0.faceZones().clear();
1982 mesh0.cellZones().clear();
2004 const scalar mergeDist
2019 label nMultiple = 0;
2021 forAll(sharedPointLabels, i)
2023 label pointi = sharedPointLabels[i];
2025 label sharedI = sharedPointAddr[i];
2029 if (iter != sharedToMesh.end())
2035 labelList& connectedPointLabels = iter();
2040 if (
findIndex(connectedPointLabels, pointi) != -1)
2043 <<
"Duplicate point in sharedPoint addressing." <<
endl 2044 <<
"When trying to add point " << pointi <<
" on shared " 2045 << sharedI <<
" with connected points " 2046 << connectedPointLabels
2050 connectedPointLabels.
setSize(sz+1);
2051 connectedPointLabels[sz] = pointi;
2055 sharedToMesh.insert(sharedI,
labelList(1, pointi));
2067 const labelList& connectedPointLabels = iter();
2074 if (connectedPointLabels.
size() > 1)
2079 connectedPointLabels
2091 if (nUnique < connectedPoints.size())
2106 const labelList& mergeSet = mergeSets[setI];
2108 if (mergeSet.
size() > 1)
2115 label pointi = connectedPointLabels[mergeSet[i]];
2117 masterPointi =
min(masterPointi, pointi);
2122 label pointi = connectedPointLabels[mergeSet[i]];
2131 pointToMaster.
insert(pointi, masterPointi);
2209 return pointToMaster;
2225 if (iter != pointToMaster.
end())
2227 if (iter() != pointi)
2240 const face&
f = faces[facei];
2242 bool hasMerged =
false;
2246 label pointi = f[fp];
2250 if (iter != pointToMaster.
end())
2252 if (iter() != pointi)
2266 label pointi = f[fp];
2270 if (iter != pointToMaster.
end())
2279 bool zoneFlip =
false;
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
ListType renumber(const labelUList &oldToNew, const ListType &)
Renumber the values (not the indices) of a list.
const labelList & sharedPointLabels() const
Return indices of local points that are globally shared.
List< labelList > labelListList
A List of labelList.
void inplaceReorder(const labelUList &oldToNew, ListType &)
Inplace reorder the elements of a list.
ZoneMesh< faceZone, polyMesh > faceZoneMesh
A ZoneMesh with the type faceZone.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
List< List< bool > > boolListList
void sortedOrder(const UList< T > &, labelList &order)
Generate the (stable) sort order for the list.
void inplaceRenumber(const labelUList &oldToNew, ListType &)
Inplace renumber the values of a list.
const faceZoneMesh & faceZones() const
Return face zone mesh.
Class describing modification of a face.
void reset(T *=nullptr)
If object pointer already set, delete object and set to given.
A face is a list of labels corresponding to mesh vertices.
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual const labelList & faceNeighbour() const
Return face neighbour.
labelListList invertOneToMany(const label len, const labelUList &)
Invert one-to-many map. Unmapped elements will be size 0.
void size(const label)
Override size to be inconsistent with allocated storage.
const boolList & flipMap() const
Return face flip map.
Ostream & endl(Ostream &os)
Add newline and flush stream.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
Class containing mesh-to-mesh mapping information after a mesh addition where we add a mesh ('added m...
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
HashTable< label, label, Hash< label > >::const_iterator const_iterator
label whichFace(const label globalCellID) const
Helper function to re-direct to zone::localID(...)
const primitiveFacePatch & cutFaces() const
Addressing engine for combined set of faces.
void removePoint(const label, const label)
Remove/merge point.
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
Foam::indirectPrimitivePatch.
Container for information needed to couple to meshes. When constructed from two meshes and a geometri...
virtual const pointField & points() const
Return raw points.
List< bool > boolList
Bool container classes.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
An STL-conforming iterator.
void clear()
Delete object (if the pointer is valid) and set pointer to.
vectorField pointField
pointField is a vectorField.
static void mergePoints(const polyMesh &, const Map< label > &pointToMaster, polyTopoChange &meshMod)
Helper: Merge points.
friend class const_iterator
Declare friendship with the const_iterator.
void append(const T &)
Append an element at the end of the list.
virtual const labelList & faceOwner() const
Return face owner.
const globalMeshData & globalData() const
Return parallel info.
static const label labelMax
List< label > labelList
A List of labels.
ZoneMesh< pointZone, polyMesh > pointZoneMesh
A ZoneMesh with the type pointZone.
virtual const faceList & faces() const
Return raw faces.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
errorManip< error > abort(error &err)
void addPatches(const List< polyPatch *> &, const bool validBoundary=true)
Add boundary patches.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
PrimitivePatch< List< face >, const pointField & > primitiveFacePatch
Foam::primitiveFacePatch.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
word name(const complex &)
Return a string representation of a complex.
label whichZone(const label objectIndex) const
Given a global object index, return the zone it is in.
label size() const
Return the number of elements in the UPtrList.
void setSize(const label)
Reset size of List.
prefixOSstream Pout(cout, "Pout")
Direct mesh changes based on v1.3 polyTopoChange syntax.
label mergePoints(const UList< Type > &points, const scalar mergeTol, const bool verbose, labelList &pointMap, const Type &origin=Type::zero)
Sorts and merges points. All points closer than/equal mergeTol get merged.
HashTable< labelList, edge, Hash< edge > > edgeLookup
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Mesh consisting of general polyhedral cells.
A subset of mesh faces organised as a primitive patch.
void stableSort(UList< T > &)
static autoPtr< polyMesh > add(const IOobject &io, const polyMesh &mesh0, const polyMesh &mesh1, const faceCoupleInfo &coupleInfo, autoPtr< mapAddedPolyMesh > &mapPtr)
Add two polyMeshes. Returns new polyMesh and map construct.
const labelList & sharedPointAddr() const
Return addressing into the complete globally shared points.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
List< cell > cellList
list of cells
ZoneMesh< cellZone, polyMesh > cellZoneMesh
A ZoneMesh with the type cellZone.
static Map< label > findSharedPoints(const polyMesh &, const scalar mergeTol)
Find topologically and geometrically shared points.
IOporosityModelList pZones(mesh)
A HashTable to objects of type <T> with a label key.
label setAction(const topoAction &action)
For compatibility with polyTopoChange: set topological action.