69 referPatchID_(referPatchID)
74 if (nbrProc_[a] < nbrProc_[
b])
78 else if (nbrProc_[a] > nbrProc_[
b])
85 return referPatchID_[a] < referPatchID_[
b];
94 void Foam::fvMeshDistribute::inplaceRenumberWithFlip
97 const bool oldToNewHasFlip,
98 const bool lstHasFlip,
102 if (!lstHasFlip && !oldToNewHasFlip)
113 label val = lst[elemI];
129 <<
"Problem : zero value " << val
130 <<
" at index " << elemI <<
" out of " << lst.size()
137 label newVal = oldToNew[val];
153 <<
"Problem : zero value " << newVal
154 <<
" at index " << elemI <<
" out of "
162 lst[elemI] =
sign*(newVal+1);
170 const bool selectEqual,
179 if (selectEqual == (
values[i] == value))
190 if (selectEqual == (
values[i] == value))
207 DynamicList<word> mergedNames;
210 mergedNames = procNames;
215 mergedNames.appendUniq(
name);
227 Pout<<
"Primitives:" <<
nl
241 Pout<<
" " << patchi <<
" name:" << pp.
name()
242 <<
" size:" << pp.size()
243 <<
" start:" << pp.
start()
244 <<
" type:" << pp.type()
254 Pout<<
" " << zoneI <<
" name:" << pz.
name()
255 <<
" size:" << pz.size()
265 Pout<<
" " << zoneI <<
" name:" << fz.
name()
266 <<
" size:" << fz.size()
276 Pout<<
" " << zoneI <<
" name:" << cz.
name()
277 <<
" size:" << cz.size()
294 <<
"Current coupling info:"
297 forAll(sourceFace, bFacei)
301 Pout<<
" meshFace:" << meshFacei
303 <<
" connects to proc:" << sourceProc[bFacei]
304 <<
"/face:" << sourceFace[bFacei]
305 <<
" which will move to proc:" << sourceNewNbrProc[bFacei]
311 Foam::label Foam::fvMeshDistribute::findNonEmptyPatch()
const
325 const auto* cpp = isA<cyclicACMIPolyPatch>(pp);
329 isCoupledPatch.set(patchi);
330 const label dupPatchID = cpp->nonOverlapPatchID();
331 if (dupPatchID != -1)
333 isCoupledPatch.set(dupPatchID);
338 isCoupledPatch.set(patchi);
342 label nonEmptyPatchi = -1;
346 const polyPatch& pp =
patches[patchi];
350 !isA<emptyPolyPatch>(pp)
351 && !isCoupledPatch(patchi)
352 && !isA<mappedPatchBase>(pp)
355 nonEmptyPatchi = patchi;
360 if (nonEmptyPatchi == -1)
363 <<
"Cannot find a patch which is neither of type empty nor"
365 <<
"There has to be at least one such patch for"
371 Pout<<
"findNonEmptyPatch : using patch " << nonEmptyPatchi
373 <<
" type:" <<
patches[nonEmptyPatchi].type()
374 <<
" to put exposed faces into." <<
endl;
380 label procPatchi = -1;
384 if (isA<processorPolyPatch>(
patches[patchi]))
388 else if (procPatchi != -1)
391 <<
"Processor patches should be at end of patch list."
393 <<
"Have processor patch " << procPatchi
394 <<
" followed by non-processor patch " << patchi
400 return nonEmptyPatchi;
433 fld[facei] = (
n[facei] & testNormal);
436 surfaceScalarField::Boundary& fluxBf =
fld.boundaryFieldRef();
437 const surfaceVectorField::Boundary& nBf =
n.boundaryField();
446 newPfld[i] = (nBf[patchi][i] & testNormal);
465 scalar
cos = (
n[facei] & testNormal);
471 <<
"On internal face " << facei <<
" at "
473 <<
" the field value is " <<
fld[facei]
474 <<
" whereas cos angle of " << testNormal
475 <<
" with mesh normal " <<
n[facei]
488 scalar
cos = (np[i] & testNormal);
495 <<
"On face " << facei
498 <<
" the field value is " << fvp[i]
499 <<
" whereas cos angle of " << testNormal
500 <<
" with mesh normal " << np[i]
512 const label destinationPatch
520 labelList newPatchID(mesh_.nBoundaryFaces(), -1);
524 if (isA<processorPolyPatch>(pp))
528 Pout<<
"Moving all faces of patch " << pp.
name()
529 <<
" into patch " << destinationPatch
538 ) = destinationPatch;
546 autoPtr<mapPolyMesh> map = repatch(newPatchID, dummyFaceMaps);
554 forAll(mesh_.boundaryMesh(), patchi)
556 if (!isA<processorPolyPatch>(mesh_.boundaryMesh()[patchi]))
558 oldToNew[patchi] = newi++;
561 label nNonProcPatches = newi;
564 forAll(mesh_.boundaryMesh(), patchi)
566 if (isA<processorPolyPatch>(mesh_.boundaryMesh()[patchi]))
568 oldToNew[patchi] = newi++;
584 polyTopoChange meshMod(mesh_);
586 forAll(newPatchID, bFacei)
588 if (newPatchID[bFacei] != -1)
590 label facei = mesh_.nInternalFaces() + bFacei;
592 label
zoneID = mesh_.faceZones().whichZone(facei);
593 bool zoneFlip =
false;
597 const faceZone& fZone = mesh_.faceZones()[
zoneID];
598 zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
605 mesh_.faces()[facei],
607 mesh_.faceOwner()[facei],
624 PtrList<FieldField<fvsPatchField, scalar>> sFlds;
625 saveBoundaryFields<scalar, surfaceMesh>(sFlds);
626 PtrList<FieldField<fvsPatchField, vector>> vFlds;
627 saveBoundaryFields<vector, surfaceMesh>(vFlds);
628 PtrList<FieldField<fvsPatchField, sphericalTensor>> sptFlds;
629 saveBoundaryFields<sphericalTensor, surfaceMesh>(sptFlds);
630 PtrList<FieldField<fvsPatchField, symmTensor>> sytFlds;
631 saveBoundaryFields<symmTensor, surfaceMesh>(sytFlds);
632 PtrList<FieldField<fvsPatchField, tensor>> tFlds;
633 saveBoundaryFields<tensor, surfaceMesh>(tFlds);
642 autoPtr<mapPolyMesh> mapPtr = meshMod.changeMesh(mesh_,
false,
true);
643 mapPolyMesh& map = *mapPtr;
646 mesh_.updateMesh(map);
650 mapBoundaryFields<scalar, surfaceMesh>(map, sFlds);
651 mapBoundaryFields<vector, surfaceMesh>(map, vFlds);
652 mapBoundaryFields<sphericalTensor, surfaceMesh>(map, sptFlds);
653 mapBoundaryFields<symmTensor, surfaceMesh>(map, sytFlds);
654 mapBoundaryFields<tensor, surfaceMesh>(map, tFlds);
658 if (map.hasMotionPoints())
660 mesh_.movePoints(map.preMotionPoints());
667 label index = map.reverseFaceMap().find(-1);
672 <<
"reverseFaceMap contains -1 at index:"
674 <<
"This means that the repatch operation was not just"
679 forAll(constructFaceMap, proci)
681 inplaceRenumberWithFlip
683 map.reverseFaceMap(),
686 constructFaceMap[proci]
709 forAll(pointToGlobalMaster, pointi)
711 if (pointToGlobalMaster[pointi] != -1)
719 Pout<<
"mergeSharedPoints : found " << nShared
720 <<
" points on processor boundaries" <<
nl <<
endl;
723 Map<label> globalMasterToLocalMaster(2*nShared);
724 Map<label> pointToMaster(2*nShared);
727 forAll(pointToGlobalMaster, pointi)
729 label globali = pointToGlobalMaster[pointi];
732 const auto iter = globalMasterToLocalMaster.cfind(globali);
737 pointToMaster.insert(pointi, *iter);
743 globalMasterToLocalMaster.insert(globali, pointi);
744 pointToMaster.insert(pointi, pointi);
749 reduce(nMatch, sumOp<label>());
753 Pout<<
"mergeSharedPoints : found "
754 << nMatch <<
" mergeable points" <<
nl <<
endl;
764 polyTopoChange meshMod(mesh_);
769 autoPtr<mapPolyMesh> mapPtr = meshMod.changeMesh(mesh_,
false,
true);
770 mapPolyMesh& map = *mapPtr;
773 mesh_.updateMesh(map);
776 forAll(constructPointMap, proci)
778 labelList& constructMap = constructPointMap[proci];
782 label oldPointi = constructMap[i];
784 label
newPointi = map.reversePointMap()[oldPointi];
797 <<
"Problem. oldPointi:" << oldPointi
807 void Foam::fvMeshDistribute::getCouplingData
820 const label nBnd = mesh_.nBoundaryFaces();
821 sourceFace.setSize(nBnd);
822 sourceProc.setSize(nBnd);
823 sourcePatch.setSize(nBnd);
824 sourceNewNbrProc.setSize(nBnd);
826 const polyBoundaryMesh&
patches = mesh_.boundaryMesh();
834 const polyPatch& pp =
patches[patchi];
838 label offset = pp.
start() - mesh_.nInternalFaces();
843 label bndI = offset + i;
844 nbrFaces[bndI] = pp.start()+i;
848 SubList<label>(nbrNewNbrProc, pp.size(), offset) =
861 const polyPatch& pp =
patches[patchi];
862 label offset = pp.
start() - mesh_.nInternalFaces();
864 if (isA<processorPolyPatch>(pp))
866 const processorPolyPatch& procPatch =
867 refCast<const processorPolyPatch>(pp);
871 if (procPatch.owner())
876 label bndI = offset + i;
877 sourceFace[bndI] = pp.start()+i;
879 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
887 label bndI = offset + i;
888 sourceFace[bndI] = nbrFaces[bndI];
889 sourceProc[bndI] = procPatch.neighbProcNo();
890 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
896 if (isA<processorCyclicPolyPatch>(pp))
898 patchi = refCast<const processorCyclicPolyPatch>
906 label bndI = offset + i;
907 sourcePatch[bndI] = patchi;
910 else if (isA<cyclicPolyPatch>(pp))
912 const cyclicPolyPatch& cpp = refCast<const cyclicPolyPatch>(pp);
918 label bndI = offset + i;
919 sourceFace[bndI] = pp.start()+i;
921 sourcePatch[bndI] = patchi;
922 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
929 label bndI = offset + i;
930 sourceFace[bndI] = nbrFaces[bndI];
932 sourcePatch[bndI] = patchi;
933 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
942 label bndI = offset + i;
943 sourceFace[bndI] = -1;
944 sourceProc[bndI] = -1;
945 sourcePatch[bndI] = patchi;
946 sourceNewNbrProc[bndI] = -1;
953 sourcePointMaster.setSize(mesh_.nPoints());
954 sourcePointMaster = -1;
957 const globalIndex globalPoints(mesh_.nPoints());
959 const globalMeshData& gmd = mesh_.globalData();
961 const labelList& meshPoints = cpp.meshPoints();
962 const mapDistribute& slavesMap = gmd.globalCoPointSlavesMap();
965 labelList elems(slavesMap.constructSize(), -1);
966 forAll(meshPoints, pointi)
974 label globalPointi = globalPoints.toGlobal(meshPoints[pointi]);
975 elems[pointi] = globalPointi;
978 label sloti = slots[i];
979 if (sloti >= meshPoints.size())
983 elems[slots[i]] = globalPointi;
990 slavesMap.reverseDistribute(elems.size(), elems,
false);
993 forAll(meshPoints, pointi)
995 sourcePointMaster[meshPoints[pointi]] = elems[pointi];
1002 void Foam::fvMeshDistribute::subsetCouplingData
1012 const label oldInternalFaces,
1032 forAll(subFace, newBFacei)
1036 label oldFacei =
faceMap[newFacei];
1039 if (oldFacei < oldInternalFaces)
1041 subFace[newBFacei] = oldFacei;
1043 subPatch[newBFacei] = -1;
1045 label oldOwn = oldFaceOwner[oldFacei];
1046 label oldNei = oldFaceNeighbour[oldFacei];
1051 subNewNbrProc[newBFacei] = oldDistribution[oldNei];
1056 subNewNbrProc[newBFacei] = oldDistribution[oldOwn];
1062 label oldBFacei = oldFacei - oldInternalFaces;
1064 subFace[newBFacei] = sourceFace[oldBFacei];
1065 subProc[newBFacei] = sourceProc[oldBFacei];
1066 subPatch[newBFacei] = sourcePatch[oldBFacei];
1067 subNewNbrProc[newBFacei] = sourceNewNbrProc[oldBFacei];
1072 subPointMaster = UIndirectList<label>(sourcePointMaster, pointMap);
1078 void Foam::fvMeshDistribute::findCouples
1080 const primitiveMesh&
mesh,
1086 const primitiveMesh& domainMesh,
1099 forAll(domainProc, bFacei)
1101 if (domainProc[bFacei] != -1 && domainPatch[bFacei] == -1)
1105 labelPair(domainFace[bFacei], domainProc[bFacei]),
1114 masterCoupledFaces.setSize(domainFace.size());
1115 slaveCoupledFaces.setSize(domainFace.size());
1118 forAll(sourceFace, bFacei)
1120 if (sourceProc[bFacei] != -1 && sourcePatch[bFacei] == -1)
1122 labelPair myData(sourceFace[bFacei], sourceProc[bFacei]);
1124 const auto iter = map.cfind(myData);
1128 label nbrBFacei = *iter;
1131 slaveCoupledFaces[coupledI] =
1132 domainMesh.nInternalFaces()
1140 masterCoupledFaces.setSize(coupledI);
1141 slaveCoupledFaces.setSize(coupledI);
1145 Pout<<
"findCouples : found " << coupledI
1146 <<
" faces that will be stitched" <<
nl <<
endl;
1151 void Foam::fvMeshDistribute::findCouples
1153 const UPtrList<polyMesh>&
meshes,
1154 const PtrList<labelList>& domainSourceFaces,
1155 const PtrList<labelList>& domainSourceProcs,
1156 const PtrList<labelList>& domainSourcePatchs,
1172 const labelList& domainProc = domainSourceProcs[meshi];
1173 const labelList& domainPatch = domainSourcePatchs[meshi];
1175 forAll(domainProc, bFacei)
1177 if (domainProc[bFacei] != -1 && domainPatch[bFacei] == -1)
1179 nProcFaces[meshi]++;
1187 Pout<<
"fvMeshDistribute::findCouples : nProcFaces:"
1201 dynLocalFace[meshi].setCapacity(nProcFaces[meshi]);
1202 dynRemoteProc[meshi].setCapacity(nProcFaces[meshi]);
1203 dynRemoteFace[meshi].setCapacity(nProcFaces[meshi]);
1209 LabelPairMap<labelPair> map(2*
sum(nProcFaces));
1217 const labelList& domainFace = domainSourceFaces[meshi];
1218 const labelList& domainProc = domainSourceProcs[meshi];
1219 const labelList& domainPatch = domainSourcePatchs[meshi];
1221 forAll(domainProc, bFacei)
1223 if (domainProc[bFacei] != -1 && domainPatch[bFacei] == -1)
1230 auto fnd = map.find(
key);
1235 map.emplace(
key, meshi, bFacei);
1240 const label matchProci = fnd().first();
1241 const label matchFacei = fnd().second();
1243 dynLocalFace[meshi].append(bFacei);
1244 dynRemoteProc[meshi].append(matchProci);
1245 dynRemoteFace[meshi].append(matchFacei);
1246 nProcFaces[meshi]++;
1248 dynLocalFace[matchProci].append(matchFacei);
1249 dynRemoteProc[matchProci].append(meshi);
1250 dynRemoteFace[matchProci].append(bFacei);
1251 nProcFaces[matchProci]++;
1260 Pout<<
"fvMeshDistribute::findCouples : stored procFaces:"
1261 << map.size() <<
endl;
1271 localBoundaryFace[meshi] = std::move(dynLocalFace[meshi]);
1272 remoteFaceProc[meshi] = std::move(dynRemoteProc[meshi]);
1273 remoteBoundaryFace[meshi] = std::move(dynRemoteFace[meshi]);
1280 Pout<<
"fvMeshDistribute::findCouples : found matches:"
1289 const primitiveMesh&
mesh,
1290 const mapAddedPolyMesh& map,
1292 const label nInternalFaces1,
1298 forAll(boundaryData0, oldBFacei)
1300 label newFacei = map.oldFaceMap()[oldBFacei + map.nOldInternalFaces()];
1306 boundaryData0[oldBFacei];
1310 forAll(boundaryData1, addedBFacei)
1312 label newFacei = map.addedFaceMap()[addedBFacei + nInternalFaces1];
1317 boundaryData1[addedBFacei];
1321 return newBoundaryData;
1327 const primitiveMesh&
mesh,
1328 const mapAddedPolyMesh& map,
1335 forAll(boundaryData0, oldPointi)
1337 label
newPointi = map.oldPointMap()[oldPointi];
1342 newBoundaryData[
newPointi] = boundaryData0[oldPointi];
1346 forAll(boundaryData1, addedPointi)
1348 label
newPointi = map.addedPointMap()[addedPointi];
1352 newBoundaryData[
newPointi] = boundaryData1[addedPointi];
1356 return newBoundaryData;
1364 const label oldInternalPatchi
1368 polyTopoChange meshMod(mesh_);
1372 removeCells cellRemover(mesh_,
false);
1375 labelList exposedFaces(cellRemover.getExposedFaces(cellsToRemove));
1378 cellRemover.setRefinement
1382 labelList(exposedFaces.size(), oldInternalPatchi),
1393 PtrList<Field<scalar>> sFlds;
1394 saveInternalFields(sFlds);
1395 PtrList<Field<vector>> vFlds;
1396 saveInternalFields(vFlds);
1397 PtrList<Field<sphericalTensor>> sptFlds;
1398 saveInternalFields(sptFlds);
1399 PtrList<Field<symmTensor>> sytFlds;
1400 saveInternalFields(sytFlds);
1401 PtrList<Field<tensor>> tFlds;
1402 saveInternalFields(tFlds);
1405 autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh_,
false,
false);
1408 mesh_.updateMesh(map());
1415 mapExposedFaces(map(), sFlds);
1416 mapExposedFaces(map(), vFlds);
1417 mapExposedFaces(map(), sptFlds);
1418 mapExposedFaces(map(), sytFlds);
1419 mapExposedFaces(map(), tFlds);
1427 if (map().hasMotionPoints())
1429 mesh_.movePoints(map().preMotionPoints());
1439 void Foam::fvMeshDistribute::addProcPatches
1443 List<Map<label>>& procPatchID
1455 sortedOrder(nbrProc, indices, lessProcPatches(nbrProc, referPatchID));
1461 label bFacei = indices[i];
1462 label proci = nbrProc[bFacei];
1466 if (!procPatchID[proci].
found(referPatchID[bFacei]))
1471 if (referPatchID[bFacei] == -1)
1475 processorPolyPatch pp
1479 mesh_.boundaryMesh().size(),
1480 mesh_.boundaryMesh(),
1485 procPatchID[proci].insert
1487 referPatchID[bFacei],
1493 processorFvPatchField<scalar>::typeName,
1500 const coupledPolyPatch& pcPatch
1501 = refCast<const coupledPolyPatch>
1503 mesh_.boundaryMesh()[referPatchID[bFacei]]
1505 processorCyclicPolyPatch pp
1509 mesh_.boundaryMesh().size(),
1510 mesh_.boundaryMesh(),
1517 procPatchID[proci].insert
1519 referPatchID[bFacei],
1525 processorCyclicFvPatchField<scalar>::typeName,
1541 const List<Map<label>>& procPatchID
1550 label origPatchi = referPatchID[bFacei];
1551 patchIDs[bFacei] = origPatchi;
1553 else if (nbrProc[bFacei] != -1)
1555 label origPatchi = referPatchID[bFacei];
1556 patchIDs[bFacei] = procPatchID[nbrProc[bFacei]][origPatchi];
1560 patchIDs[bFacei] = -1;
1568 void Foam::fvMeshDistribute::sendMesh
1587 Pout<<
"Sending to domain " << domain <<
nl
1597 CompactListList<label> zonePoints;
1603 forAll(pointZoneNames, nameI)
1605 label myZoneID = pointZones.findZoneID(pointZoneNames[nameI]);
1609 rowSizes[nameI] = pointZones[myZoneID].size();
1612 zonePoints.setSize(rowSizes);
1614 forAll(pointZoneNames, nameI)
1616 label myZoneID = pointZones.findZoneID(pointZoneNames[nameI]);
1620 zonePoints[nameI].deepCopy(pointZones[myZoneID]);
1626 CompactListList<label> zoneFaces;
1627 CompactListList<bool> zoneFaceFlip;
1633 forAll(faceZoneNames, nameI)
1635 label myZoneID = faceZones.findZoneID(faceZoneNames[nameI]);
1639 rowSizes[nameI] = faceZones[myZoneID].size();
1643 zoneFaces.setSize(rowSizes);
1644 zoneFaceFlip.setSize(rowSizes);
1646 forAll(faceZoneNames, nameI)
1648 label myZoneID = faceZones.findZoneID(faceZoneNames[nameI]);
1652 zoneFaces[nameI].deepCopy(faceZones[myZoneID]);
1653 zoneFaceFlip[nameI].deepCopy(faceZones[myZoneID].flipMap());
1659 CompactListList<label> zoneCells;
1665 forAll(cellZoneNames, nameI)
1667 label myZoneID = cellZones.findZoneID(cellZoneNames[nameI]);
1671 rowSizes[nameI] = cellZones[myZoneID].size();
1675 zoneCells.setSize(rowSizes);
1677 forAll(cellZoneNames, nameI)
1679 label myZoneID = cellZones.findZoneID(cellZoneNames[nameI]);
1683 zoneCells[nameI].deepCopy(cellZones[myZoneID]);
1705 << CompactListList<label, face>(
mesh.
faces())
1719 << sourcePointMaster;
1724 Pout<<
"Started sending mesh to domain " << domain
1747 faceList domainFaces = CompactListList<label, face>(fromNbr)();
1750 PtrList<entry> patchEntries(fromNbr);
1752 CompactListList<label> zonePoints(fromNbr);
1753 CompactListList<label> zoneFaces(fromNbr);
1754 CompactListList<bool> zoneFaceFlip(fromNbr);
1755 CompactListList<label> zoneCells(fromNbr);
1760 >> domainSourcePatch
1761 >> domainSourceNewNbrProc
1762 >> domainSourcePointMaster;
1774 std::move(domainPoints),
1775 std::move(domainFaces),
1776 std::move(domainAllOwner),
1777 std::move(domainAllNeighbour),
1780 fvMesh& domainMesh = *domainMeshPtr;
1782 List<polyPatch*>
patches(patchEntries.size());
1784 forAll(patchEntries, patchi)
1788 patchEntries[patchi].keyword(),
1789 patchEntries[patchi].
dict(),
1791 domainMesh.boundaryMesh()
1795 domainMesh.addFvPatches(
patches,
false);
1798 List<pointZone*> pZonePtrs(pointZoneNames.size());
1801 pZonePtrs[i] =
new pointZone
1806 domainMesh.pointZones()
1810 List<faceZone*> fZonePtrs(faceZoneNames.size());
1813 fZonePtrs[i] =
new faceZone
1819 domainMesh.faceZones()
1823 List<cellZone*> cZonePtrs(cellZoneNames.size());
1826 cZonePtrs[i] =
new cellZone
1831 domainMesh.cellZones()
1834 domainMesh.addZones(pZonePtrs, fZonePtrs, cZonePtrs);
1836 return domainMeshPtr;
1866 <<
"At index " << celli <<
" distribution:" << newProc
1884 <<
"Size of distribution:"
1885 <<
distribution.size() <<
" mesh nCells:" << mesh_.nCells()
1896 <<
"This application requires all non-processor patches"
1897 <<
" to be present in the same order on all patches" <<
nl
1898 <<
"followed by the processor patches (which of course are unique)."
1900 <<
"Local patches:" << mesh_.boundaryMesh().names()
1905 const label nOldPoints(mesh_.nPoints());
1906 const label nOldFaces(mesh_.nFaces());
1907 const label nOldCells(mesh_.nCells());
1913 oldPatchNMeshPoints[patchi] =
patches[patchi].nPoints();
1929 std::move(oldPatchStarts),
1930 std::move(oldPatchNMeshPoints),
1948 const wordList pointZoneNames(mergeWordList(mesh_.pointZones().names()));
1949 reorderZones<pointZone>(pointZoneNames, mesh_.pointZones());
1951 const wordList faceZoneNames(mergeWordList(mesh_.faceZones().names()));
1952 reorderZones<faceZone>(faceZoneNames, mesh_.faceZones());
1954 const wordList cellZoneNames(mergeWordList(mesh_.cellZones().names()));
1955 reorderZones<cellZone>(cellZoneNames, mesh_.cellZones());
2018 mesh_.resetMotion();
2024 getFieldNames<volScalarField>(mesh_, allFieldNames);
2025 getFieldNames<volVectorField>(mesh_, allFieldNames);
2026 getFieldNames<volSphericalTensorField>(mesh_, allFieldNames);
2027 getFieldNames<volSymmTensorField>(mesh_, allFieldNames);
2028 getFieldNames<volTensorField>(mesh_, allFieldNames);
2030 getFieldNames<surfaceScalarField>(mesh_, allFieldNames);
2031 getFieldNames<surfaceVectorField>(mesh_, allFieldNames);
2032 getFieldNames<surfaceSphericalTensorField>(mesh_, allFieldNames);
2033 getFieldNames<surfaceSymmTensorField>(mesh_, allFieldNames);
2034 getFieldNames<surfaceTensorField>(mesh_, allFieldNames);
2036 getFieldNames<volScalarField::Internal>
2040 volScalarField::typeName
2042 getFieldNames<volVectorField::Internal>
2046 volVectorField::typeName
2048 getFieldNames<volSphericalTensorField::Internal>
2052 volSphericalTensorField::typeName
2054 getFieldNames<volSymmTensorField::Internal>
2058 volSymmTensorField::typeName
2060 getFieldNames<volTensorField::Internal>
2064 volTensorField::typeName
2069 const label oldInternalPatchi = findNonEmptyPatch();
2079 repatchFaceMap = repatchMap().faceMap();
2086 repatchMap().reverseFaceMap(),
2087 mesh_.nBoundaryFaces(),
2088 mesh_.nInternalFaces()
2090 - mesh_.nInternalFaces()
2104 Pout<<
nl <<
"MESH WITH PROC PATCHES DELETED:" <<
endl;
2105 printMeshInfo(mesh_);
2106 printFieldInfo<volScalarField>(mesh_);
2107 printFieldInfo<volVectorField>(mesh_);
2108 printFieldInfo<volSphericalTensorField>(mesh_);
2109 printFieldInfo<volSymmTensorField>(mesh_);
2110 printFieldInfo<volTensorField>(mesh_);
2111 printFieldInfo<surfaceScalarField>(mesh_);
2112 printFieldInfo<surfaceVectorField>(mesh_);
2113 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2114 printFieldInfo<surfaceSymmTensorField>(mesh_);
2115 printFieldInfo<surfaceTensorField>(mesh_);
2116 printIntFieldInfo<volScalarField::Internal>(mesh_);
2117 printIntFieldInfo<volVectorField::Internal>(mesh_);
2118 printIntFieldInfo<volSphericalTensorField::Internal>(mesh_);
2119 printIntFieldInfo<volSymmTensorField::Internal>(mesh_);
2120 printIntFieldInfo<volTensorField::Internal>(mesh_);
2155 forAll(nSendCells, recvProc)
2164 <<
"SUBSETTING FOR DOMAIN " << recvProc
2165 <<
" cells to send:"
2166 << nSendCells[recvProc]
2184 subCellMap[recvProc] = subsetter.
cellMap();
2186 inplaceRenumberWithFlip
2191 subFaceMap[recvProc]
2193 subPointMap[recvProc] = subsetter.
pointMap();
2194 subPatchMap[recvProc] = subsetter.
patchMap();
2213 mesh_.faceNeighbour(),
2214 mesh_.nInternalFaces(),
2225 procSourceNewNbrProc,
2226 procSourcePointMaster
2243 procSourceNewNbrProc,
2244 procSourcePointMaster,
2250 sendFields<volScalarField>
2257 sendFields<volVectorField>
2264 sendFields<volSphericalTensorField>
2271 sendFields<volSymmTensorField>
2278 sendFields<volTensorField>
2287 sendFields<surfaceScalarField>
2294 sendFields<surfaceVectorField>
2301 sendFields<surfaceSphericalTensorField>
2308 sendFields<surfaceSymmTensorField>
2315 sendFields<surfaceTensorField>
2324 sendFields<volScalarField::Internal>
2331 sendFields<volVectorField::Internal>
2338 sendFields<volSphericalTensorField::Internal>
2345 sendFields<volSymmTensorField::Internal>
2352 sendFields<volTensorField::Internal>
2378 Pout<<
"Finished sending and receiving : " <<
flatOutput(recvSizes)
2389 const labelList oldFaceOwner(mesh_.faceOwner());
2390 const labelList oldFaceNeighbour(mesh_.faceNeighbour());
2391 const label oldInternalFaces = mesh_.nInternalFaces();
2417 for (
const label facei : flip)
2434 subMap().pointMap(),
2452 domainSourceNewNbrProc,
2453 domainSourcePointMaster
2456 sourceFace.
transfer(domainSourceFace);
2457 sourceProc.
transfer(domainSourceProc);
2458 sourcePatch.transfer(domainSourcePatch);
2459 sourceNewNbrProc.
transfer(domainSourceNewNbrProc);
2460 sourcePointMaster.
transfer(domainSourcePointMaster);
2468 printMeshInfo(mesh_);
2469 printFieldInfo<volScalarField>(mesh_);
2470 printFieldInfo<volVectorField>(mesh_);
2471 printFieldInfo<volSphericalTensorField>(mesh_);
2472 printFieldInfo<volSymmTensorField>(mesh_);
2473 printFieldInfo<volTensorField>(mesh_);
2474 printFieldInfo<surfaceScalarField>(mesh_);
2475 printFieldInfo<surfaceVectorField>(mesh_);
2476 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2477 printFieldInfo<surfaceSymmTensorField>(mesh_);
2478 printFieldInfo<surfaceTensorField>(mesh_);
2479 printIntFieldInfo<volScalarField::Internal>(mesh_);
2480 printIntFieldInfo<volVectorField::Internal>(mesh_);
2481 printIntFieldInfo<volSphericalTensorField::Internal>(mesh_);
2482 printIntFieldInfo<volSymmTensorField::Internal>(mesh_);
2483 printIntFieldInfo<volTensorField::Internal>(mesh_);
2530 forAll(nRevcCells, sendProc)
2538 <<
"RECEIVING FROM DOMAIN " << sendProc
2539 <<
" cells to receive:"
2540 << nRevcCells[sendProc]
2551 labelList& domainSourceFace = domainSourceFaces[sendProc];
2554 labelList& domainSourceProc = domainSourceProcs[sendProc];
2557 labelList& domainSourcePatch = domainSourcePatchs[sendProc];
2559 domainSourceNewNbrProcs.
set(sendProc,
new labelList(0));
2561 domainSourceNewNbrProcs[sendProc];
2563 domainSourcePointMasters.
set(sendProc,
new labelList(0));
2565 domainSourcePointMasters[sendProc];
2576 const_cast<Time&
>(mesh_.time()),
2580 domainSourceNewNbrProc,
2581 domainSourcePointMaster,
2584 domainMeshPtrs.
set(sendProc, domainMeshPtr.
ptr());
2585 fvMesh& domainMesh = domainMeshPtrs[sendProc];
2596 receiveFields<volScalarField>
2605 receiveFields<volVectorField>
2618 receiveFields<volSphericalTensorField>
2627 receiveFields<volSymmTensorField>
2636 receiveFields<volTensorField>
2647 receiveFields<surfaceScalarField>
2656 receiveFields<surfaceVectorField>
2669 receiveFields<surfaceSphericalTensorField>
2678 receiveFields<surfaceSymmTensorField>
2687 receiveFields<surfaceTensorField>
2702 receiveFields<volScalarField::Internal>
2715 receiveFields<volVectorField::Internal>
2728 receiveFields<volSphericalTensorField::Internal>
2741 receiveFields<volSymmTensorField::Internal>
2754 receiveFields<volTensorField::Internal>
2773 forAll(domainMeshPtrs, proci)
2775 if (domainMeshPtrs.
set(proci))
2777 meshes.
set(proci, &domainMeshPtrs[proci]);
2778 fvMeshes.
set(proci, &domainMeshPtrs[proci]);
2824 const label nOldInternalFaces = mesh_.nInternalFaces();
2825 const labelList oldFaceOwner(mesh_.faceOwner());
2847 printMeshInfo(mesh_);
2848 printFieldInfo<volScalarField>(mesh_);
2849 printFieldInfo<volVectorField>(mesh_);
2850 printFieldInfo<volSphericalTensorField>(mesh_);
2851 printFieldInfo<volSymmTensorField>(mesh_);
2852 printFieldInfo<volTensorField>(mesh_);
2853 printFieldInfo<surfaceScalarField>(mesh_);
2854 printFieldInfo<surfaceVectorField>(mesh_);
2855 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2856 printFieldInfo<surfaceSymmTensorField>(mesh_);
2857 printFieldInfo<surfaceTensorField>(mesh_);
2858 printIntFieldInfo<volScalarField::Internal>(mesh_);
2859 printIntFieldInfo<volVectorField::Internal>(mesh_);
2860 printIntFieldInfo<volSphericalTensorField::Internal>(mesh_);
2861 printIntFieldInfo<volSymmTensorField::Internal>(mesh_);
2862 printIntFieldInfo<volTensorField::Internal>(mesh_);
2868 sourceProc.
setSize(mesh_.nBoundaryFaces());
2870 sourcePatch.
setSize(mesh_.nBoundaryFaces());
2872 sourceFace.
setSize(mesh_.nBoundaryFaces());
2874 sourceNewNbrProc.
setSize(mesh_.nBoundaryFaces());
2875 sourceNewNbrProc = -1;
2876 sourcePointMaster.
setSize(mesh_.nPoints());
2877 sourcePointMaster = -1;
2879 if (mesh_.nPoints() > 0)
2883 if (domainSourceFaces.
set(meshi))
2885 const label nIntFaces =
2889 :
meshes[meshi].nInternalFaces()
2895 :
meshes[meshi].faceOwner()
2899 const labelList& cellMap = constructCellMap[meshi];
2902 domainSourceFaces[meshi];
2904 domainSourceProcs[meshi];
2906 domainSourcePatchs[meshi];
2908 domainSourceNewNbrProcs[meshi];
2912 constructPointMap[meshi]
2913 ) = domainSourcePointMasters[meshi];
2916 forAll(domainSourceFace, bFacei)
2918 const label oldFacei = bFacei+nIntFaces;
2919 const label allFacei =
faceMap[oldFacei];
2920 const label allbFacei = allFacei-mesh_.nInternalFaces();
2924 sourceProc[allbFacei] = domainSourceProc[bFacei];
2925 sourcePatch[allbFacei] = domainSourcePatch[bFacei];
2926 sourceFace[allbFacei] = domainSourceFace[bFacei];
2927 sourceNewNbrProc[allbFacei] =
2928 domainSourceNewNbr[bFacei];
2936 const label allFacei =
faceMap[oldFacei];
2937 const label allOwn = mesh_.faceOwner()[allFacei];
2939 if (cellMap[faceOwner[oldFacei]] == allOwn)
2963 printMeshInfo(mesh_);
2964 printFieldInfo<volScalarField>(mesh_);
2965 printFieldInfo<volVectorField>(mesh_);
2966 printFieldInfo<volSphericalTensorField>(mesh_);
2967 printFieldInfo<volSymmTensorField>(mesh_);
2968 printFieldInfo<volTensorField>(mesh_);
2969 printFieldInfo<surfaceScalarField>(mesh_);
2970 printFieldInfo<surfaceVectorField>(mesh_);
2971 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2972 printFieldInfo<surfaceSymmTensorField>(mesh_);
2973 printFieldInfo<surfaceTensorField>(mesh_);
2974 printIntFieldInfo<volScalarField::Internal>(mesh_);
2975 printIntFieldInfo<volVectorField::Internal>(mesh_);
2976 printIntFieldInfo<volSphericalTensorField::Internal>(mesh_);
2977 printIntFieldInfo<volSymmTensorField::Internal>(mesh_);
2978 printIntFieldInfo<volTensorField::Internal>(mesh_);
2985 mergeSharedPoints(sourcePointMaster, constructPointMap);
2997 addProcPatches(sourceNewNbrProc, sourcePatch, procPatchID);
3016 repatch(newPatchID, constructFaceMap);
3020 initPatchFields<volScalarField, processorFvPatchField<scalar>>
3024 initPatchFields<volVectorField, processorFvPatchField<vector>>
3036 initPatchFields<volSymmTensorField, processorFvPatchField<symmTensor>>
3040 initPatchFields<volTensorField, processorFvPatchField<tensor>>
3046 mesh_.setInstance(mesh_.time().timeName());
3053 printMeshInfo(mesh_);
3054 printFieldInfo<volScalarField>(mesh_);
3055 printFieldInfo<volVectorField>(mesh_);
3056 printFieldInfo<volSphericalTensorField>(mesh_);
3057 printFieldInfo<volSymmTensorField>(mesh_);
3058 printFieldInfo<volTensorField>(mesh_);
3059 printFieldInfo<surfaceScalarField>(mesh_);
3060 printFieldInfo<surfaceVectorField>(mesh_);
3061 printFieldInfo<surfaceSphericalTensorField>(mesh_);
3062 printFieldInfo<surfaceSymmTensorField>(mesh_);
3063 printFieldInfo<surfaceTensorField>(mesh_);
3064 printIntFieldInfo<volScalarField::Internal>(mesh_);
3065 printIntFieldInfo<volVectorField::Internal>(mesh_);
3066 printIntFieldInfo<volSphericalTensorField::Internal>(mesh_);
3067 printIntFieldInfo<volSymmTensorField::Internal>(mesh_);
3068 printIntFieldInfo<volTensorField::Internal>(mesh_);
3080 std::move(oldPatchStarts),
3081 std::move(oldPatchNMeshPoints),
3083 std::move(subPointMap),
3084 std::move(subFaceMap),
3085 std::move(subCellMap),
3086 std::move(subPatchMap),
3088 std::move(constructPointMap),
3089 std::move(constructFaceMap),
3090 std::move(constructCellMap),
3091 std::move(constructPatchMap),