68 referPatchID_(referPatchID)
73 if (nbrProc_[a] < nbrProc_[
b])
77 else if (nbrProc_[a] > nbrProc_[
b])
84 return referPatchID_[a] < referPatchID_[
b];
93 void Foam::fvMeshDistribute::inplaceRenumberWithFlip
96 const bool oldToNewHasFlip,
97 const bool lstHasFlip,
101 if (!lstHasFlip && !oldToNewHasFlip)
112 label val = lst[elemI];
128 <<
"Problem : zero value " << val
129 <<
" at index " << elemI <<
" out of " << lst.size()
136 label newVal = oldToNew[val];
152 <<
"Problem : zero value " << newVal
153 <<
" at index " << elemI <<
" out of "
161 lst[elemI] =
sign*(newVal+1);
169 const bool selectEqual,
178 if (selectEqual == (
values[i] == value))
189 if (selectEqual == (
values[i] == value))
208 mergedNames.insert(allNames[proci]);
210 return mergedNames.sortedToc();
216 Pout<<
"Primitives:" <<
nl
230 Pout<<
" " << patchi <<
" name:" << pp.
name()
231 <<
" size:" << pp.size()
232 <<
" start:" << pp.
start()
233 <<
" type:" << pp.type()
243 Pout<<
" " << zoneI <<
" name:" << pz.
name()
244 <<
" size:" << pz.size()
254 Pout<<
" " << zoneI <<
" name:" << fz.
name()
255 <<
" size:" << fz.size()
265 Pout<<
" " << zoneI <<
" name:" << cz.
name()
266 <<
" size:" << cz.size()
283 <<
"Current coupling info:"
286 forAll(sourceFace, bFacei)
290 Pout<<
" meshFace:" << meshFacei
292 <<
" connects to proc:" << sourceProc[bFacei]
293 <<
"/face:" << sourceFace[bFacei]
294 <<
" which will move to proc:" << sourceNewNbrProc[bFacei]
300 Foam::label Foam::fvMeshDistribute::findNonEmptyPatch()
const
315 if (isA<cyclicACMIPolyPatch>(pp))
317 isCoupledPatch.
set(patchi);
319 refCast<const cyclicACMIPolyPatch>(pp);
321 if (dupPatchID != -1)
323 isCoupledPatch.set(dupPatchID);
328 isCoupledPatch.set(patchi);
332 label nonEmptyPatchi = -1;
336 const polyPatch& pp =
patches[patchi];
338 if (!isA<emptyPolyPatch>(pp) && !isCoupledPatch(patchi))
340 nonEmptyPatchi = patchi;
345 if (nonEmptyPatchi == -1)
348 <<
"Cannot find a patch which is neither of type empty nor"
350 <<
"There has to be at least one such patch for"
356 Pout<<
"findNonEmptyPatch : using patch " << nonEmptyPatchi
358 <<
" type:" <<
patches[nonEmptyPatchi].type()
359 <<
" to put exposed faces into." <<
endl;
365 label procPatchi = -1;
369 if (isA<processorPolyPatch>(
patches[patchi]))
373 else if (procPatchi != -1)
376 <<
"Processor patches should be at end of patch list."
378 <<
"Have processor patch " << procPatchi
379 <<
" followed by non-processor patch " << patchi
385 return nonEmptyPatchi;
418 fld[facei] = (
n[facei] & testNormal);
421 surfaceScalarField::Boundary& fluxBf =
fld.boundaryFieldRef();
422 const surfaceVectorField::Boundary& nBf =
n.boundaryField();
431 newPfld[i] = (nBf[patchi][i] & testNormal);
450 scalar
cos = (
n[facei] & testNormal);
456 <<
"On internal face " << facei <<
" at "
458 <<
" the field value is " <<
fld[facei]
459 <<
" whereas cos angle of " << testNormal
460 <<
" with mesh normal " <<
n[facei]
473 scalar
cos = (np[i] & testNormal);
480 <<
"On face " << facei
483 <<
" the field value is " << fvp[i]
484 <<
" whereas cos angle of " << testNormal
485 <<
" with mesh normal " << np[i]
497 const label destinationPatch
505 labelList newPatchID(mesh_.nBoundaryFaces(), -1);
509 forAll(mesh_.boundaryMesh(), patchi)
513 if (isA<processorPolyPatch>(pp))
517 Pout<<
"Moving all faces of patch " << pp.
name()
518 <<
" into patch " << destinationPatch
522 label offset = pp.
start() - mesh_.nInternalFaces();
526 newPatchID[offset+i] = destinationPatch;
537 autoPtr<mapPolyMesh> map = repatch(newPatchID, dummyFaceMaps);
545 forAll(mesh_.boundaryMesh(), patchi)
547 if (!isA<processorPolyPatch>(mesh_.boundaryMesh()[patchi]))
549 oldToNew[patchi] = newi++;
552 label nNonProcPatches = newi;
555 forAll(mesh_.boundaryMesh(), patchi)
557 if (isA<processorPolyPatch>(mesh_.boundaryMesh()[patchi]))
559 oldToNew[patchi] = newi++;
575 polyTopoChange meshMod(mesh_);
577 forAll(newPatchID, bFacei)
579 if (newPatchID[bFacei] != -1)
581 label facei = mesh_.nInternalFaces() + bFacei;
583 label
zoneID = mesh_.faceZones().whichZone(facei);
584 bool zoneFlip =
false;
588 const faceZone& fZone = mesh_.faceZones()[
zoneID];
589 zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
596 mesh_.faces()[facei],
598 mesh_.faceOwner()[facei],
615 PtrList<FieldField<fvsPatchField, scalar>> sFlds;
616 saveBoundaryFields<scalar, surfaceMesh>(sFlds);
617 PtrList<FieldField<fvsPatchField, vector>> vFlds;
618 saveBoundaryFields<vector, surfaceMesh>(vFlds);
619 PtrList<FieldField<fvsPatchField, sphericalTensor>> sptFlds;
620 saveBoundaryFields<sphericalTensor, surfaceMesh>(sptFlds);
621 PtrList<FieldField<fvsPatchField, symmTensor>> sytFlds;
622 saveBoundaryFields<symmTensor, surfaceMesh>(sytFlds);
623 PtrList<FieldField<fvsPatchField, tensor>> tFlds;
624 saveBoundaryFields<tensor, surfaceMesh>(tFlds);
633 autoPtr<mapPolyMesh> mapPtr = meshMod.changeMesh(mesh_,
false,
true);
634 mapPolyMesh& map = *mapPtr;
637 mesh_.updateMesh(map);
641 mapBoundaryFields<scalar, surfaceMesh>(map, sFlds);
642 mapBoundaryFields<vector, surfaceMesh>(map, vFlds);
643 mapBoundaryFields<sphericalTensor, surfaceMesh>(map, sptFlds);
644 mapBoundaryFields<symmTensor, surfaceMesh>(map, sytFlds);
645 mapBoundaryFields<tensor, surfaceMesh>(map, tFlds);
649 if (map.hasMotionPoints())
651 mesh_.movePoints(map.preMotionPoints());
658 label index = map.reverseFaceMap().find(-1);
663 <<
"reverseFaceMap contains -1 at index:"
665 <<
"This means that the repatch operation was not just"
670 forAll(constructFaceMap, proci)
672 inplaceRenumberWithFlip
674 map.reverseFaceMap(),
677 constructFaceMap[proci]
700 forAll(pointToGlobalMaster, pointi)
702 if (pointToGlobalMaster[pointi] != -1)
708 Map<label> globalMasterToLocalMaster(2*nShared);
709 Map<label> pointToMaster(2*nShared);
711 forAll(pointToGlobalMaster, pointi)
713 label globali = pointToGlobalMaster[pointi];
716 const auto iter = globalMasterToLocalMaster.cfind(globali);
720 pointToMaster.insert(pointi, *iter);
725 globalMasterToLocalMaster.insert(globali, pointi);
726 pointToMaster.insert(pointi, pointi);
731 if (
returnReduce(pointToMaster.size(), sumOp<label>()) == 0)
737 polyTopoChange meshMod(mesh_);
742 autoPtr<mapPolyMesh> mapPtr = meshMod.changeMesh(mesh_,
false,
true);
743 mapPolyMesh& map = *mapPtr;
746 mesh_.updateMesh(map);
749 forAll(constructPointMap, proci)
751 labelList& constructMap = constructPointMap[proci];
755 label oldPointi = constructMap[i];
757 label
newPointi = map.reversePointMap()[oldPointi];
770 <<
"Problem. oldPointi:" << oldPointi
780 void Foam::fvMeshDistribute::getCouplingData
793 const label nBnd = mesh_.nBoundaryFaces();
794 sourceFace.setSize(nBnd);
795 sourceProc.setSize(nBnd);
796 sourcePatch.setSize(nBnd);
797 sourceNewNbrProc.setSize(nBnd);
799 const polyBoundaryMesh&
patches = mesh_.boundaryMesh();
807 const polyPatch& pp =
patches[patchi];
811 label offset = pp.
start() - mesh_.nInternalFaces();
816 label bndI = offset + i;
817 nbrFaces[bndI] = pp.start()+i;
821 SubList<label>(nbrNewNbrProc, pp.size(), offset) =
834 const polyPatch& pp =
patches[patchi];
835 label offset = pp.
start() - mesh_.nInternalFaces();
837 if (isA<processorPolyPatch>(pp))
839 const processorPolyPatch& procPatch =
840 refCast<const processorPolyPatch>(pp);
844 if (procPatch.owner())
849 label bndI = offset + i;
850 sourceFace[bndI] = pp.start()+i;
852 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
860 label bndI = offset + i;
861 sourceFace[bndI] = nbrFaces[bndI];
862 sourceProc[bndI] = procPatch.neighbProcNo();
863 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
869 if (isA<processorCyclicPolyPatch>(pp))
871 patchi = refCast<const processorCyclicPolyPatch>
879 label bndI = offset + i;
880 sourcePatch[bndI] = patchi;
883 else if (isA<cyclicPolyPatch>(pp))
885 const cyclicPolyPatch& cpp = refCast<const cyclicPolyPatch>(pp);
891 label bndI = offset + i;
892 sourceFace[bndI] = pp.start()+i;
894 sourcePatch[bndI] = patchi;
895 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
902 label bndI = offset + i;
903 sourceFace[bndI] = nbrFaces[bndI];
905 sourcePatch[bndI] = patchi;
906 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
915 label bndI = offset + i;
916 sourceFace[bndI] = -1;
917 sourceProc[bndI] = -1;
918 sourcePatch[bndI] = patchi;
919 sourceNewNbrProc[bndI] = -1;
926 sourcePointMaster.setSize(mesh_.nPoints());
927 sourcePointMaster = -1;
930 const globalIndex globalPoints(mesh_.nPoints());
932 const globalMeshData& gmd = mesh_.globalData();
934 const labelList& meshPoints = cpp.meshPoints();
935 const mapDistribute& slavesMap = gmd.globalCoPointSlavesMap();
938 labelList elems(slavesMap.constructSize(), -1);
939 forAll(meshPoints, pointi)
947 label globalPointi = globalPoints.toGlobal(meshPoints[pointi]);
948 elems[pointi] = globalPointi;
951 label sloti = slots[i];
952 if (sloti >= meshPoints.size())
956 elems[slots[i]] = globalPointi;
963 slavesMap.reverseDistribute(elems.size(), elems,
false);
966 forAll(meshPoints, pointi)
968 sourcePointMaster[meshPoints[pointi]] = elems[pointi];
975 void Foam::fvMeshDistribute::subsetCouplingData
985 const label oldInternalFaces,
1005 forAll(subFace, newBFacei)
1009 label oldFacei =
faceMap[newFacei];
1012 if (oldFacei < oldInternalFaces)
1014 subFace[newBFacei] = oldFacei;
1016 subPatch[newBFacei] = -1;
1018 label oldOwn = oldFaceOwner[oldFacei];
1019 label oldNei = oldFaceNeighbour[oldFacei];
1024 subNewNbrProc[newBFacei] = oldDistribution[oldNei];
1029 subNewNbrProc[newBFacei] = oldDistribution[oldOwn];
1035 label oldBFacei = oldFacei - oldInternalFaces;
1037 subFace[newBFacei] = sourceFace[oldBFacei];
1038 subProc[newBFacei] = sourceProc[oldBFacei];
1039 subPatch[newBFacei] = sourcePatch[oldBFacei];
1040 subNewNbrProc[newBFacei] = sourceNewNbrProc[oldBFacei];
1045 subPointMaster = UIndirectList<label>(sourcePointMaster, pointMap);
1051 void Foam::fvMeshDistribute::findCouples
1053 const primitiveMesh&
mesh,
1059 const primitiveMesh& domainMesh,
1072 forAll(domainProc, bFacei)
1074 if (domainProc[bFacei] != -1 && domainPatch[bFacei] == -1)
1078 labelPair(domainFace[bFacei], domainProc[bFacei]),
1087 masterCoupledFaces.setSize(domainFace.size());
1088 slaveCoupledFaces.setSize(domainFace.size());
1091 forAll(sourceFace, bFacei)
1093 if (sourceProc[bFacei] != -1 && sourcePatch[bFacei] == -1)
1095 labelPair myData(sourceFace[bFacei], sourceProc[bFacei]);
1097 const auto iter = map.cfind(myData);
1101 label nbrBFacei = *iter;
1104 slaveCoupledFaces[coupledI] =
1105 domainMesh.nInternalFaces()
1113 masterCoupledFaces.setSize(coupledI);
1114 slaveCoupledFaces.setSize(coupledI);
1118 Pout<<
"findCouples : found " << coupledI
1119 <<
" faces that will be stitched" <<
nl <<
endl;
1127 const primitiveMesh&
mesh,
1128 const mapAddedPolyMesh& map,
1130 const label nInternalFaces1,
1136 forAll(boundaryData0, oldBFacei)
1138 label newFacei = map.oldFaceMap()[oldBFacei + map.nOldInternalFaces()];
1144 boundaryData0[oldBFacei];
1148 forAll(boundaryData1, addedBFacei)
1150 label newFacei = map.addedFaceMap()[addedBFacei + nInternalFaces1];
1155 boundaryData1[addedBFacei];
1159 return newBoundaryData;
1165 const primitiveMesh&
mesh,
1166 const mapAddedPolyMesh& map,
1173 forAll(boundaryData0, oldPointi)
1175 label
newPointi = map.oldPointMap()[oldPointi];
1180 newBoundaryData[
newPointi] = boundaryData0[oldPointi];
1184 forAll(boundaryData1, addedPointi)
1186 label
newPointi = map.addedPointMap()[addedPointi];
1190 newBoundaryData[
newPointi] = boundaryData1[addedPointi];
1194 return newBoundaryData;
1202 const label oldInternalPatchi
1206 polyTopoChange meshMod(mesh_);
1210 removeCells cellRemover(mesh_,
false);
1213 labelList exposedFaces(cellRemover.getExposedFaces(cellsToRemove));
1216 cellRemover.setRefinement
1220 labelList(exposedFaces.size(), oldInternalPatchi),
1231 PtrList<Field<scalar>> sFlds;
1232 saveInternalFields(sFlds);
1233 PtrList<Field<vector>> vFlds;
1234 saveInternalFields(vFlds);
1235 PtrList<Field<sphericalTensor>> sptFlds;
1236 saveInternalFields(sptFlds);
1237 PtrList<Field<symmTensor>> sytFlds;
1238 saveInternalFields(sytFlds);
1239 PtrList<Field<tensor>> tFlds;
1240 saveInternalFields(tFlds);
1243 autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh_,
false,
false);
1246 mesh_.updateMesh(map());
1253 mapExposedFaces(map(), sFlds);
1254 mapExposedFaces(map(), vFlds);
1255 mapExposedFaces(map(), sptFlds);
1256 mapExposedFaces(map(), sytFlds);
1257 mapExposedFaces(map(), tFlds);
1265 if (map().hasMotionPoints())
1267 mesh_.movePoints(map().preMotionPoints());
1277 void Foam::fvMeshDistribute::addProcPatches
1281 List<Map<label>>& procPatchID
1293 sortedOrder(nbrProc, indices, lessProcPatches(nbrProc, referPatchID));
1299 label bFacei = indices[i];
1300 label proci = nbrProc[bFacei];
1304 if (!procPatchID[proci].
found(referPatchID[bFacei]))
1309 if (referPatchID[bFacei] == -1)
1313 processorPolyPatch pp
1317 mesh_.boundaryMesh().size(),
1318 mesh_.boundaryMesh(),
1323 procPatchID[proci].insert
1325 referPatchID[bFacei],
1331 processorFvPatchField<scalar>::typeName,
1338 const coupledPolyPatch& pcPatch
1339 = refCast<const coupledPolyPatch>
1341 mesh_.boundaryMesh()[referPatchID[bFacei]]
1343 processorCyclicPolyPatch pp
1347 mesh_.boundaryMesh().size(),
1348 mesh_.boundaryMesh(),
1355 procPatchID[proci].insert
1357 referPatchID[bFacei],
1363 processorCyclicFvPatchField<scalar>::typeName,
1379 const List<Map<label>>& procPatchID
1388 label origPatchi = referPatchID[bFacei];
1389 patchIDs[bFacei] = origPatchi;
1391 else if (nbrProc[bFacei] != -1)
1393 label origPatchi = referPatchID[bFacei];
1394 patchIDs[bFacei] = procPatchID[nbrProc[bFacei]][origPatchi];
1398 patchIDs[bFacei] = -1;
1406 void Foam::fvMeshDistribute::sendMesh
1425 Pout<<
"Sending to domain " << domain <<
nl
1435 CompactListList<label> zonePoints;
1441 forAll(pointZoneNames, nameI)
1443 label myZoneID = pointZones.findZoneID(pointZoneNames[nameI]);
1447 rowSizes[nameI] = pointZones[myZoneID].size();
1450 zonePoints.setSize(rowSizes);
1452 forAll(pointZoneNames, nameI)
1454 label myZoneID = pointZones.findZoneID(pointZoneNames[nameI]);
1458 zonePoints[nameI].deepCopy(pointZones[myZoneID]);
1464 CompactListList<label> zoneFaces;
1465 CompactListList<bool> zoneFaceFlip;
1471 forAll(faceZoneNames, nameI)
1473 label myZoneID = faceZones.findZoneID(faceZoneNames[nameI]);
1477 rowSizes[nameI] = faceZones[myZoneID].size();
1481 zoneFaces.setSize(rowSizes);
1482 zoneFaceFlip.setSize(rowSizes);
1484 forAll(faceZoneNames, nameI)
1486 label myZoneID = faceZones.findZoneID(faceZoneNames[nameI]);
1490 zoneFaces[nameI].deepCopy(faceZones[myZoneID]);
1491 zoneFaceFlip[nameI].deepCopy(faceZones[myZoneID].flipMap());
1497 CompactListList<label> zoneCells;
1503 forAll(cellZoneNames, nameI)
1505 label myZoneID = cellZones.findZoneID(cellZoneNames[nameI]);
1509 rowSizes[nameI] = cellZones[myZoneID].size();
1513 zoneCells.setSize(rowSizes);
1515 forAll(cellZoneNames, nameI)
1517 label myZoneID = cellZones.findZoneID(cellZoneNames[nameI]);
1521 zoneCells[nameI].deepCopy(cellZones[myZoneID]);
1543 << CompactListList<label, face>(
mesh.
faces())
1557 << sourcePointMaster;
1562 Pout<<
"Started sending mesh to domain " << domain
1585 faceList domainFaces = CompactListList<label, face>(fromNbr)();
1588 PtrList<entry> patchEntries(fromNbr);
1590 CompactListList<label> zonePoints(fromNbr);
1591 CompactListList<label> zoneFaces(fromNbr);
1592 CompactListList<bool> zoneFaceFlip(fromNbr);
1593 CompactListList<label> zoneCells(fromNbr);
1598 >> domainSourcePatch
1599 >> domainSourceNewNbrProc
1600 >> domainSourcePointMaster;
1612 std::move(domainPoints),
1613 std::move(domainFaces),
1614 std::move(domainAllOwner),
1615 std::move(domainAllNeighbour),
1618 fvMesh& domainMesh = *domainMeshPtr;
1620 List<polyPatch*>
patches(patchEntries.size());
1622 forAll(patchEntries, patchi)
1626 patchEntries[patchi].keyword(),
1627 patchEntries[patchi].
dict(),
1629 domainMesh.boundaryMesh()
1633 domainMesh.addFvPatches(
patches,
false);
1636 List<pointZone*> pZonePtrs(pointZoneNames.size());
1639 pZonePtrs[i] =
new pointZone
1644 domainMesh.pointZones()
1648 List<faceZone*> fZonePtrs(faceZoneNames.size());
1651 fZonePtrs[i] =
new faceZone
1657 domainMesh.faceZones()
1661 List<cellZone*> cZonePtrs(cellZoneNames.size());
1664 cZonePtrs[i] =
new cellZone
1669 domainMesh.cellZones()
1672 domainMesh.addZones(pZonePtrs, fZonePtrs, cZonePtrs);
1674 return domainMeshPtr;
1680 Foam::fvMeshDistribute::fvMeshDistribute(
fvMesh&
mesh,
const scalar mergeTol)
1704 <<
"At index " << celli <<
" distribution:" << newProc
1722 <<
"Size of distribution:"
1723 <<
distribution.size() <<
" mesh nCells:" << mesh_.nCells()
1734 <<
"This application requires all non-processor patches"
1735 <<
" to be present in the same order on all patches" <<
nl
1736 <<
"followed by the processor patches (which of course are unique)."
1738 <<
"Local patches:" << mesh_.boundaryMesh().names()
1743 const label nOldPoints(mesh_.nPoints());
1744 const label nOldFaces(mesh_.nFaces());
1745 const label nOldCells(mesh_.nCells());
1751 oldPatchNMeshPoints[patchi] =
patches[patchi].nPoints();
1767 std::move(oldPatchStarts),
1768 std::move(oldPatchNMeshPoints),
1784 const wordList pointZoneNames(mergeWordList(mesh_.pointZones().names()));
1785 const wordList faceZoneNames(mergeWordList(mesh_.faceZones().names()));
1786 const wordList cellZoneNames(mergeWordList(mesh_.cellZones().names()));
1850 mesh_.resetMotion();
1856 getFieldNames<volScalarField>(mesh_, allFieldNames);
1857 getFieldNames<volVectorField>(mesh_, allFieldNames);
1858 getFieldNames<volSphericalTensorField>(mesh_, allFieldNames);
1859 getFieldNames<volSymmTensorField>(mesh_, allFieldNames);
1860 getFieldNames<volTensorField>(mesh_, allFieldNames);
1862 getFieldNames<surfaceScalarField>(mesh_, allFieldNames);
1863 getFieldNames<surfaceVectorField>(mesh_, allFieldNames);
1864 getFieldNames<surfaceSphericalTensorField>(mesh_, allFieldNames);
1865 getFieldNames<surfaceSymmTensorField>(mesh_, allFieldNames);
1866 getFieldNames<surfaceTensorField>(mesh_, allFieldNames);
1868 getFieldNames<volScalarField::Internal>(mesh_, allFieldNames);
1869 getFieldNames<volVectorField::Internal>(mesh_, allFieldNames);
1870 getFieldNames<volSphericalTensorField::Internal>(mesh_, allFieldNames);
1871 getFieldNames<volSymmTensorField::Internal>(mesh_, allFieldNames);
1872 getFieldNames<volTensorField::Internal>(mesh_, allFieldNames);
1876 const label oldInternalPatchi = findNonEmptyPatch();
1886 repatchFaceMap = repatchMap().faceMap();
1893 repatchMap().reverseFaceMap(),
1894 mesh_.nBoundaryFaces(),
1895 mesh_.nInternalFaces()
1897 - mesh_.nInternalFaces()
1911 Pout<<
nl <<
"MESH WITH PROC PATCHES DELETED:" <<
endl;
1912 printMeshInfo(mesh_);
1913 printFieldInfo<volScalarField>(mesh_);
1914 printFieldInfo<volVectorField>(mesh_);
1915 printFieldInfo<volSphericalTensorField>(mesh_);
1916 printFieldInfo<volSymmTensorField>(mesh_);
1917 printFieldInfo<volTensorField>(mesh_);
1918 printFieldInfo<surfaceScalarField>(mesh_);
1919 printFieldInfo<surfaceVectorField>(mesh_);
1920 printFieldInfo<surfaceSphericalTensorField>(mesh_);
1921 printFieldInfo<surfaceSymmTensorField>(mesh_);
1922 printFieldInfo<surfaceTensorField>(mesh_);
1957 forAll(nSendCells, recvProc)
1966 <<
"SUBSETTING FOR DOMAIN " << recvProc
1967 <<
" cells to send:"
1968 << nSendCells[recvProc]
1986 subCellMap[recvProc] = subsetter.
cellMap();
1988 inplaceRenumberWithFlip
1993 subFaceMap[recvProc]
1995 subPointMap[recvProc] = subsetter.
pointMap();
1996 subPatchMap[recvProc] = subsetter.
patchMap();
2015 mesh_.faceNeighbour(),
2016 mesh_.nInternalFaces(),
2027 procSourceNewNbrProc,
2028 procSourcePointMaster
2045 procSourceNewNbrProc,
2046 procSourcePointMaster,
2052 sendFields<volScalarField>
2059 sendFields<volVectorField>
2066 sendFields<volSphericalTensorField>
2073 sendFields<volSymmTensorField>
2080 sendFields<volTensorField>
2089 sendFields<surfaceScalarField>
2096 sendFields<surfaceVectorField>
2103 sendFields<surfaceSphericalTensorField>
2110 sendFields<surfaceSymmTensorField>
2117 sendFields<surfaceTensorField>
2126 sendFields<volScalarField::Internal>
2133 sendFields<volVectorField::Internal>
2140 sendFields<volSphericalTensorField::Internal>
2147 sendFields<volSymmTensorField::Internal>
2154 sendFields<volTensorField::Internal>
2177 const labelList oldFaceOwner(mesh_.faceOwner());
2178 const labelList oldFaceNeighbour(mesh_.faceNeighbour());
2179 const label oldInternalFaces = mesh_.nInternalFaces();
2205 for (
const label facei : flip)
2229 subMap().pointMap(),
2247 domainSourceNewNbrProc,
2248 domainSourcePointMaster
2251 sourceFace.
transfer(domainSourceFace);
2252 sourceProc.
transfer(domainSourceProc);
2253 sourcePatch.
transfer(domainSourcePatch);
2254 sourceNewNbrProc.
transfer(domainSourceNewNbrProc);
2255 sourcePointMaster.
transfer(domainSourcePointMaster);
2263 printMeshInfo(mesh_);
2264 printFieldInfo<volScalarField>(mesh_);
2265 printFieldInfo<volVectorField>(mesh_);
2266 printFieldInfo<volSphericalTensorField>(mesh_);
2267 printFieldInfo<volSymmTensorField>(mesh_);
2268 printFieldInfo<volTensorField>(mesh_);
2269 printFieldInfo<surfaceScalarField>(mesh_);
2270 printFieldInfo<surfaceVectorField>(mesh_);
2271 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2272 printFieldInfo<surfaceSymmTensorField>(mesh_);
2273 printFieldInfo<surfaceTensorField>(mesh_);
2285 forAll(nRevcCells, sendProc)
2293 <<
"RECEIVING FROM DOMAIN " << sendProc
2294 <<
" cells to receive:"
2295 << nRevcCells[sendProc]
2334 domainMeshPtr = receiveMesh
2341 const_cast<Time&
>(mesh_.time()),
2345 domainSourceNewNbrProc,
2346 domainSourcePointMaster,
2349 fvMesh& domainMesh = domainMeshPtr();
2359 receiveFields<volScalarField>
2367 receiveFields<volVectorField>
2375 receiveFields<volSphericalTensorField>
2383 receiveFields<volSymmTensorField>
2391 receiveFields<volTensorField>
2401 receiveFields<surfaceScalarField>
2409 receiveFields<surfaceVectorField>
2417 receiveFields<surfaceSphericalTensorField>
2425 receiveFields<surfaceSymmTensorField>
2433 receiveFields<surfaceTensorField>
2443 receiveFields<volScalarField::Internal>
2451 receiveFields<volVectorField::Internal>
2459 receiveFields<volSphericalTensorField::Internal>
2467 receiveFields<volSymmTensorField::Internal>
2475 receiveFields<volTensorField::Internal>
2484 const fvMesh& domainMesh = domainMeshPtr();
2490 constructPatchMap[sendProc] =
2497 Pout<<
nl <<
"RECEIVED MESH FROM:" << sendProc <<
endl;
2498 printMeshInfo(domainMesh);
2499 printFieldInfo<volScalarField>(domainMesh);
2500 printFieldInfo<volVectorField>(domainMesh);
2501 printFieldInfo<volSphericalTensorField>(domainMesh);
2502 printFieldInfo<volSymmTensorField>(domainMesh);
2503 printFieldInfo<volTensorField>(domainMesh);
2504 printFieldInfo<surfaceScalarField>(domainMesh);
2505 printFieldInfo<surfaceVectorField>(domainMesh);
2506 printFieldInfo<surfaceSphericalTensorField>(domainMesh);
2507 printFieldInfo<surfaceSymmTensorField>(domainMesh);
2508 printFieldInfo<surfaceTensorField>(domainMesh);
2567 sourceFace = mapBoundaryData
2575 sourceProc = mapBoundaryData
2583 sourcePatch = mapBoundaryData
2591 sourceNewNbrProc = mapBoundaryData
2597 domainSourceNewNbrProc
2600 sourcePointMaster = mapPointData
2605 domainSourcePointMaster
2611 const labelList& oldCellMap = map().oldCellMap();
2612 const labelList& oldFaceMap = map().oldFaceMap();
2613 const labelList& oldPointMap = map().oldPointMap();
2614 const labelList& oldPatchMap = map().oldPatchMap();
2617 forAll(constructPatchMap, proci)
2619 if (proci != sendProc && constructPatchMap[proci].size())
2623 inplaceRenumberWithFlip
2628 constructFaceMap[proci]
2641 flippedAddedFaces.
resize(nBnd/4);
2646 domainFaceI < domainMesh.
nFaces();
2650 label newFaceI = map().addedFaceMap()[domainFaceI];
2651 label newCellI = mesh_.faceOwner()[newFaceI];
2653 label domainCellI = domainMesh.
faceOwner()[domainFaceI];
2655 if (newCellI != map().addedCellMap()[domainCellI])
2657 flippedAddedFaces.
insert(domainFaceI);
2666 for (
const label domainFaceI : flippedAddedFaces)
2668 label& val = constructFaceMap[sendProc][domainFaceI];
2671 inplaceRenumberWithFlip
2673 map().addedFaceMap(),
2676 constructFaceMap[sendProc]
2683 Pout<<
nl <<
"MERGED MESH FROM:" << sendProc <<
endl;
2684 printMeshInfo(mesh_);
2685 printFieldInfo<volScalarField>(mesh_);
2686 printFieldInfo<volVectorField>(mesh_);
2687 printFieldInfo<volSphericalTensorField>(mesh_);
2688 printFieldInfo<volSymmTensorField>(mesh_);
2689 printFieldInfo<volTensorField>(mesh_);
2690 printFieldInfo<surfaceScalarField>(mesh_);
2691 printFieldInfo<surfaceVectorField>(mesh_);
2692 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2693 printFieldInfo<surfaceSymmTensorField>(mesh_);
2694 printFieldInfo<surfaceTensorField>(mesh_);
2706 printMeshInfo(mesh_);
2707 printFieldInfo<volScalarField>(mesh_);
2708 printFieldInfo<volVectorField>(mesh_);
2709 printFieldInfo<volSphericalTensorField>(mesh_);
2710 printFieldInfo<volSymmTensorField>(mesh_);
2711 printFieldInfo<volTensorField>(mesh_);
2712 printFieldInfo<surfaceScalarField>(mesh_);
2713 printFieldInfo<surfaceVectorField>(mesh_);
2714 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2715 printFieldInfo<surfaceSymmTensorField>(mesh_);
2716 printFieldInfo<surfaceTensorField>(mesh_);
2723 mergeSharedPoints(sourcePointMaster, constructPointMap);
2735 addProcPatches(sourceNewNbrProc, sourcePatch, procPatchID);
2754 repatch(newPatchID, constructFaceMap);
2758 initPatchFields<volScalarField, processorFvPatchField<scalar>>
2762 initPatchFields<volVectorField, processorFvPatchField<vector>>
2774 initPatchFields<volSymmTensorField, processorFvPatchField<symmTensor>>
2778 initPatchFields<volTensorField, processorFvPatchField<tensor>>
2784 mesh_.setInstance(mesh_.time().timeName());
2791 printMeshInfo(mesh_);
2792 printFieldInfo<volScalarField>(mesh_);
2793 printFieldInfo<volVectorField>(mesh_);
2794 printFieldInfo<volSphericalTensorField>(mesh_);
2795 printFieldInfo<volSymmTensorField>(mesh_);
2796 printFieldInfo<volTensorField>(mesh_);
2797 printFieldInfo<surfaceScalarField>(mesh_);
2798 printFieldInfo<surfaceVectorField>(mesh_);
2799 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2800 printFieldInfo<surfaceSymmTensorField>(mesh_);
2801 printFieldInfo<surfaceTensorField>(mesh_);
2813 std::move(oldPatchStarts),
2814 std::move(oldPatchNMeshPoints),
2816 std::move(subPointMap),
2817 std::move(subFaceMap),
2818 std::move(subCellMap),
2819 std::move(subPatchMap),
2821 std::move(constructPointMap),
2822 std::move(constructFaceMap),
2823 std::move(constructCellMap),
2824 std::move(constructPatchMap),