67 referPatchID_(referPatchID)
72 if (nbrProc_[a] < nbrProc_[
b])
76 else if (nbrProc_[a] > nbrProc_[
b])
83 return referPatchID_[a] < referPatchID_[
b];
92 void Foam::fvMeshDistribute::inplaceRenumberWithFlip
95 const bool oldToNewHasFlip,
96 const bool lstHasFlip,
100 if (!lstHasFlip && !oldToNewHasFlip)
127 <<
"Problem : zero value " <<
val
128 <<
" at index " << elemI <<
" out of " << lst.size()
151 <<
"Problem : zero value " << newVal
152 <<
" at index " << elemI <<
" out of "
160 lst[elemI] =
sign*(newVal+1);
168 const bool selectEqual,
177 if (selectEqual == (
values[i] == value))
188 if (selectEqual == (
values[i] == value))
207 mergedNames.insert(allNames[proci]);
209 return mergedNames.sortedToc();
215 Pout<<
"Primitives:" <<
nl
229 Pout<<
" " << patchi <<
" name:" << pp.
name()
230 <<
" size:" << pp.size()
231 <<
" start:" << pp.
start()
232 <<
" type:" << pp.type()
242 Pout<<
" " << zoneI <<
" name:" << pz.
name()
243 <<
" size:" << pz.size()
253 Pout<<
" " << zoneI <<
" name:" << fz.
name()
254 <<
" size:" << fz.size()
264 Pout<<
" " << zoneI <<
" name:" << cz.
name()
265 <<
" size:" << cz.size()
282 <<
"Current coupling info:"
285 forAll(sourceFace, bFacei)
289 Pout<<
" meshFace:" << meshFacei
291 <<
" connects to proc:" << sourceProc[bFacei]
292 <<
"/face:" << sourceFace[bFacei]
293 <<
" which will move to proc:" << sourceNewNbrProc[bFacei]
299 Foam::label Foam::fvMeshDistribute::findNonEmptyPatch()
const
305 label nonEmptyPatchi = -1;
311 if (!isA<emptyPolyPatch>(pp) && !pp.
coupled())
313 nonEmptyPatchi = patchi;
318 if (nonEmptyPatchi == -1)
321 <<
"Cannot find a patch which is neither of type empty nor"
323 <<
"There has to be at least one such patch for"
329 Pout<<
"findNonEmptyPatch : using patch " << nonEmptyPatchi
331 <<
" type:" <<
patches[nonEmptyPatchi].type()
332 <<
" to put exposed faces into." <<
endl;
338 label procPatchi = -1;
342 if (isA<processorPolyPatch>(
patches[patchi]))
346 else if (procPatchi != -1)
349 <<
"Processor patches should be at end of patch list."
351 <<
"Have processor patch " << procPatchi
352 <<
" followed by non-processor patch " << patchi
358 return nonEmptyPatchi;
391 fld[facei] = (
n[facei] & testNormal);
394 surfaceScalarField::Boundary& fluxBf =
fld.boundaryFieldRef();
395 const surfaceVectorField::Boundary& nBf =
n.boundaryField();
404 newPfld[i] = (nBf[patchi][i] & testNormal);
423 scalar
cos = (
n[facei] & testNormal);
429 <<
"On internal face " << facei <<
" at "
431 <<
" the field value is " <<
fld[facei]
432 <<
" whereas cos angle of " << testNormal
433 <<
" with mesh normal " <<
n[facei]
446 scalar
cos = (np[i] & testNormal);
453 <<
"On face " << facei
456 <<
" the field value is " << fvp[i]
457 <<
" whereas cos angle of " << testNormal
458 <<
" with mesh normal " << np[i]
470 const label destinationPatch
478 labelList newPatchID(mesh_.nBoundaryFaces(), -1);
482 forAll(mesh_.boundaryMesh(), patchi)
486 if (isA<processorPolyPatch>(pp))
490 Pout<<
"Moving all faces of patch " << pp.
name()
491 <<
" into patch " << destinationPatch
495 label offset = pp.
start() - mesh_.nInternalFaces();
499 newPatchID[offset+i] = destinationPatch;
510 autoPtr<mapPolyMesh> map = repatch(newPatchID, dummyFaceMaps);
518 forAll(mesh_.boundaryMesh(), patchi)
520 if (!isA<processorPolyPatch>(mesh_.boundaryMesh()[patchi]))
522 oldToNew[patchi] = newi++;
525 label nNonProcPatches = newi;
528 forAll(mesh_.boundaryMesh(), patchi)
530 if (isA<processorPolyPatch>(mesh_.boundaryMesh()[patchi]))
532 oldToNew[patchi] = newi++;
548 polyTopoChange meshMod(mesh_);
550 forAll(newPatchID, bFacei)
552 if (newPatchID[bFacei] != -1)
554 label facei = mesh_.nInternalFaces() + bFacei;
557 bool zoneFlip =
false;
561 const faceZone& fZone = mesh_.faceZones()[
zoneID];
562 zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
569 mesh_.faces()[facei],
571 mesh_.faceOwner()[facei],
588 PtrList<FieldField<fvsPatchField, scalar>> sFlds;
589 saveBoundaryFields<scalar, surfaceMesh>(sFlds);
590 PtrList<FieldField<fvsPatchField, vector>> vFlds;
591 saveBoundaryFields<vector, surfaceMesh>(vFlds);
592 PtrList<FieldField<fvsPatchField, sphericalTensor>> sptFlds;
593 saveBoundaryFields<sphericalTensor, surfaceMesh>(sptFlds);
594 PtrList<FieldField<fvsPatchField, symmTensor>> sytFlds;
595 saveBoundaryFields<symmTensor, surfaceMesh>(sytFlds);
596 PtrList<FieldField<fvsPatchField, tensor>> tFlds;
597 saveBoundaryFields<tensor, surfaceMesh>(tFlds);
606 autoPtr<mapPolyMesh> mapPtr = meshMod.changeMesh(mesh_,
false,
true);
607 mapPolyMesh& map = *mapPtr;
610 mesh_.updateMesh(map);
614 mapBoundaryFields<scalar, surfaceMesh>(map, sFlds);
615 mapBoundaryFields<vector, surfaceMesh>(map, vFlds);
616 mapBoundaryFields<sphericalTensor, surfaceMesh>(map, sptFlds);
617 mapBoundaryFields<symmTensor, surfaceMesh>(map, sytFlds);
618 mapBoundaryFields<tensor, surfaceMesh>(map, tFlds);
622 if (map.hasMotionPoints())
624 mesh_.movePoints(map.preMotionPoints());
631 label index = map.reverseFaceMap().find(-1);
636 <<
"reverseFaceMap contains -1 at index:"
638 <<
"This means that the repatch operation was not just"
643 forAll(constructFaceMap, proci)
645 inplaceRenumberWithFlip
647 map.reverseFaceMap(),
650 constructFaceMap[proci]
673 forAll(pointToGlobalMaster, pointi)
675 if (pointToGlobalMaster[pointi] != -1)
681 Map<label> globalMasterToLocalMaster(2*nShared);
682 Map<label> pointToMaster(2*nShared);
684 forAll(pointToGlobalMaster, pointi)
686 label globali = pointToGlobalMaster[pointi];
689 const auto iter = globalMasterToLocalMaster.cfind(globali);
693 pointToMaster.insert(pointi, *iter);
698 globalMasterToLocalMaster.insert(globali, pointi);
699 pointToMaster.insert(pointi, pointi);
704 if (
returnReduce(pointToMaster.size(), sumOp<label>()) == 0)
710 polyTopoChange meshMod(mesh_);
715 autoPtr<mapPolyMesh> mapPtr = meshMod.changeMesh(mesh_,
false,
true);
716 mapPolyMesh& map = *mapPtr;
719 mesh_.updateMesh(map);
722 forAll(constructPointMap, proci)
724 labelList& constructMap = constructPointMap[proci];
728 label oldPointi = constructMap[i];
743 <<
"Problem. oldPointi:" << oldPointi
753 void Foam::fvMeshDistribute::getCouplingData
766 const label nBnd = mesh_.nBoundaryFaces();
767 sourceFace.setSize(nBnd);
768 sourceProc.setSize(nBnd);
769 sourcePatch.setSize(nBnd);
770 sourceNewNbrProc.setSize(nBnd);
772 const polyBoundaryMesh&
patches = mesh_.boundaryMesh();
780 const polyPatch& pp =
patches[patchi];
784 label offset = pp.start() - mesh_.nInternalFaces();
789 label bndI = offset + i;
790 nbrFaces[bndI] = pp.start()+i;
794 SubList<label>(nbrNewNbrProc, pp.size(), offset) =
807 const polyPatch& pp =
patches[patchi];
808 label offset = pp.start() - mesh_.nInternalFaces();
810 if (isA<processorPolyPatch>(pp))
812 const processorPolyPatch& procPatch =
813 refCast<const processorPolyPatch>(pp);
817 if (procPatch.owner())
822 label bndI = offset + i;
823 sourceFace[bndI] = pp.start()+i;
825 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
833 label bndI = offset + i;
834 sourceFace[bndI] = nbrFaces[bndI];
835 sourceProc[bndI] = procPatch.neighbProcNo();
836 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
842 if (isA<processorCyclicPolyPatch>(pp))
844 patchi = refCast<const processorCyclicPolyPatch>
852 label bndI = offset + i;
853 sourcePatch[bndI] = patchi;
856 else if (isA<cyclicPolyPatch>(pp))
858 const cyclicPolyPatch& cpp = refCast<const cyclicPolyPatch>(pp);
864 label bndI = offset + i;
865 sourceFace[bndI] = pp.start()+i;
867 sourcePatch[bndI] = patchi;
868 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
875 label bndI = offset + i;
876 sourceFace[bndI] = nbrFaces[bndI];
878 sourcePatch[bndI] = patchi;
879 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
888 label bndI = offset + i;
889 sourceFace[bndI] = -1;
890 sourceProc[bndI] = -1;
891 sourcePatch[bndI] = patchi;
892 sourceNewNbrProc[bndI] = -1;
899 sourcePointMaster.setSize(mesh_.nPoints());
900 sourcePointMaster = -1;
903 const globalIndex globalPoints(mesh_.nPoints());
905 const globalMeshData& gmd = mesh_.globalData();
907 const labelList& meshPoints = cpp.meshPoints();
908 const mapDistribute& slavesMap = gmd.globalCoPointSlavesMap();
911 labelList elems(slavesMap.constructSize(), -1);
912 forAll(meshPoints, pointi)
920 label globalPointi = globalPoints.toGlobal(meshPoints[pointi]);
921 elems[pointi] = globalPointi;
924 label sloti = slots[i];
925 if (sloti >= meshPoints.size())
929 elems[slots[i]] = globalPointi;
936 slavesMap.reverseDistribute(elems.size(), elems,
false);
939 forAll(meshPoints, pointi)
941 sourcePointMaster[meshPoints[pointi]] = elems[pointi];
948 void Foam::fvMeshDistribute::subsetCouplingData
958 const label oldInternalFaces,
978 forAll(subFace, newBFacei)
985 if (oldFacei < oldInternalFaces)
987 subFace[newBFacei] = oldFacei;
989 subPatch[newBFacei] = -1;
991 label oldOwn = oldFaceOwner[oldFacei];
992 label oldNei = oldFaceNeighbour[oldFacei];
997 subNewNbrProc[newBFacei] = oldDistribution[oldNei];
1002 subNewNbrProc[newBFacei] = oldDistribution[oldOwn];
1008 label oldBFacei = oldFacei - oldInternalFaces;
1010 subFace[newBFacei] = sourceFace[oldBFacei];
1011 subProc[newBFacei] = sourceProc[oldBFacei];
1012 subPatch[newBFacei] = sourcePatch[oldBFacei];
1013 subNewNbrProc[newBFacei] = sourceNewNbrProc[oldBFacei];
1018 subPointMaster = UIndirectList<label>(sourcePointMaster, pointMap);
1024 void Foam::fvMeshDistribute::findCouples
1026 const primitiveMesh&
mesh,
1032 const primitiveMesh& domainMesh,
1045 forAll(domainProc, bFacei)
1047 if (domainProc[bFacei] != -1 && domainPatch[bFacei] == -1)
1051 labelPair(domainFace[bFacei], domainProc[bFacei]),
1060 masterCoupledFaces.setSize(domainFace.size());
1061 slaveCoupledFaces.setSize(domainFace.size());
1064 forAll(sourceFace, bFacei)
1066 if (sourceProc[bFacei] != -1 && sourcePatch[bFacei] == -1)
1068 labelPair myData(sourceFace[bFacei], sourceProc[bFacei]);
1070 const auto iter = map.cfind(myData);
1074 label nbrBFacei = *iter;
1077 slaveCoupledFaces[coupledI] =
1078 domainMesh.nInternalFaces()
1086 masterCoupledFaces.setSize(coupledI);
1087 slaveCoupledFaces.setSize(coupledI);
1091 Pout<<
"findCouples : found " << coupledI
1092 <<
" faces that will be stitched" <<
nl <<
endl;
1100 const primitiveMesh&
mesh,
1101 const mapAddedPolyMesh& map,
1103 const label nInternalFaces1,
1109 forAll(boundaryData0, oldBFacei)
1111 label newFacei = map.oldFaceMap()[oldBFacei + map.nOldInternalFaces()];
1117 boundaryData0[oldBFacei];
1121 forAll(boundaryData1, addedBFacei)
1123 label newFacei = map.addedFaceMap()[addedBFacei + nInternalFaces1];
1128 boundaryData1[addedBFacei];
1132 return newBoundaryData;
1138 const primitiveMesh&
mesh,
1139 const mapAddedPolyMesh& map,
1146 forAll(boundaryData0, oldPointi)
1153 newBoundaryData[
newPointi] = boundaryData0[oldPointi];
1157 forAll(boundaryData1, addedPointi)
1163 newBoundaryData[
newPointi] = boundaryData1[addedPointi];
1167 return newBoundaryData;
1175 const label oldInternalPatchi
1179 polyTopoChange meshMod(mesh_);
1183 removeCells cellRemover(mesh_,
false);
1186 labelList exposedFaces(cellRemover.getExposedFaces(cellsToRemove));
1189 cellRemover.setRefinement
1193 labelList(exposedFaces.size(), oldInternalPatchi),
1204 PtrList<Field<scalar>> sFlds;
1205 saveInternalFields(sFlds);
1206 PtrList<Field<vector>> vFlds;
1207 saveInternalFields(vFlds);
1208 PtrList<Field<sphericalTensor>> sptFlds;
1209 saveInternalFields(sptFlds);
1210 PtrList<Field<symmTensor>> sytFlds;
1211 saveInternalFields(sytFlds);
1212 PtrList<Field<tensor>> tFlds;
1213 saveInternalFields(tFlds);
1216 autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh_,
false,
false);
1219 mesh_.updateMesh(map());
1226 mapExposedFaces(map(), sFlds);
1227 mapExposedFaces(map(), vFlds);
1228 mapExposedFaces(map(), sptFlds);
1229 mapExposedFaces(map(), sytFlds);
1230 mapExposedFaces(map(), tFlds);
1238 if (map().hasMotionPoints())
1240 mesh_.movePoints(map().preMotionPoints());
1250 void Foam::fvMeshDistribute::addProcPatches
1254 List<Map<label>>& procPatchID
1266 sortedOrder(nbrProc, indices, lessProcPatches(nbrProc, referPatchID));
1272 label bFacei = indices[i];
1273 label proci = nbrProc[bFacei];
1277 if (!procPatchID[proci].
found(referPatchID[bFacei]))
1282 if (referPatchID[bFacei] == -1)
1286 processorPolyPatch pp
1290 mesh_.boundaryMesh().size(),
1291 mesh_.boundaryMesh(),
1296 procPatchID[proci].insert
1298 referPatchID[bFacei],
1304 processorFvPatchField<scalar>::typeName,
1311 const coupledPolyPatch& pcPatch
1312 = refCast<const coupledPolyPatch>
1314 mesh_.boundaryMesh()[referPatchID[bFacei]]
1316 processorCyclicPolyPatch pp
1320 mesh_.boundaryMesh().size(),
1321 mesh_.boundaryMesh(),
1328 procPatchID[proci].insert
1330 referPatchID[bFacei],
1336 processorCyclicFvPatchField<scalar>::typeName,
1352 const List<Map<label>>& procPatchID
1361 label origPatchi = referPatchID[bFacei];
1362 patchIDs[bFacei] = origPatchi;
1364 else if (nbrProc[bFacei] != -1)
1366 label origPatchi = referPatchID[bFacei];
1367 patchIDs[bFacei] = procPatchID[nbrProc[bFacei]][origPatchi];
1371 patchIDs[bFacei] = -1;
1379 void Foam::fvMeshDistribute::sendMesh
1398 Pout<<
"Sending to domain " << domain <<
nl
1408 CompactListList<label> zonePoints;
1414 forAll(pointZoneNames, nameI)
1416 label myZoneID = pointZones.findZoneID(pointZoneNames[nameI]);
1420 rowSizes[nameI] = pointZones[myZoneID].size();
1423 zonePoints.setSize(rowSizes);
1425 forAll(pointZoneNames, nameI)
1427 label myZoneID = pointZones.findZoneID(pointZoneNames[nameI]);
1431 zonePoints[nameI].deepCopy(pointZones[myZoneID]);
1437 CompactListList<label> zoneFaces;
1438 CompactListList<bool> zoneFaceFlip;
1444 forAll(faceZoneNames, nameI)
1446 label myZoneID = faceZones.findZoneID(faceZoneNames[nameI]);
1450 rowSizes[nameI] = faceZones[myZoneID].size();
1454 zoneFaces.setSize(rowSizes);
1455 zoneFaceFlip.setSize(rowSizes);
1457 forAll(faceZoneNames, nameI)
1459 label myZoneID = faceZones.findZoneID(faceZoneNames[nameI]);
1463 zoneFaces[nameI].deepCopy(faceZones[myZoneID]);
1464 zoneFaceFlip[nameI].deepCopy(faceZones[myZoneID].flipMap());
1470 CompactListList<label> zoneCells;
1476 forAll(cellZoneNames, nameI)
1478 label myZoneID = cellZones.findZoneID(cellZoneNames[nameI]);
1482 rowSizes[nameI] = cellZones[myZoneID].size();
1486 zoneCells.setSize(rowSizes);
1488 forAll(cellZoneNames, nameI)
1490 label myZoneID = cellZones.findZoneID(cellZoneNames[nameI]);
1494 zoneCells[nameI].deepCopy(cellZones[myZoneID]);
1516 << CompactListList<label, face>(
mesh.
faces())
1530 << sourcePointMaster;
1535 Pout<<
"Started sending mesh to domain " << domain
1558 faceList domainFaces = CompactListList<label, face>(fromNbr)();
1561 PtrList<entry> patchEntries(fromNbr);
1563 CompactListList<label> zonePoints(fromNbr);
1564 CompactListList<label> zoneFaces(fromNbr);
1565 CompactListList<bool> zoneFaceFlip(fromNbr);
1566 CompactListList<label> zoneCells(fromNbr);
1571 >> domainSourcePatch
1572 >> domainSourceNewNbrProc
1573 >> domainSourcePointMaster;
1585 std::move(domainPoints),
1586 std::move(domainFaces),
1587 std::move(domainAllOwner),
1588 std::move(domainAllNeighbour),
1591 fvMesh& domainMesh = *domainMeshPtr;
1593 List<polyPatch*>
patches(patchEntries.size());
1595 forAll(patchEntries, patchi)
1599 patchEntries[patchi].keyword(),
1600 patchEntries[patchi].
dict(),
1602 domainMesh.boundaryMesh()
1606 domainMesh.addFvPatches(
patches,
false);
1609 List<pointZone*> pZonePtrs(pointZoneNames.size());
1612 pZonePtrs[i] =
new pointZone
1617 domainMesh.pointZones()
1621 List<faceZone*> fZonePtrs(faceZoneNames.size());
1624 fZonePtrs[i] =
new faceZone
1630 domainMesh.faceZones()
1634 List<cellZone*> cZonePtrs(cellZoneNames.size());
1637 cZonePtrs[i] =
new cellZone
1642 domainMesh.cellZones()
1645 domainMesh.addZones(pZonePtrs, fZonePtrs, cZonePtrs);
1647 return domainMeshPtr;
1654 Foam::fvMeshDistribute::fvMeshDistribute(
fvMesh&
mesh,
const scalar mergeTol)
1678 <<
"At index " << celli <<
" distribution:" << newProc
1696 <<
"Size of distribution:"
1697 <<
distribution.size() <<
" mesh nCells:" << mesh_.nCells()
1708 <<
"This application requires all non-processor patches"
1709 <<
" to be present in the same order on all patches" <<
nl
1710 <<
"followed by the processor patches (which of course are unique)."
1712 <<
"Local patches:" << mesh_.boundaryMesh().names()
1717 const label nOldPoints(mesh_.nPoints());
1718 const label nOldFaces(mesh_.nFaces());
1719 const label nOldCells(mesh_.nCells());
1725 oldPatchNMeshPoints[patchi] =
patches[patchi].nPoints();
1741 std::move(oldPatchStarts),
1742 std::move(oldPatchNMeshPoints),
1758 const wordList pointZoneNames(mergeWordList(mesh_.pointZones().names()));
1759 const wordList faceZoneNames(mergeWordList(mesh_.faceZones().names()));
1760 const wordList cellZoneNames(mergeWordList(mesh_.cellZones().names()));
1824 mesh_.resetMotion();
1830 getFieldNames<volScalarField>(mesh_, allFieldNames);
1831 getFieldNames<volVectorField>(mesh_, allFieldNames);
1832 getFieldNames<volSphericalTensorField>(mesh_, allFieldNames);
1833 getFieldNames<volSymmTensorField>(mesh_, allFieldNames);
1834 getFieldNames<volTensorField>(mesh_, allFieldNames);
1836 getFieldNames<surfaceScalarField>(mesh_, allFieldNames);
1837 getFieldNames<surfaceVectorField>(mesh_, allFieldNames);
1838 getFieldNames<surfaceSphericalTensorField>(mesh_, allFieldNames);
1839 getFieldNames<surfaceSymmTensorField>(mesh_, allFieldNames);
1840 getFieldNames<surfaceTensorField>(mesh_, allFieldNames);
1842 getFieldNames<volScalarField::Internal>(mesh_, allFieldNames);
1843 getFieldNames<volVectorField::Internal>(mesh_, allFieldNames);
1844 getFieldNames<volSphericalTensorField::Internal>(mesh_, allFieldNames);
1845 getFieldNames<volSymmTensorField::Internal>(mesh_, allFieldNames);
1846 getFieldNames<volTensorField::Internal>(mesh_, allFieldNames);
1850 label oldInternalPatchi = findNonEmptyPatch();
1860 repatchFaceMap = repatchMap().faceMap();
1867 repatchMap().reverseFaceMap(),
1868 mesh_.nBoundaryFaces(),
1869 mesh_.nInternalFaces()
1871 - mesh_.nInternalFaces()
1885 Pout<<
nl <<
"MESH WITH PROC PATCHES DELETED:" <<
endl;
1886 printMeshInfo(mesh_);
1887 printFieldInfo<volScalarField>(mesh_);
1888 printFieldInfo<volVectorField>(mesh_);
1889 printFieldInfo<volSphericalTensorField>(mesh_);
1890 printFieldInfo<volSymmTensorField>(mesh_);
1891 printFieldInfo<volTensorField>(mesh_);
1892 printFieldInfo<surfaceScalarField>(mesh_);
1893 printFieldInfo<surfaceVectorField>(mesh_);
1894 printFieldInfo<surfaceSphericalTensorField>(mesh_);
1895 printFieldInfo<surfaceSymmTensorField>(mesh_);
1896 printFieldInfo<surfaceTensorField>(mesh_);
1931 forAll(nSendCells, recvProc)
1940 <<
"SUBSETTING FOR DOMAIN " << recvProc
1941 <<
" cells to send:"
1942 << nSendCells[recvProc]
1960 subCellMap[recvProc] = subsetter.
cellMap();
1962 inplaceRenumberWithFlip
1967 subFaceMap[recvProc]
1969 subPointMap[recvProc] = subsetter.
pointMap();
1970 subPatchMap[recvProc] = subsetter.
patchMap();
1989 mesh_.faceNeighbour(),
1990 mesh_.nInternalFaces(),
2001 procSourceNewNbrProc,
2002 procSourcePointMaster
2019 procSourceNewNbrProc,
2020 procSourcePointMaster,
2026 sendFields<volScalarField>
2033 sendFields<volVectorField>
2040 sendFields<volSphericalTensorField>
2047 sendFields<volSymmTensorField>
2054 sendFields<volTensorField>
2063 sendFields<surfaceScalarField>
2070 sendFields<surfaceVectorField>
2077 sendFields<surfaceSphericalTensorField>
2084 sendFields<surfaceSymmTensorField>
2091 sendFields<surfaceTensorField>
2100 sendFields<volScalarField::Internal>
2107 sendFields<volVectorField::Internal>
2114 sendFields<volSphericalTensorField::Internal>
2121 sendFields<volSymmTensorField::Internal>
2128 sendFields<volTensorField::Internal>
2151 const labelList oldFaceOwner(mesh_.faceOwner());
2152 const labelList oldFaceNeighbour(mesh_.faceNeighbour());
2153 const label oldInternalFaces = mesh_.nInternalFaces();
2179 for (
const label facei : flip)
2203 subMap().pointMap(),
2221 domainSourceNewNbrProc,
2222 domainSourcePointMaster
2225 sourceFace.
transfer(domainSourceFace);
2226 sourceProc.
transfer(domainSourceProc);
2227 sourcePatch.
transfer(domainSourcePatch);
2228 sourceNewNbrProc.
transfer(domainSourceNewNbrProc);
2229 sourcePointMaster.
transfer(domainSourcePointMaster);
2237 printMeshInfo(mesh_);
2238 printFieldInfo<volScalarField>(mesh_);
2239 printFieldInfo<volVectorField>(mesh_);
2240 printFieldInfo<volSphericalTensorField>(mesh_);
2241 printFieldInfo<volSymmTensorField>(mesh_);
2242 printFieldInfo<volTensorField>(mesh_);
2243 printFieldInfo<surfaceScalarField>(mesh_);
2244 printFieldInfo<surfaceVectorField>(mesh_);
2245 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2246 printFieldInfo<surfaceSymmTensorField>(mesh_);
2247 printFieldInfo<surfaceTensorField>(mesh_);
2259 forAll(nRevcCells, sendProc)
2267 <<
"RECEIVING FROM DOMAIN " << sendProc
2268 <<
" cells to receive:"
2269 << nRevcCells[sendProc]
2308 domainMeshPtr = receiveMesh
2315 const_cast<Time&
>(mesh_.time()),
2319 domainSourceNewNbrProc,
2320 domainSourcePointMaster,
2323 fvMesh& domainMesh = domainMeshPtr();
2333 receiveFields<volScalarField>
2341 receiveFields<volVectorField>
2349 receiveFields<volSphericalTensorField>
2357 receiveFields<volSymmTensorField>
2365 receiveFields<volTensorField>
2375 receiveFields<surfaceScalarField>
2383 receiveFields<surfaceVectorField>
2391 receiveFields<surfaceSphericalTensorField>
2399 receiveFields<surfaceSymmTensorField>
2407 receiveFields<surfaceTensorField>
2417 receiveFields<volScalarField::Internal>
2425 receiveFields<volVectorField::Internal>
2433 receiveFields<volSphericalTensorField::Internal>
2441 receiveFields<volSymmTensorField::Internal>
2449 receiveFields<volTensorField::Internal>
2458 const fvMesh& domainMesh = domainMeshPtr();
2464 constructPatchMap[sendProc] =
2471 Pout<<
nl <<
"RECEIVED MESH FROM:" << sendProc <<
endl;
2472 printMeshInfo(domainMesh);
2473 printFieldInfo<volScalarField>(domainMesh);
2474 printFieldInfo<volVectorField>(domainMesh);
2475 printFieldInfo<volSphericalTensorField>(domainMesh);
2476 printFieldInfo<volSymmTensorField>(domainMesh);
2477 printFieldInfo<volTensorField>(domainMesh);
2478 printFieldInfo<surfaceScalarField>(domainMesh);
2479 printFieldInfo<surfaceVectorField>(domainMesh);
2480 printFieldInfo<surfaceSphericalTensorField>(domainMesh);
2481 printFieldInfo<surfaceSymmTensorField>(domainMesh);
2482 printFieldInfo<surfaceTensorField>(domainMesh);
2541 sourceFace = mapBoundaryData
2549 sourceProc = mapBoundaryData
2557 sourcePatch = mapBoundaryData
2565 sourceNewNbrProc = mapBoundaryData
2571 domainSourceNewNbrProc
2574 sourcePointMaster = mapPointData
2579 domainSourcePointMaster
2585 const labelList& oldCellMap = map().oldCellMap();
2586 const labelList& oldFaceMap = map().oldFaceMap();
2587 const labelList& oldPointMap = map().oldPointMap();
2588 const labelList& oldPatchMap = map().oldPatchMap();
2591 forAll(constructPatchMap, proci)
2593 if (proci != sendProc && constructPatchMap[proci].size())
2597 inplaceRenumberWithFlip
2602 constructFaceMap[proci]
2615 flippedAddedFaces.
resize(nBnd/4);
2620 domainFaceI < domainMesh.
nFaces();
2624 label newFaceI = map().addedFaceMap()[domainFaceI];
2625 label newCellI = mesh_.faceOwner()[newFaceI];
2629 if (newCellI != map().addedCellMap()[domainCellI])
2631 flippedAddedFaces.
insert(domainFaceI);
2640 for (
const label domainFaceI : flippedAddedFaces)
2642 label&
val = constructFaceMap[sendProc][domainFaceI];
2645 inplaceRenumberWithFlip
2647 map().addedFaceMap(),
2650 constructFaceMap[sendProc]
2657 Pout<<
nl <<
"MERGED MESH FROM:" << sendProc <<
endl;
2658 printMeshInfo(mesh_);
2659 printFieldInfo<volScalarField>(mesh_);
2660 printFieldInfo<volVectorField>(mesh_);
2661 printFieldInfo<volSphericalTensorField>(mesh_);
2662 printFieldInfo<volSymmTensorField>(mesh_);
2663 printFieldInfo<volTensorField>(mesh_);
2664 printFieldInfo<surfaceScalarField>(mesh_);
2665 printFieldInfo<surfaceVectorField>(mesh_);
2666 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2667 printFieldInfo<surfaceSymmTensorField>(mesh_);
2668 printFieldInfo<surfaceTensorField>(mesh_);
2680 printMeshInfo(mesh_);
2681 printFieldInfo<volScalarField>(mesh_);
2682 printFieldInfo<volVectorField>(mesh_);
2683 printFieldInfo<volSphericalTensorField>(mesh_);
2684 printFieldInfo<volSymmTensorField>(mesh_);
2685 printFieldInfo<volTensorField>(mesh_);
2686 printFieldInfo<surfaceScalarField>(mesh_);
2687 printFieldInfo<surfaceVectorField>(mesh_);
2688 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2689 printFieldInfo<surfaceSymmTensorField>(mesh_);
2690 printFieldInfo<surfaceTensorField>(mesh_);
2697 mergeSharedPoints(sourcePointMaster, constructPointMap);
2709 addProcPatches(sourceNewNbrProc, sourcePatch, procPatchID);
2728 repatch(newPatchID, constructFaceMap);
2732 initPatchFields<volScalarField, processorFvPatchField<scalar>>
2736 initPatchFields<volVectorField, processorFvPatchField<vector>>
2748 initPatchFields<volSymmTensorField, processorFvPatchField<symmTensor>>
2752 initPatchFields<volTensorField, processorFvPatchField<tensor>>
2758 mesh_.setInstance(mesh_.time().timeName());
2765 printMeshInfo(mesh_);
2766 printFieldInfo<volScalarField>(mesh_);
2767 printFieldInfo<volVectorField>(mesh_);
2768 printFieldInfo<volSphericalTensorField>(mesh_);
2769 printFieldInfo<volSymmTensorField>(mesh_);
2770 printFieldInfo<volTensorField>(mesh_);
2771 printFieldInfo<surfaceScalarField>(mesh_);
2772 printFieldInfo<surfaceVectorField>(mesh_);
2773 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2774 printFieldInfo<surfaceSymmTensorField>(mesh_);
2775 printFieldInfo<surfaceTensorField>(mesh_);
2787 std::move(oldPatchStarts),
2788 std::move(oldPatchNMeshPoints),
2790 std::move(subPointMap),
2791 std::move(subFaceMap),
2792 std::move(subCellMap),
2793 std::move(subPatchMap),
2795 std::move(constructPointMap),
2796 std::move(constructFaceMap),
2797 std::move(constructCellMap),
2798 std::move(constructPatchMap),