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))
209 mergedNames.insert(allNames[proci]);
211 return mergedNames.sortedToc();
217 Pout<<
"Primitives:" <<
nl
231 Pout<<
" " << patchi <<
" name:" << pp.
name()
232 <<
" size:" << pp.size()
233 <<
" start:" << pp.
start()
234 <<
" type:" << pp.type()
244 Pout<<
" " << zoneI <<
" name:" << pz.
name()
245 <<
" size:" << pz.size()
255 Pout<<
" " << zoneI <<
" name:" << fz.
name()
256 <<
" size:" << fz.size()
266 Pout<<
" " << zoneI <<
" name:" << cz.
name()
267 <<
" size:" << cz.size()
284 <<
"Current coupling info:"
287 forAll(sourceFace, bFacei)
291 Pout<<
" meshFace:" << meshFacei
293 <<
" connects to proc:" << sourceProc[bFacei]
294 <<
"/face:" << sourceFace[bFacei]
295 <<
" which will move to proc:" << sourceNewNbrProc[bFacei]
301 Foam::label Foam::fvMeshDistribute::findNonEmptyPatch()
const
316 if (isA<cyclicACMIPolyPatch>(pp))
318 isCoupledPatch.
set(patchi);
320 refCast<const cyclicACMIPolyPatch>(pp);
322 if (dupPatchID != -1)
324 isCoupledPatch.set(dupPatchID);
329 isCoupledPatch.set(patchi);
333 label nonEmptyPatchi = -1;
337 const polyPatch& pp =
patches[patchi];
341 !isA<emptyPolyPatch>(pp)
342 && !isCoupledPatch(patchi)
343 && !isA<mappedPatchBase>(pp)
346 nonEmptyPatchi = patchi;
351 if (nonEmptyPatchi == -1)
354 <<
"Cannot find a patch which is neither of type empty nor"
356 <<
"There has to be at least one such patch for"
362 Pout<<
"findNonEmptyPatch : using patch " << nonEmptyPatchi
364 <<
" type:" <<
patches[nonEmptyPatchi].type()
365 <<
" to put exposed faces into." <<
endl;
371 label procPatchi = -1;
375 if (isA<processorPolyPatch>(
patches[patchi]))
379 else if (procPatchi != -1)
382 <<
"Processor patches should be at end of patch list."
384 <<
"Have processor patch " << procPatchi
385 <<
" followed by non-processor patch " << patchi
391 return nonEmptyPatchi;
424 fld[facei] = (
n[facei] & testNormal);
427 surfaceScalarField::Boundary& fluxBf =
fld.boundaryFieldRef();
428 const surfaceVectorField::Boundary& nBf =
n.boundaryField();
437 newPfld[i] = (nBf[patchi][i] & testNormal);
456 scalar
cos = (
n[facei] & testNormal);
462 <<
"On internal face " << facei <<
" at "
464 <<
" the field value is " <<
fld[facei]
465 <<
" whereas cos angle of " << testNormal
466 <<
" with mesh normal " <<
n[facei]
479 scalar
cos = (np[i] & testNormal);
486 <<
"On face " << facei
489 <<
" the field value is " << fvp[i]
490 <<
" whereas cos angle of " << testNormal
491 <<
" with mesh normal " << np[i]
503 const label destinationPatch
511 labelList newPatchID(mesh_.nBoundaryFaces(), -1);
515 forAll(mesh_.boundaryMesh(), patchi)
519 if (isA<processorPolyPatch>(pp))
523 Pout<<
"Moving all faces of patch " << pp.
name()
524 <<
" into patch " << destinationPatch
528 label offset = pp.
start() - mesh_.nInternalFaces();
532 newPatchID[offset+i] = destinationPatch;
543 autoPtr<mapPolyMesh> map = repatch(newPatchID, dummyFaceMaps);
551 forAll(mesh_.boundaryMesh(), patchi)
553 if (!isA<processorPolyPatch>(mesh_.boundaryMesh()[patchi]))
555 oldToNew[patchi] = newi++;
558 label nNonProcPatches = newi;
561 forAll(mesh_.boundaryMesh(), patchi)
563 if (isA<processorPolyPatch>(mesh_.boundaryMesh()[patchi]))
565 oldToNew[patchi] = newi++;
581 polyTopoChange meshMod(mesh_);
583 forAll(newPatchID, bFacei)
585 if (newPatchID[bFacei] != -1)
587 label facei = mesh_.nInternalFaces() + bFacei;
589 label
zoneID = mesh_.faceZones().whichZone(facei);
590 bool zoneFlip =
false;
594 const faceZone& fZone = mesh_.faceZones()[
zoneID];
595 zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
602 mesh_.faces()[facei],
604 mesh_.faceOwner()[facei],
621 PtrList<FieldField<fvsPatchField, scalar>> sFlds;
622 saveBoundaryFields<scalar, surfaceMesh>(sFlds);
623 PtrList<FieldField<fvsPatchField, vector>> vFlds;
624 saveBoundaryFields<vector, surfaceMesh>(vFlds);
625 PtrList<FieldField<fvsPatchField, sphericalTensor>> sptFlds;
626 saveBoundaryFields<sphericalTensor, surfaceMesh>(sptFlds);
627 PtrList<FieldField<fvsPatchField, symmTensor>> sytFlds;
628 saveBoundaryFields<symmTensor, surfaceMesh>(sytFlds);
629 PtrList<FieldField<fvsPatchField, tensor>> tFlds;
630 saveBoundaryFields<tensor, surfaceMesh>(tFlds);
639 autoPtr<mapPolyMesh> mapPtr = meshMod.changeMesh(mesh_,
false,
true);
640 mapPolyMesh& map = *mapPtr;
643 mesh_.updateMesh(map);
647 mapBoundaryFields<scalar, surfaceMesh>(map, sFlds);
648 mapBoundaryFields<vector, surfaceMesh>(map, vFlds);
649 mapBoundaryFields<sphericalTensor, surfaceMesh>(map, sptFlds);
650 mapBoundaryFields<symmTensor, surfaceMesh>(map, sytFlds);
651 mapBoundaryFields<tensor, surfaceMesh>(map, tFlds);
655 if (map.hasMotionPoints())
657 mesh_.movePoints(map.preMotionPoints());
664 label index = map.reverseFaceMap().find(-1);
669 <<
"reverseFaceMap contains -1 at index:"
671 <<
"This means that the repatch operation was not just"
676 forAll(constructFaceMap, proci)
678 inplaceRenumberWithFlip
680 map.reverseFaceMap(),
683 constructFaceMap[proci]
706 forAll(pointToGlobalMaster, pointi)
708 if (pointToGlobalMaster[pointi] != -1)
714 Map<label> globalMasterToLocalMaster(2*nShared);
715 Map<label> pointToMaster(2*nShared);
717 forAll(pointToGlobalMaster, pointi)
719 label globali = pointToGlobalMaster[pointi];
722 const auto iter = globalMasterToLocalMaster.cfind(globali);
726 pointToMaster.insert(pointi, *iter);
731 globalMasterToLocalMaster.insert(globali, pointi);
732 pointToMaster.insert(pointi, pointi);
737 if (
returnReduce(pointToMaster.size(), sumOp<label>()) == 0)
743 polyTopoChange meshMod(mesh_);
748 autoPtr<mapPolyMesh> mapPtr = meshMod.changeMesh(mesh_,
false,
true);
749 mapPolyMesh& map = *mapPtr;
752 mesh_.updateMesh(map);
755 forAll(constructPointMap, proci)
757 labelList& constructMap = constructPointMap[proci];
761 label oldPointi = constructMap[i];
763 label
newPointi = map.reversePointMap()[oldPointi];
776 <<
"Problem. oldPointi:" << oldPointi
786 void Foam::fvMeshDistribute::getCouplingData
799 const label nBnd = mesh_.nBoundaryFaces();
800 sourceFace.setSize(nBnd);
801 sourceProc.setSize(nBnd);
802 sourcePatch.setSize(nBnd);
803 sourceNewNbrProc.setSize(nBnd);
805 const polyBoundaryMesh&
patches = mesh_.boundaryMesh();
813 const polyPatch& pp =
patches[patchi];
817 label offset = pp.
start() - mesh_.nInternalFaces();
822 label bndI = offset + i;
823 nbrFaces[bndI] = pp.start()+i;
827 SubList<label>(nbrNewNbrProc, pp.size(), offset) =
840 const polyPatch& pp =
patches[patchi];
841 label offset = pp.
start() - mesh_.nInternalFaces();
843 if (isA<processorPolyPatch>(pp))
845 const processorPolyPatch& procPatch =
846 refCast<const processorPolyPatch>(pp);
850 if (procPatch.owner())
855 label bndI = offset + i;
856 sourceFace[bndI] = pp.start()+i;
858 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
866 label bndI = offset + i;
867 sourceFace[bndI] = nbrFaces[bndI];
868 sourceProc[bndI] = procPatch.neighbProcNo();
869 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
875 if (isA<processorCyclicPolyPatch>(pp))
877 patchi = refCast<const processorCyclicPolyPatch>
885 label bndI = offset + i;
886 sourcePatch[bndI] = patchi;
889 else if (isA<cyclicPolyPatch>(pp))
891 const cyclicPolyPatch& cpp = refCast<const cyclicPolyPatch>(pp);
897 label bndI = offset + i;
898 sourceFace[bndI] = pp.start()+i;
900 sourcePatch[bndI] = patchi;
901 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
908 label bndI = offset + i;
909 sourceFace[bndI] = nbrFaces[bndI];
911 sourcePatch[bndI] = patchi;
912 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
921 label bndI = offset + i;
922 sourceFace[bndI] = -1;
923 sourceProc[bndI] = -1;
924 sourcePatch[bndI] = patchi;
925 sourceNewNbrProc[bndI] = -1;
932 sourcePointMaster.setSize(mesh_.nPoints());
933 sourcePointMaster = -1;
936 const globalIndex globalPoints(mesh_.nPoints());
938 const globalMeshData& gmd = mesh_.globalData();
940 const labelList& meshPoints = cpp.meshPoints();
941 const mapDistribute& slavesMap = gmd.globalCoPointSlavesMap();
944 labelList elems(slavesMap.constructSize(), -1);
945 forAll(meshPoints, pointi)
953 label globalPointi = globalPoints.toGlobal(meshPoints[pointi]);
954 elems[pointi] = globalPointi;
957 label sloti = slots[i];
958 if (sloti >= meshPoints.size())
962 elems[slots[i]] = globalPointi;
969 slavesMap.reverseDistribute(elems.size(), elems,
false);
972 forAll(meshPoints, pointi)
974 sourcePointMaster[meshPoints[pointi]] = elems[pointi];
981 void Foam::fvMeshDistribute::subsetCouplingData
991 const label oldInternalFaces,
1011 forAll(subFace, newBFacei)
1015 label oldFacei =
faceMap[newFacei];
1018 if (oldFacei < oldInternalFaces)
1020 subFace[newBFacei] = oldFacei;
1022 subPatch[newBFacei] = -1;
1024 label oldOwn = oldFaceOwner[oldFacei];
1025 label oldNei = oldFaceNeighbour[oldFacei];
1030 subNewNbrProc[newBFacei] = oldDistribution[oldNei];
1035 subNewNbrProc[newBFacei] = oldDistribution[oldOwn];
1041 label oldBFacei = oldFacei - oldInternalFaces;
1043 subFace[newBFacei] = sourceFace[oldBFacei];
1044 subProc[newBFacei] = sourceProc[oldBFacei];
1045 subPatch[newBFacei] = sourcePatch[oldBFacei];
1046 subNewNbrProc[newBFacei] = sourceNewNbrProc[oldBFacei];
1051 subPointMaster = UIndirectList<label>(sourcePointMaster, pointMap);
1057 void Foam::fvMeshDistribute::findCouples
1059 const primitiveMesh&
mesh,
1065 const primitiveMesh& domainMesh,
1078 forAll(domainProc, bFacei)
1080 if (domainProc[bFacei] != -1 && domainPatch[bFacei] == -1)
1084 labelPair(domainFace[bFacei], domainProc[bFacei]),
1093 masterCoupledFaces.setSize(domainFace.size());
1094 slaveCoupledFaces.setSize(domainFace.size());
1097 forAll(sourceFace, bFacei)
1099 if (sourceProc[bFacei] != -1 && sourcePatch[bFacei] == -1)
1101 labelPair myData(sourceFace[bFacei], sourceProc[bFacei]);
1103 const auto iter = map.cfind(myData);
1107 label nbrBFacei = *iter;
1110 slaveCoupledFaces[coupledI] =
1111 domainMesh.nInternalFaces()
1119 masterCoupledFaces.setSize(coupledI);
1120 slaveCoupledFaces.setSize(coupledI);
1124 Pout<<
"findCouples : found " << coupledI
1125 <<
" faces that will be stitched" <<
nl <<
endl;
1133 const primitiveMesh&
mesh,
1134 const mapAddedPolyMesh& map,
1136 const label nInternalFaces1,
1142 forAll(boundaryData0, oldBFacei)
1144 label newFacei = map.oldFaceMap()[oldBFacei + map.nOldInternalFaces()];
1150 boundaryData0[oldBFacei];
1154 forAll(boundaryData1, addedBFacei)
1156 label newFacei = map.addedFaceMap()[addedBFacei + nInternalFaces1];
1161 boundaryData1[addedBFacei];
1165 return newBoundaryData;
1171 const primitiveMesh&
mesh,
1172 const mapAddedPolyMesh& map,
1179 forAll(boundaryData0, oldPointi)
1181 label
newPointi = map.oldPointMap()[oldPointi];
1186 newBoundaryData[
newPointi] = boundaryData0[oldPointi];
1190 forAll(boundaryData1, addedPointi)
1192 label
newPointi = map.addedPointMap()[addedPointi];
1196 newBoundaryData[
newPointi] = boundaryData1[addedPointi];
1200 return newBoundaryData;
1208 const label oldInternalPatchi
1212 polyTopoChange meshMod(mesh_);
1216 removeCells cellRemover(mesh_,
false);
1219 labelList exposedFaces(cellRemover.getExposedFaces(cellsToRemove));
1222 cellRemover.setRefinement
1226 labelList(exposedFaces.size(), oldInternalPatchi),
1237 PtrList<Field<scalar>> sFlds;
1238 saveInternalFields(sFlds);
1239 PtrList<Field<vector>> vFlds;
1240 saveInternalFields(vFlds);
1241 PtrList<Field<sphericalTensor>> sptFlds;
1242 saveInternalFields(sptFlds);
1243 PtrList<Field<symmTensor>> sytFlds;
1244 saveInternalFields(sytFlds);
1245 PtrList<Field<tensor>> tFlds;
1246 saveInternalFields(tFlds);
1249 autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh_,
false,
false);
1252 mesh_.updateMesh(map());
1259 mapExposedFaces(map(), sFlds);
1260 mapExposedFaces(map(), vFlds);
1261 mapExposedFaces(map(), sptFlds);
1262 mapExposedFaces(map(), sytFlds);
1263 mapExposedFaces(map(), tFlds);
1271 if (map().hasMotionPoints())
1273 mesh_.movePoints(map().preMotionPoints());
1283 void Foam::fvMeshDistribute::addProcPatches
1287 List<Map<label>>& procPatchID
1299 sortedOrder(nbrProc, indices, lessProcPatches(nbrProc, referPatchID));
1305 label bFacei = indices[i];
1306 label proci = nbrProc[bFacei];
1310 if (!procPatchID[proci].
found(referPatchID[bFacei]))
1315 if (referPatchID[bFacei] == -1)
1319 processorPolyPatch pp
1323 mesh_.boundaryMesh().size(),
1324 mesh_.boundaryMesh(),
1329 procPatchID[proci].insert
1331 referPatchID[bFacei],
1337 processorFvPatchField<scalar>::typeName,
1344 const coupledPolyPatch& pcPatch
1345 = refCast<const coupledPolyPatch>
1347 mesh_.boundaryMesh()[referPatchID[bFacei]]
1349 processorCyclicPolyPatch pp
1353 mesh_.boundaryMesh().size(),
1354 mesh_.boundaryMesh(),
1361 procPatchID[proci].insert
1363 referPatchID[bFacei],
1369 processorCyclicFvPatchField<scalar>::typeName,
1385 const List<Map<label>>& procPatchID
1394 label origPatchi = referPatchID[bFacei];
1395 patchIDs[bFacei] = origPatchi;
1397 else if (nbrProc[bFacei] != -1)
1399 label origPatchi = referPatchID[bFacei];
1400 patchIDs[bFacei] = procPatchID[nbrProc[bFacei]][origPatchi];
1404 patchIDs[bFacei] = -1;
1412 void Foam::fvMeshDistribute::sendMesh
1431 Pout<<
"Sending to domain " << domain <<
nl
1441 CompactListList<label> zonePoints;
1447 forAll(pointZoneNames, nameI)
1449 label myZoneID = pointZones.findZoneID(pointZoneNames[nameI]);
1453 rowSizes[nameI] = pointZones[myZoneID].size();
1456 zonePoints.setSize(rowSizes);
1458 forAll(pointZoneNames, nameI)
1460 label myZoneID = pointZones.findZoneID(pointZoneNames[nameI]);
1464 zonePoints[nameI].deepCopy(pointZones[myZoneID]);
1470 CompactListList<label> zoneFaces;
1471 CompactListList<bool> zoneFaceFlip;
1477 forAll(faceZoneNames, nameI)
1479 label myZoneID = faceZones.findZoneID(faceZoneNames[nameI]);
1483 rowSizes[nameI] = faceZones[myZoneID].size();
1487 zoneFaces.setSize(rowSizes);
1488 zoneFaceFlip.setSize(rowSizes);
1490 forAll(faceZoneNames, nameI)
1492 label myZoneID = faceZones.findZoneID(faceZoneNames[nameI]);
1496 zoneFaces[nameI].deepCopy(faceZones[myZoneID]);
1497 zoneFaceFlip[nameI].deepCopy(faceZones[myZoneID].flipMap());
1503 CompactListList<label> zoneCells;
1509 forAll(cellZoneNames, nameI)
1511 label myZoneID = cellZones.findZoneID(cellZoneNames[nameI]);
1515 rowSizes[nameI] = cellZones[myZoneID].size();
1519 zoneCells.setSize(rowSizes);
1521 forAll(cellZoneNames, nameI)
1523 label myZoneID = cellZones.findZoneID(cellZoneNames[nameI]);
1527 zoneCells[nameI].deepCopy(cellZones[myZoneID]);
1549 << CompactListList<label, face>(
mesh.
faces())
1563 << sourcePointMaster;
1568 Pout<<
"Started sending mesh to domain " << domain
1591 faceList domainFaces = CompactListList<label, face>(fromNbr)();
1594 PtrList<entry> patchEntries(fromNbr);
1596 CompactListList<label> zonePoints(fromNbr);
1597 CompactListList<label> zoneFaces(fromNbr);
1598 CompactListList<bool> zoneFaceFlip(fromNbr);
1599 CompactListList<label> zoneCells(fromNbr);
1604 >> domainSourcePatch
1605 >> domainSourceNewNbrProc
1606 >> domainSourcePointMaster;
1618 std::move(domainPoints),
1619 std::move(domainFaces),
1620 std::move(domainAllOwner),
1621 std::move(domainAllNeighbour),
1624 fvMesh& domainMesh = *domainMeshPtr;
1626 List<polyPatch*>
patches(patchEntries.size());
1628 forAll(patchEntries, patchi)
1632 patchEntries[patchi].keyword(),
1633 patchEntries[patchi].
dict(),
1635 domainMesh.boundaryMesh()
1639 domainMesh.addFvPatches(
patches,
false);
1642 List<pointZone*> pZonePtrs(pointZoneNames.size());
1645 pZonePtrs[i] =
new pointZone
1650 domainMesh.pointZones()
1654 List<faceZone*> fZonePtrs(faceZoneNames.size());
1657 fZonePtrs[i] =
new faceZone
1663 domainMesh.faceZones()
1667 List<cellZone*> cZonePtrs(cellZoneNames.size());
1670 cZonePtrs[i] =
new cellZone
1675 domainMesh.cellZones()
1678 domainMesh.addZones(pZonePtrs, fZonePtrs, cZonePtrs);
1680 return domainMeshPtr;
1686 Foam::fvMeshDistribute::fvMeshDistribute(
fvMesh&
mesh,
const scalar mergeTol)
1710 <<
"At index " << celli <<
" distribution:" << newProc
1728 <<
"Size of distribution:"
1729 <<
distribution.size() <<
" mesh nCells:" << mesh_.nCells()
1740 <<
"This application requires all non-processor patches"
1741 <<
" to be present in the same order on all patches" <<
nl
1742 <<
"followed by the processor patches (which of course are unique)."
1744 <<
"Local patches:" << mesh_.boundaryMesh().names()
1749 const label nOldPoints(mesh_.nPoints());
1750 const label nOldFaces(mesh_.nFaces());
1751 const label nOldCells(mesh_.nCells());
1757 oldPatchNMeshPoints[patchi] =
patches[patchi].nPoints();
1773 std::move(oldPatchStarts),
1774 std::move(oldPatchNMeshPoints),
1790 const wordList pointZoneNames(mergeWordList(mesh_.pointZones().names()));
1791 const wordList faceZoneNames(mergeWordList(mesh_.faceZones().names()));
1792 const wordList cellZoneNames(mergeWordList(mesh_.cellZones().names()));
1856 mesh_.resetMotion();
1862 getFieldNames<volScalarField>(mesh_, allFieldNames);
1863 getFieldNames<volVectorField>(mesh_, allFieldNames);
1864 getFieldNames<volSphericalTensorField>(mesh_, allFieldNames);
1865 getFieldNames<volSymmTensorField>(mesh_, allFieldNames);
1866 getFieldNames<volTensorField>(mesh_, allFieldNames);
1868 getFieldNames<surfaceScalarField>(mesh_, allFieldNames);
1869 getFieldNames<surfaceVectorField>(mesh_, allFieldNames);
1870 getFieldNames<surfaceSphericalTensorField>(mesh_, allFieldNames);
1871 getFieldNames<surfaceSymmTensorField>(mesh_, allFieldNames);
1872 getFieldNames<surfaceTensorField>(mesh_, allFieldNames);
1874 getFieldNames<volScalarField::Internal>(mesh_, allFieldNames);
1875 getFieldNames<volVectorField::Internal>(mesh_, allFieldNames);
1876 getFieldNames<volSphericalTensorField::Internal>(mesh_, allFieldNames);
1877 getFieldNames<volSymmTensorField::Internal>(mesh_, allFieldNames);
1878 getFieldNames<volTensorField::Internal>(mesh_, allFieldNames);
1882 const label oldInternalPatchi = findNonEmptyPatch();
1892 repatchFaceMap = repatchMap().faceMap();
1899 repatchMap().reverseFaceMap(),
1900 mesh_.nBoundaryFaces(),
1901 mesh_.nInternalFaces()
1903 - mesh_.nInternalFaces()
1917 Pout<<
nl <<
"MESH WITH PROC PATCHES DELETED:" <<
endl;
1918 printMeshInfo(mesh_);
1919 printFieldInfo<volScalarField>(mesh_);
1920 printFieldInfo<volVectorField>(mesh_);
1921 printFieldInfo<volSphericalTensorField>(mesh_);
1922 printFieldInfo<volSymmTensorField>(mesh_);
1923 printFieldInfo<volTensorField>(mesh_);
1924 printFieldInfo<surfaceScalarField>(mesh_);
1925 printFieldInfo<surfaceVectorField>(mesh_);
1926 printFieldInfo<surfaceSphericalTensorField>(mesh_);
1927 printFieldInfo<surfaceSymmTensorField>(mesh_);
1928 printFieldInfo<surfaceTensorField>(mesh_);
1963 forAll(nSendCells, recvProc)
1972 <<
"SUBSETTING FOR DOMAIN " << recvProc
1973 <<
" cells to send:"
1974 << nSendCells[recvProc]
1992 subCellMap[recvProc] = subsetter.
cellMap();
1994 inplaceRenumberWithFlip
1999 subFaceMap[recvProc]
2001 subPointMap[recvProc] = subsetter.
pointMap();
2002 subPatchMap[recvProc] = subsetter.
patchMap();
2021 mesh_.faceNeighbour(),
2022 mesh_.nInternalFaces(),
2033 procSourceNewNbrProc,
2034 procSourcePointMaster
2051 procSourceNewNbrProc,
2052 procSourcePointMaster,
2058 sendFields<volScalarField>
2065 sendFields<volVectorField>
2072 sendFields<volSphericalTensorField>
2079 sendFields<volSymmTensorField>
2086 sendFields<volTensorField>
2095 sendFields<surfaceScalarField>
2102 sendFields<surfaceVectorField>
2109 sendFields<surfaceSphericalTensorField>
2116 sendFields<surfaceSymmTensorField>
2123 sendFields<surfaceTensorField>
2132 sendFields<volScalarField::Internal>
2139 sendFields<volVectorField::Internal>
2146 sendFields<volSphericalTensorField::Internal>
2153 sendFields<volSymmTensorField::Internal>
2160 sendFields<volTensorField::Internal>
2183 const labelList oldFaceOwner(mesh_.faceOwner());
2184 const labelList oldFaceNeighbour(mesh_.faceNeighbour());
2185 const label oldInternalFaces = mesh_.nInternalFaces();
2211 for (
const label facei : flip)
2235 subMap().pointMap(),
2253 domainSourceNewNbrProc,
2254 domainSourcePointMaster
2257 sourceFace.
transfer(domainSourceFace);
2258 sourceProc.
transfer(domainSourceProc);
2259 sourcePatch.
transfer(domainSourcePatch);
2260 sourceNewNbrProc.
transfer(domainSourceNewNbrProc);
2261 sourcePointMaster.
transfer(domainSourcePointMaster);
2269 printMeshInfo(mesh_);
2270 printFieldInfo<volScalarField>(mesh_);
2271 printFieldInfo<volVectorField>(mesh_);
2272 printFieldInfo<volSphericalTensorField>(mesh_);
2273 printFieldInfo<volSymmTensorField>(mesh_);
2274 printFieldInfo<volTensorField>(mesh_);
2275 printFieldInfo<surfaceScalarField>(mesh_);
2276 printFieldInfo<surfaceVectorField>(mesh_);
2277 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2278 printFieldInfo<surfaceSymmTensorField>(mesh_);
2279 printFieldInfo<surfaceTensorField>(mesh_);
2291 forAll(nRevcCells, sendProc)
2299 <<
"RECEIVING FROM DOMAIN " << sendProc
2300 <<
" cells to receive:"
2301 << nRevcCells[sendProc]
2340 domainMeshPtr = receiveMesh
2347 const_cast<Time&
>(mesh_.time()),
2351 domainSourceNewNbrProc,
2352 domainSourcePointMaster,
2355 fvMesh& domainMesh = domainMeshPtr();
2365 receiveFields<volScalarField>
2373 receiveFields<volVectorField>
2381 receiveFields<volSphericalTensorField>
2389 receiveFields<volSymmTensorField>
2397 receiveFields<volTensorField>
2407 receiveFields<surfaceScalarField>
2415 receiveFields<surfaceVectorField>
2423 receiveFields<surfaceSphericalTensorField>
2431 receiveFields<surfaceSymmTensorField>
2439 receiveFields<surfaceTensorField>
2449 receiveFields<volScalarField::Internal>
2457 receiveFields<volVectorField::Internal>
2465 receiveFields<volSphericalTensorField::Internal>
2473 receiveFields<volSymmTensorField::Internal>
2481 receiveFields<volTensorField::Internal>
2490 const fvMesh& domainMesh = domainMeshPtr();
2496 constructPatchMap[sendProc] =
2503 Pout<<
nl <<
"RECEIVED MESH FROM:" << sendProc <<
endl;
2504 printMeshInfo(domainMesh);
2505 printFieldInfo<volScalarField>(domainMesh);
2506 printFieldInfo<volVectorField>(domainMesh);
2507 printFieldInfo<volSphericalTensorField>(domainMesh);
2508 printFieldInfo<volSymmTensorField>(domainMesh);
2509 printFieldInfo<volTensorField>(domainMesh);
2510 printFieldInfo<surfaceScalarField>(domainMesh);
2511 printFieldInfo<surfaceVectorField>(domainMesh);
2512 printFieldInfo<surfaceSphericalTensorField>(domainMesh);
2513 printFieldInfo<surfaceSymmTensorField>(domainMesh);
2514 printFieldInfo<surfaceTensorField>(domainMesh);
2573 sourceFace = mapBoundaryData
2581 sourceProc = mapBoundaryData
2589 sourcePatch = mapBoundaryData
2597 sourceNewNbrProc = mapBoundaryData
2603 domainSourceNewNbrProc
2606 sourcePointMaster = mapPointData
2611 domainSourcePointMaster
2617 const labelList& oldCellMap = map().oldCellMap();
2618 const labelList& oldFaceMap = map().oldFaceMap();
2619 const labelList& oldPointMap = map().oldPointMap();
2620 const labelList& oldPatchMap = map().oldPatchMap();
2623 forAll(constructPatchMap, proci)
2625 if (proci != sendProc && constructPatchMap[proci].size())
2629 inplaceRenumberWithFlip
2634 constructFaceMap[proci]
2647 flippedAddedFaces.
resize(nBnd/4);
2652 domainFaceI < domainMesh.
nFaces();
2656 label newFaceI = map().addedFaceMap()[domainFaceI];
2657 label newCellI = mesh_.faceOwner()[newFaceI];
2659 label domainCellI = domainMesh.
faceOwner()[domainFaceI];
2661 if (newCellI != map().addedCellMap()[domainCellI])
2663 flippedAddedFaces.
insert(domainFaceI);
2672 for (
const label domainFaceI : flippedAddedFaces)
2674 label& val = constructFaceMap[sendProc][domainFaceI];
2677 inplaceRenumberWithFlip
2679 map().addedFaceMap(),
2682 constructFaceMap[sendProc]
2689 Pout<<
nl <<
"MERGED MESH FROM:" << sendProc <<
endl;
2690 printMeshInfo(mesh_);
2691 printFieldInfo<volScalarField>(mesh_);
2692 printFieldInfo<volVectorField>(mesh_);
2693 printFieldInfo<volSphericalTensorField>(mesh_);
2694 printFieldInfo<volSymmTensorField>(mesh_);
2695 printFieldInfo<volTensorField>(mesh_);
2696 printFieldInfo<surfaceScalarField>(mesh_);
2697 printFieldInfo<surfaceVectorField>(mesh_);
2698 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2699 printFieldInfo<surfaceSymmTensorField>(mesh_);
2700 printFieldInfo<surfaceTensorField>(mesh_);
2713 printMeshInfo(mesh_);
2714 printFieldInfo<volScalarField>(mesh_);
2715 printFieldInfo<volVectorField>(mesh_);
2716 printFieldInfo<volSphericalTensorField>(mesh_);
2717 printFieldInfo<volSymmTensorField>(mesh_);
2718 printFieldInfo<volTensorField>(mesh_);
2719 printFieldInfo<surfaceScalarField>(mesh_);
2720 printFieldInfo<surfaceVectorField>(mesh_);
2721 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2722 printFieldInfo<surfaceSymmTensorField>(mesh_);
2723 printFieldInfo<surfaceTensorField>(mesh_);
2730 mergeSharedPoints(sourcePointMaster, constructPointMap);
2742 addProcPatches(sourceNewNbrProc, sourcePatch, procPatchID);
2761 repatch(newPatchID, constructFaceMap);
2765 initPatchFields<volScalarField, processorFvPatchField<scalar>>
2769 initPatchFields<volVectorField, processorFvPatchField<vector>>
2781 initPatchFields<volSymmTensorField, processorFvPatchField<symmTensor>>
2785 initPatchFields<volTensorField, processorFvPatchField<tensor>>
2791 mesh_.setInstance(mesh_.time().timeName());
2798 printMeshInfo(mesh_);
2799 printFieldInfo<volScalarField>(mesh_);
2800 printFieldInfo<volVectorField>(mesh_);
2801 printFieldInfo<volSphericalTensorField>(mesh_);
2802 printFieldInfo<volSymmTensorField>(mesh_);
2803 printFieldInfo<volTensorField>(mesh_);
2804 printFieldInfo<surfaceScalarField>(mesh_);
2805 printFieldInfo<surfaceVectorField>(mesh_);
2806 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2807 printFieldInfo<surfaceSymmTensorField>(mesh_);
2808 printFieldInfo<surfaceTensorField>(mesh_);
2820 std::move(oldPatchStarts),
2821 std::move(oldPatchNMeshPoints),
2823 std::move(subPointMap),
2824 std::move(subFaceMap),
2825 std::move(subCellMap),
2826 std::move(subPatchMap),
2828 std::move(constructPointMap),
2829 std::move(constructFaceMap),
2830 std::move(constructCellMap),
2831 std::move(constructPatchMap),