45 Foam::label Foam::polyMeshAdder::patchIndex
48 DynamicList<word>& allPatchNames,
49 DynamicList<word>& allPatchTypes
54 const word& pType =
p.type();
55 const word& pName =
p.name();
57 const label patchi = allPatchNames.find(pName);
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;
96 Foam::label Foam::polyMeshAdder::zoneIndex
99 DynamicList<word>& names
102 const label zoneI = names.find(curName);
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
189 patchSizes[patchi] =
patches[patchi].size();
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)
268 label allPatchi = 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;
316 const label nInternalFaces,
324 for (label facei = nInternalFaces; facei < owner.size(); ++facei)
326 oldToNew[facei] = facei;
336 SortableList<label> nbr(cFaces.size());
340 const 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]);
426 const auto v0Fnd = meshToMaster.cfind(v0);
429 const auto v1Fnd = meshToMaster.cfind(v1);
435 masterToCutPoints[v0Fnd()],
436 masterToCutPoints[v1Fnd()]
439 const auto iter = cutEdgeToPoints.cfind(cutEdge);
443 const edge&
e = iter.key();
444 const labelList& addedPoints = iter.val();
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()
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;
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)
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)
956 forAll(pointToZone, allPointi)
958 label zoneI = pointToZone[allPointi];
964 forAll(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)
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];
1076 if (!fZones.found(zoneI))
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];
1119 if (!fZones.found(allZoneI))
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();
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];
1241 if (!cZones.found(zoneI))
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];
1266 if (!cZones.found(allZoneI))
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
1481 labelList from1ToAllPatches(patches1.size());
1482 labelList fromAllTo1Patches(allPatchNames.size(), -1);
1504 label nInternalFaces;
1527 allPatchNames.size(),
1593 labelList from0ToAllPatches(patches0.size(), -1);
1602 allPatchNames.size(),
1604 mesh0.nInternalFaces()
1605 + mesh1.nInternalFaces()
1640 getPatchSizes(patches0),
1641 getPatchStarts(patches0)
1655 std::move(allFaces),
1656 std::move(allOwner),
1657 std::move(allNeighbour)
1689 const bool validBoundary
1699 labelList from1ToAllPatches(patches1.size());
1700 labelList fromAllTo1Patches(allPatchNames.size(), -1);
1724 label nInternalFaces;
1741 allPatchNames.size(),
1808 labelList mesh0PatchSizes(getPatchSizes(patches0));
1809 labelList mesh0PatchStarts(getPatchStarts(patches0));
1812 labelList from0ToAllPatches(patches0.size(), -1);
1818 allPatches.
setSize(allPatchNames.size());
1819 labelList patchSizes(allPatches.size());
1820 labelList patchStarts(allPatches.size());
1822 label startFacei = nInternalFaces;
1826 label allPatchi = 0;
1828 forAll(from0ToAllPatches, patch0)
1833 if (nFaces[patch0] == 0 && isA<processorPolyPatch>(allPatches[patch0]))
1837 from0ToAllPatches[patch0] = -1;
1839 if (fromAllTo1Patches[patch0] != -1)
1841 from1ToAllPatches[fromAllTo1Patches[patch0]] = -1;
1852 allPatches[patch0].clone
1860 patchSizes[allPatchi] = nFaces[patch0];
1861 patchStarts[allPatchi] = startFacei;
1864 from0ToAllPatches[patch0] = allPatchi;
1867 if (fromAllTo1Patches[patch0] != -1)
1869 from1ToAllPatches[fromAllTo1Patches[patch0]] = allPatchi;
1872 startFacei += nFaces[patch0];
1879 forAll(from1ToAllPatches, patch1)
1881 label uncompactAllPatchi = from1ToAllPatches[patch1];
1883 if (uncompactAllPatchi >= from0ToAllPatches.size())
1889 nFaces[uncompactAllPatchi] == 0
1890 && isA<processorPolyPatch>(patches1[patch1])
1895 from1ToAllPatches[patch1] = -1;
1903 patches1[patch1].clone
1911 patchSizes[allPatchi] = nFaces[uncompactAllPatchi];
1912 patchStarts[allPatchi] = startFacei;
1915 from1ToAllPatches[patch1] = allPatchi;
1917 startFacei += nFaces[uncompactAllPatchi];
1924 allPatches.setSize(allPatchi);
1925 patchSizes.setSize(allPatchi);
1926 patchStarts.setSize(allPatchi);
1965 mesh0.resetMotion();
1966 mesh0.resetPrimitives
1978 mesh0.pointZones().
clear();
1979 mesh0.faceZones().clear();
1980 mesh0.cellZones().clear();
2002 const scalar mergeDist
2017 label nMultiple = 0;
2019 forAll(sharedPointLabels, i)
2021 label pointi = sharedPointLabels[i];
2023 label sharedI = sharedPointAddr[i];
2025 auto iter = sharedToMesh.find(sharedI);
2033 labelList& connectedPointLabels = iter.val();
2035 label sz = connectedPointLabels.size();
2038 if (connectedPointLabels.found(pointi))
2041 <<
"Duplicate point in sharedPoint addressing." <<
endl
2042 <<
"When trying to add point " << pointi <<
" on shared "
2043 << sharedI <<
" with connected points "
2044 << connectedPointLabels
2048 connectedPointLabels.
setSize(sz+1);
2049 connectedPointLabels[sz] = pointi;
2053 sharedToMesh.insert(sharedI,
labelList(1, pointi));
2065 const labelList& connectedPointLabels = iter.val();
2072 if (connectedPointLabels.size() > 1)
2077 connectedPointLabels
2089 if (nUnique < connectedPoints.size())
2104 const labelList& mergeSet = mergeSets[setI];
2106 if (mergeSet.size() > 1)
2113 label pointi = connectedPointLabels[mergeSet[i]];
2115 masterPointi =
min(masterPointi, pointi);
2120 label pointi = connectedPointLabels[mergeSet[i]];
2129 pointToMaster.insert(pointi, masterPointi);
2207 return pointToMaster;
2221 const auto iter = pointToMaster.cfind(pointi);
2225 if (iter.val() != pointi)
2238 const face&
f = faces[facei];
2240 bool hasMerged =
false;
2244 label pointi =
f[fp];
2246 const auto iter = pointToMaster.cfind(pointi);
2250 if (iter.val() != pointi)
2264 label pointi =
f[fp];
2266 const auto iter = pointToMaster.cfind(pointi);
2270 newF[fp] = iter.val();
2277 bool zoneFlip =
false;