51 const bool selectEqual,
60 if (selectEqual == (values[i] == value))
71 if (selectEqual == (values[i] == value))
81 void Foam::fvMeshDistribute::checkEqualWordList
94 if (allNames[procI] != allNames[0])
97 <<
"When checking for equal " << msg.c_str() <<
" :" <<
endl
98 <<
"processor0 has:" << allNames[0] <<
endl
99 <<
"processor" << procI <<
" has:" << allNames[procI] <<
endl
100 << msg.c_str() <<
" need to be synchronised on all processors."
114 HashSet<word> mergedNames;
117 forAll(allNames[procI], i)
119 mergedNames.insert(allNames[procI][i]);
122 return mergedNames.toc();
129 Pout<<
"Primitives:" <<
nl
132 <<
" faces :" << mesh.
nFaces() <<
nl
133 <<
" cells :" << mesh.
nCells() <<
nl;
140 const polyPatch& pp = patches[patchI].patch();
142 Pout<<
" " << patchI <<
" name:" << pp.
name()
143 <<
" size:" << pp.size()
144 <<
" start:" << pp.
start()
145 <<
" type:" << pp.type()
155 Pout<<
" " << zoneI <<
" name:" << pz.
name()
156 <<
" size:" << pz.
size()
166 Pout<<
" " << zoneI <<
" name:" << fz.
name()
167 <<
" size:" << fz.
size()
177 Pout<<
" " << zoneI <<
" name:" << cz.
name()
178 <<
" size:" << cz.
size()
194 <<
"Current coupling info:"
197 forAll(sourceFace, bFaceI)
201 Pout<<
" meshFace:" << meshFaceI
203 <<
" connects to proc:" << sourceProc[bFaceI]
204 <<
"/face:" << sourceFace[bFaceI]
205 <<
" which will move to proc:" << sourceNewProc[bFaceI]
212 Foam::label Foam::fvMeshDistribute::findNonEmptyPatch()
const
216 label nonEmptyPatchI = -1;
222 if (!isA<emptyPolyPatch>(pp) && !pp.
coupled())
224 nonEmptyPatchI = patchI;
229 if (nonEmptyPatchI == -1)
231 FatalErrorIn(
"fvMeshDistribute::findNonEmptyPatch() const")
232 <<
"Cannot find a patch which is neither of type empty nor"
233 <<
" coupled in patches " << patches.
names() <<
endl
234 <<
"There has to be at least one such patch for"
240 Pout<<
"findNonEmptyPatch : using patch " << nonEmptyPatchI
241 <<
" name:" << patches[nonEmptyPatchI].
name()
242 <<
" type:" << patches[nonEmptyPatchI].type()
243 <<
" to put exposed faces into." <<
endl;
249 label procPatchI = -1;
253 if (isA<processorPolyPatch>(patches[patchI]))
257 else if (procPatchI != -1)
259 FatalErrorIn(
"fvMeshDistribute::findNonEmptyPatch() const")
260 <<
"Processor patches should be at end of patch list."
262 <<
"Have processor patch " << procPatchI
263 <<
" followed by non-processor patch " << patchI
264 <<
" in patches " << patches.
names()
269 return nonEmptyPatchI;
274 Foam::label Foam::fvMeshDistribute::addProcPatch
276 const word& patchName,
284 polyBoundaryMesh& polyPatches =
285 const_cast<polyBoundaryMesh&
>(mesh_.boundaryMesh());
286 fvBoundaryMesh& fvPatches =
const_cast<fvBoundaryMesh&
>(mesh_.boundary());
288 if (polyPatches.findPatchID(patchName) != -1)
290 FatalErrorIn(
"fvMeshDistribute::addProcPatch(const word&, const label)")
291 <<
"Cannot create patch " << patchName <<
" since already exists."
293 <<
"Current patch names:" << polyPatches.names()
302 label sz = polyPatches.size();
305 polyPatches.setSize(sz+1);
309 new processorPolyPatch
315 mesh_.boundaryMesh(),
320 fvPatches.setSize(sz+1);
336 void Foam::fvMeshDistribute::deleteTrailingPatch()
341 polyBoundaryMesh& polyPatches =
342 const_cast<polyBoundaryMesh&
>(mesh_.boundaryMesh());
343 fvBoundaryMesh& fvPatches =
const_cast<fvBoundaryMesh&
>(mesh_.boundary());
345 if (polyPatches.empty())
347 FatalErrorIn(
"fvMeshDistribute::deleteTrailingPatch(fvMesh&)")
348 <<
"No patches in mesh"
352 label sz = polyPatches.size();
354 label nFaces = polyPatches[sz-1].size();
359 Pout<<
"deleteTrailingPatch : Removing patch " << sz-1
360 <<
" : " << polyPatches[sz-1].
name() <<
" size:" << nFaces <<
endl;
366 <<
"There are still " << nFaces <<
" faces in patch to be deleted "
367 << sz-1 <<
' ' << polyPatches[sz-1].name()
372 polyPatches.setSize(sz-1);
373 fvPatches.setSize(sz-1);
381 const label destinationPatch
386 labelList newPatchID(mesh_.nFaces() - mesh_.nInternalFaces(), -1);
388 label nProcPatches = 0;
390 forAll(mesh_.boundaryMesh(), patchI)
394 if (isA<processorPolyPatch>(pp))
398 Pout<<
"Moving all faces of patch " << pp.
name()
399 <<
" into patch " << destinationPatch
403 label offset = pp.start() - mesh_.nInternalFaces();
407 newPatchID[offset+i] = destinationPatch;
418 autoPtr<mapPolyMesh> map = repatch(newPatchID, dummyFaceMaps);
424 const polyPatch& pp = mesh_.boundaryMesh()[patchI];
426 if (isA<processorPolyPatch>(pp))
428 deleteTrailingPatch();
429 deleteTrailingPatchFields<volScalarField>();
430 deleteTrailingPatchFields<volVectorField>();
431 deleteTrailingPatchFields<volSphericalTensorField>();
432 deleteTrailingPatchFields<volSymmTensorField>();
433 deleteTrailingPatchFields<volTensorField>();
435 deleteTrailingPatchFields<surfaceScalarField>();
436 deleteTrailingPatchFields<surfaceVectorField>();
437 deleteTrailingPatchFields<surfaceSphericalTensorField>();
438 deleteTrailingPatchFields<surfaceSymmTensorField>();
439 deleteTrailingPatchFields<surfaceTensorField>();
454 polyTopoChange meshMod(mesh_);
456 forAll(newPatchID, bFaceI)
458 if (newPatchID[bFaceI] != -1)
460 label faceI = mesh_.nInternalFaces() + bFaceI;
462 label zoneID = mesh_.faceZones().whichZone(faceI);
463 bool zoneFlip =
false;
467 const faceZone& fZone = mesh_.faceZones()[zoneID];
468 zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
475 mesh_.faces()[faceI],
477 mesh_.faceOwner()[faceI],
494 PtrList<FieldField<fvsPatchField, scalar> > sFlds;
495 saveBoundaryFields<scalar, surfaceMesh>(sFlds);
496 PtrList<FieldField<fvsPatchField, vector> > vFlds;
497 saveBoundaryFields<vector, surfaceMesh>(vFlds);
498 PtrList<FieldField<fvsPatchField, sphericalTensor> > sptFlds;
499 saveBoundaryFields<sphericalTensor, surfaceMesh>(sptFlds);
500 PtrList<FieldField<fvsPatchField, symmTensor> > sytFlds;
501 saveBoundaryFields<symmTensor, surfaceMesh>(sytFlds);
502 PtrList<FieldField<fvsPatchField, tensor> > tFlds;
503 saveBoundaryFields<tensor, surfaceMesh>(tFlds);
506 autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh_,
false,
true);
509 mesh_.updateMesh(map);
513 mapBoundaryFields<scalar, surfaceMesh>(map, sFlds);
514 mapBoundaryFields<vector, surfaceMesh>(map, vFlds);
515 mapBoundaryFields<sphericalTensor, surfaceMesh>(map, sptFlds);
516 mapBoundaryFields<symmTensor, surfaceMesh>(map, sytFlds);
517 mapBoundaryFields<tensor, surfaceMesh>(map, tFlds);
521 if (map().hasMotionPoints())
523 mesh_.movePoints(map().preMotionPoints());
530 label index =
findIndex(map().reverseFaceMap(), -1);
536 "fvMeshDistribute::repatch(const labelList&, labelListList&)"
537 ) <<
"reverseFaceMap contains -1 at index:"
539 <<
"This means that the repatch operation was not just"
544 forAll(constructFaceMap, procI)
566 Map<label> pointToMaster
575 if (
returnReduce(pointToMaster.size(), sumOp<label>()) == 0)
577 return autoPtr<mapPolyMesh>(NULL);
580 polyTopoChange meshMod(mesh_);
585 autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh_,
false,
true);
588 mesh_.updateMesh(map);
591 forAll(constructPointMap, procI)
593 labelList& constructMap = constructPointMap[procI];
597 label oldPointI = constructMap[i];
599 label newPointI = map().reversePointMap()[oldPointI];
603 constructMap[i] = -newPointI-2;
605 else if (newPointI >= 0)
607 constructMap[i] = newPointI;
612 <<
"Problem. oldPointI:" << oldPointI
622 void Foam::fvMeshDistribute::getNeighbourData
630 label nBnd = mesh_.nFaces() - mesh_.nInternalFaces();
631 sourceFace.setSize(nBnd);
632 sourceProc.setSize(nBnd);
633 sourceNewProc.setSize(nBnd);
635 const polyBoundaryMesh& patches = mesh_.boundaryMesh();
643 const polyPatch& pp = patches[patchI];
645 if (isA<processorPolyPatch>(pp))
647 label offset = pp.start() - mesh_.nInternalFaces();
652 label bndI = offset + i;
653 nbrFaces[bndI] = pp.start()+i;
657 SubList<label>(nbrNewProc, pp.size(), offset).assign
659 UIndirectList<label>(distribution, pp.faceCells())()
672 const polyPatch& pp = patches[patchI];
673 label offset = pp.start() - mesh_.nInternalFaces();
675 if (isA<processorPolyPatch>(pp))
677 const processorPolyPatch& procPatch =
678 refCast<const processorPolyPatch>(pp);
687 label bndI = offset + i;
688 sourceFace[bndI] = pp.start()+i;
690 sourceNewProc[bndI] = nbrNewProc[bndI];
698 label bndI = offset + i;
699 sourceFace[bndI] = nbrFaces[bndI];
700 sourceProc[bndI] = procPatch.neighbProcNo();
701 sourceNewProc[bndI] = nbrNewProc[bndI];
710 label bndI = offset + i;
711 sourceFace[bndI] = patchI;
712 sourceProc[bndI] = -1;
713 sourceNewProc[bndI] = -1;
721 void Foam::fvMeshDistribute::subsetBoundaryData
730 const label oldInternalFaces,
741 subFace.setSize(mesh.nFaces() - mesh.nInternalFaces());
742 subProc.setSize(mesh.nFaces() - mesh.nInternalFaces());
743 subNewProc.setSize(mesh.nFaces() - mesh.nInternalFaces());
745 forAll(subFace, newBFaceI)
747 label newFaceI = newBFaceI + mesh.nInternalFaces();
749 label oldFaceI = faceMap[newFaceI];
752 if (oldFaceI < oldInternalFaces)
754 subFace[newBFaceI] = oldFaceI;
757 label oldOwn = oldFaceOwner[oldFaceI];
758 label oldNei = oldFaceNeighbour[oldFaceI];
760 if (oldOwn == cellMap[mesh.faceOwner()[newFaceI]])
763 subNewProc[newBFaceI] = oldDistribution[oldNei];
768 subNewProc[newBFaceI] = oldDistribution[oldOwn];
774 label oldBFaceI = oldFaceI - oldInternalFaces;
776 subFace[newBFaceI] = sourceFace[oldBFaceI];
777 subProc[newBFaceI] = sourceProc[oldBFaceI];
778 subNewProc[newBFaceI] = sourceNewProc[oldBFaceI];
786 void Foam::fvMeshDistribute::findCouples
788 const primitiveMesh& mesh,
793 const primitiveMesh& domainMesh,
803 HashTable<label, labelPair, labelPair::Hash<> > map(domainFace.size());
805 forAll(domainFace, bFaceI)
807 map.insert(
labelPair(domainFace[bFaceI], domainProc[bFaceI]), bFaceI);
813 masterCoupledFaces.setSize(domainFace.size());
814 slaveCoupledFaces.setSize(domainFace.size());
817 forAll(sourceFace, bFaceI)
819 if (sourceProc[bFaceI] != -1)
821 labelPair myData(sourceFace[bFaceI], sourceProc[bFaceI]);
823 HashTable<label, labelPair, labelPair::Hash<> >::const_iterator
824 iter = map.find(myData);
826 if (iter != map.end())
828 label nbrBFaceI = iter();
830 masterCoupledFaces[coupledI] = mesh.nInternalFaces() + bFaceI;
831 slaveCoupledFaces[coupledI] =
832 domainMesh.nInternalFaces()
840 masterCoupledFaces.setSize(coupledI);
841 slaveCoupledFaces.setSize(coupledI);
845 Pout<<
"findCouples : found " << coupledI
846 <<
" faces that will be stitched" <<
nl <<
endl;
854 const primitiveMesh& mesh,
855 const mapAddedPolyMesh& map,
857 const label nInternalFaces1,
861 labelList newBoundaryData(mesh.nFaces() - mesh.nInternalFaces());
863 forAll(boundaryData0, oldBFaceI)
865 label newFaceI = map.oldFaceMap()[oldBFaceI + map.nOldInternalFaces()];
868 if (newFaceI >= 0 && newFaceI >= mesh.nInternalFaces())
870 newBoundaryData[newFaceI - mesh.nInternalFaces()] =
871 boundaryData0[oldBFaceI];
875 forAll(boundaryData1, addedBFaceI)
877 label newFaceI = map.addedFaceMap()[addedBFaceI + nInternalFaces1];
879 if (newFaceI >= 0 && newFaceI >= mesh.nInternalFaces())
881 newBoundaryData[newFaceI - mesh.nInternalFaces()] =
882 boundaryData1[addedBFaceI];
886 return newBoundaryData;
894 const label oldInternalPatchI
898 polyTopoChange meshMod(mesh_);
902 removeCells cellRemover(mesh_,
false);
905 labelList exposedFaces(cellRemover.getExposedFaces(cellsToRemove));
908 cellRemover.setRefinement
912 labelList(exposedFaces.size(), oldInternalPatchI),
918 autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh_,
false,
false);
921 mesh_.updateMesh(map);
924 if (map().hasMotionPoints())
926 mesh_.movePoints(map().preMotionPoints());
935 void Foam::fvMeshDistribute::addProcPatches
947 forAll(neighbourNewProc, bFaceI)
949 if (neighbourNewProc[bFaceI] != -1)
951 procPatchSizes[neighbourNewProc[bFaceI]]++;
958 forAll(procPatchSizes, procI)
960 if (procPatchSizes[procI] > 0)
962 const word patchName =
969 procPatchID[procI] = addProcPatch(patchName, procI);
970 addPatchFields<volScalarField>
972 processorFvPatchField<scalar>::typeName
974 addPatchFields<volVectorField>
976 processorFvPatchField<vector>::typeName
978 addPatchFields<volSphericalTensorField>
980 processorFvPatchField<sphericalTensor>::typeName
982 addPatchFields<volSymmTensorField>
984 processorFvPatchField<symmTensor>::typeName
986 addPatchFields<volTensorField>
988 processorFvPatchField<tensor>::typeName
991 addPatchFields<surfaceScalarField>
993 processorFvPatchField<scalar>::typeName
995 addPatchFields<surfaceVectorField>
997 processorFvPatchField<vector>::typeName
999 addPatchFields<surfaceSphericalTensorField>
1001 processorFvPatchField<sphericalTensor>::typeName
1003 addPatchFields<surfaceSymmTensorField>
1005 processorFvPatchField<symmTensor>::typeName
1007 addPatchFields<surfaceTensorField>
1009 processorFvPatchField<tensor>::typeName
1014 procPatchID[procI] = -1;
1029 forAll(neighbourNewProc, bFaceI)
1031 if (neighbourNewProc[bFaceI] != -1)
1033 label nbrProc = neighbourNewProc[bFaceI];
1035 patchIDs[bFaceI] = procPatchID[nbrProc];
1039 patchIDs[bFaceI] = -1;
1047 void Foam::fvMeshDistribute::sendMesh
1064 Pout<<
"Sending to domain " << domain <<
nl
1065 <<
" nPoints:" << mesh.nPoints() <<
nl
1066 <<
" nFaces:" << mesh.nFaces() <<
nl
1067 <<
" nCells:" << mesh.nCells() <<
nl
1068 <<
" nPatches:" << mesh.boundaryMesh().size() <<
nl
1074 CompactListList_dev<label> zonePoints;
1078 labelList rowSizes(pointZoneNames.size(), 0);
1080 forAll(pointZoneNames, nameI)
1082 label myZoneID = pointZones.findZoneID(pointZoneNames[nameI]);
1086 rowSizes[nameI] = pointZones[myZoneID].size();
1089 zonePoints.setSize(rowSizes);
1091 forAll(pointZoneNames, nameI)
1093 label myZoneID = pointZones.findZoneID(pointZoneNames[nameI]);
1097 zonePoints[nameI].assign(pointZones[myZoneID]);
1103 CompactListList_dev<label> zoneFaces;
1104 CompactListList_dev<bool> zoneFaceFlip;
1108 labelList rowSizes(faceZoneNames.size(), 0);
1110 forAll(faceZoneNames, nameI)
1112 label myZoneID = faceZones.findZoneID(faceZoneNames[nameI]);
1116 rowSizes[nameI] = faceZones[myZoneID].size();
1120 zoneFaces.setSize(rowSizes);
1121 zoneFaceFlip.setSize(rowSizes);
1123 forAll(faceZoneNames, nameI)
1125 label myZoneID = faceZones.findZoneID(faceZoneNames[nameI]);
1129 zoneFaces[nameI].assign(faceZones[myZoneID]);
1130 zoneFaceFlip[nameI].assign(faceZones[myZoneID].flipMap());
1136 CompactListList_dev<label> zoneCells;
1140 labelList rowSizes(cellZoneNames.size(), 0);
1142 forAll(cellZoneNames, nameI)
1144 label myZoneID = cellZones.findZoneID(cellZoneNames[nameI]);
1148 rowSizes[nameI] = cellZones[myZoneID].size();
1152 zoneCells.setSize(rowSizes);
1154 forAll(cellZoneNames, nameI)
1156 label myZoneID = cellZones.findZoneID(cellZoneNames[nameI]);
1160 zoneCells[nameI].assign(cellZones[myZoneID]);
1182 << CompactListList_dev<label, face>(mesh.faces())
1184 << mesh.faceNeighbour()
1185 << mesh.boundaryMesh()
1199 Pout<<
"Started sending mesh to domain " << domain
1212 const Time& runTime,
1220 faceList domainFaces = CompactListList_dev<label, face>(fromNbr)();
1223 PtrList<entry> patchEntries(fromNbr);
1225 CompactListList_dev<label> zonePoints(fromNbr);
1226 CompactListList_dev<label> zoneFaces(fromNbr);
1227 CompactListList_dev<bool> zoneFaceFlip(fromNbr);
1228 CompactListList_dev<label> zoneCells(fromNbr);
1233 >> domainSourceNewProc;
1236 autoPtr<fvMesh> domainMeshPtr
1254 fvMesh& domainMesh = domainMeshPtr();
1256 List<polyPatch*>
patches(patchEntries.size());
1258 forAll(patchEntries, patchI)
1262 patchEntries[patchI].keyword(),
1263 patchEntries[patchI].dict(),
1265 domainMesh.boundaryMesh()
1269 domainMesh.addFvPatches(patches,
false);
1272 List<pointZone*> pZonePtrs(pointZoneNames.size());
1275 pZonePtrs[i] =
new pointZone
1280 domainMesh.pointZones()
1284 List<faceZone*> fZonePtrs(faceZoneNames.size());
1287 fZonePtrs[i] =
new faceZone
1293 domainMesh.faceZones()
1297 List<cellZone*> cZonePtrs(cellZoneNames.size());
1300 cZonePtrs[i] =
new cellZone
1305 domainMesh.cellZones()
1308 domainMesh.addZones(pZonePtrs, fZonePtrs, cZonePtrs);
1310 return domainMeshPtr;
1317 Foam::fvMeshDistribute::fvMeshDistribute(
fvMesh& mesh,
const scalar mergeTol)
1332 forAll(distribution, cellI)
1334 label newProc = distribution[cellI];
1338 FatalErrorIn(
"fvMeshDistribute::distribute(const labelList&)")
1341 <<
"At index " << cellI <<
" distribution:" << newProc
1356 if (distribution.
size() != mesh_.nCells())
1358 FatalErrorIn(
"fvMeshDistribute::distribute(const labelList&)")
1359 <<
"Size of distribution:"
1360 << distribution.
size() <<
" mesh nCells:" << mesh_.nCells()
1370 FatalErrorIn(
"fvMeshDistribute::distribute(const labelList&)")
1371 <<
"This application requires all non-processor patches"
1372 <<
" to be present in the same order on all patches" <<
nl
1373 <<
"followed by the processor patches (which of course are unique)."
1375 <<
"Local patches:" << mesh_.boundaryMesh().names()
1380 const label nOldPoints(mesh_.nPoints());
1381 const label nOldFaces(mesh_.nFaces());
1382 const label nOldCells(mesh_.nCells());
1387 oldPatchStarts[patchI] = patches[patchI].start();
1388 oldPatchNMeshPoints[patchI] = patches[patchI].nPoints();
1406 oldPatchStarts.xfer(),
1407 oldPatchNMeshPoints.xfer(),
1424 const wordList pointZoneNames(mergeWordList(mesh_.pointZones().names()));
1425 const wordList faceZoneNames(mergeWordList(mesh_.faceZones().names()));
1426 const wordList cellZoneNames(mergeWordList(mesh_.cellZones().names()));
1460 getNeighbourData(distribution, sourceFace, sourceProc, sourceNewProc);
1467 mesh_.resetMotion();
1471 checkEqualWordList(
"volScalarFields", volScalars);
1473 checkEqualWordList(
"volVectorFields", volVectors);
1478 checkEqualWordList(
"volSphericalTensorFields", volSphereTensors);
1480 checkEqualWordList(
"volSymmTensorFields", volSymmTensors);
1482 checkEqualWordList(
"volTensorField", volTensors);
1485 checkEqualWordList(
"surfaceScalarFields", surfScalars);
1487 checkEqualWordList(
"surfaceVectorFields", surfVectors);
1492 checkEqualWordList(
"surfaceSphericalTensorFields", surfSphereTensors);
1497 checkEqualWordList(
"surfaceSymmTensorFields", surfSymmTensors);
1499 checkEqualWordList(
"surfaceTensorFields", surfTensors);
1505 label oldInternalPatchI = findNonEmptyPatch();
1516 repatchFaceMap = repatchMap().faceMap();
1523 repatchMap().reverseFaceMap(),
1524 mesh_.nFaces() - mesh_.nInternalFaces(),
1525 mesh_.nInternalFaces()
1527 - mesh_.nInternalFaces()
1540 Pout<<
nl <<
"MESH WITH PROC PATCHES DELETED:" <<
endl;
1541 printMeshInfo(mesh_);
1542 printFieldInfo<volScalarField>(mesh_);
1543 printFieldInfo<volVectorField>(mesh_);
1544 printFieldInfo<volSphericalTensorField>(mesh_);
1545 printFieldInfo<volSymmTensorField>(mesh_);
1546 printFieldInfo<volTensorField>(mesh_);
1547 printFieldInfo<surfaceScalarField>(mesh_);
1548 printFieldInfo<surfaceVectorField>(mesh_);
1549 printFieldInfo<surfaceSphericalTensorField>(mesh_);
1550 printFieldInfo<surfaceSymmTensorField>(mesh_);
1551 printFieldInfo<surfaceTensorField>(mesh_);
1605 <<
"SUBSETTING FOR DOMAIN " << recvProc
1606 <<
" cells to send:"
1627 subCellMap[recvProc] = subsetter.
cellMap();
1633 subPointMap[recvProc] = subsetter.
pointMap();
1634 subPatchMap[recvProc] = subsetter.
patchMap();
1650 mesh_.faceNeighbour(),
1651 mesh_.nInternalFaces(),
1679 sendFields<volScalarField>
1686 sendFields<volVectorField>
1693 sendFields<volSphericalTensorField>
1700 sendFields<volSymmTensorField>
1707 sendFields<volTensorField>
1715 sendFields<surfaceScalarField>
1722 sendFields<surfaceVectorField>
1729 sendFields<surfaceSphericalTensorField>
1736 sendFields<surfaceSymmTensorField>
1743 sendFields<surfaceTensorField>
1763 string contents = sendStr[procI].str();
1764 const char* ptr = contents.data();
1766 sendBufs[procI].setSize(contents.size());
1767 forAll(sendBufs[procI], i)
1769 sendBufs[procI][i] = *ptr++;
1772 sendStr.
set(procI, NULL);
1778 exchange<List<char>,
char>(sendBufs, recvBufs, sizes);
1782 string contents(recvBufs[procI].begin(), recvBufs[procI].size());
1797 const labelList oldFaceOwner(mesh_.faceOwner());
1798 const labelList oldFaceNeighbour(mesh_.faceNeighbour());
1799 const label oldInternalFaces = mesh_.nInternalFaces();
1853 sourceFace.
transfer(domainSourceFace);
1854 sourceProc.
transfer(domainSourceProc);
1855 sourceNewProc.
transfer(domainSourceNewProc);
1863 printMeshInfo(mesh_);
1864 printFieldInfo<volScalarField>(mesh_);
1865 printFieldInfo<volVectorField>(mesh_);
1866 printFieldInfo<volSphericalTensorField>(mesh_);
1867 printFieldInfo<volSymmTensorField>(mesh_);
1868 printFieldInfo<volTensorField>(mesh_);
1869 printFieldInfo<surfaceScalarField>(mesh_);
1870 printFieldInfo<surfaceVectorField>(mesh_);
1871 printFieldInfo<surfaceSphericalTensorField>(mesh_);
1872 printFieldInfo<surfaceSymmTensorField>(mesh_);
1873 printFieldInfo<surfaceTensorField>(mesh_);
1882 forAll(nSendCells, sendProc)
1894 <<
"RECEIVING FROM DOMAIN " << sendProc
1895 <<
" cells to receive:"
1924 domainMeshPtr = receiveMesh
1931 const_cast<Time&>(mesh_.time()),
1934 domainSourceNewProc,
1937 fvMesh& domainMesh = domainMeshPtr();
1943 receiveFields<volScalarField>
1951 receiveFields<volVectorField>
1959 receiveFields<volSphericalTensorField>
1967 receiveFields<volSymmTensorField>
1975 receiveFields<volTensorField>
1984 receiveFields<surfaceScalarField>
1992 receiveFields<surfaceVectorField>
2000 receiveFields<surfaceSphericalTensorField>
2008 receiveFields<surfaceSymmTensorField>
2016 receiveFields<surfaceTensorField>
2025 const fvMesh& domainMesh = domainMeshPtr();
2031 constructPatchMap[sendProc] =
2038 Pout<<
nl <<
"RECEIVED MESH FROM:" << sendProc <<
endl;
2039 printMeshInfo(domainMesh);
2040 printFieldInfo<volScalarField>(domainMesh);
2041 printFieldInfo<volVectorField>(domainMesh);
2042 printFieldInfo<volSphericalTensorField>(domainMesh);
2043 printFieldInfo<volSymmTensorField>(domainMesh);
2044 printFieldInfo<volTensorField>(domainMesh);
2045 printFieldInfo<surfaceScalarField>(domainMesh);
2046 printFieldInfo<surfaceVectorField>(domainMesh);
2047 printFieldInfo<surfaceSphericalTensorField>(domainMesh);
2048 printFieldInfo<surfaceSymmTensorField>(domainMesh);
2049 printFieldInfo<surfaceTensorField>(domainMesh);
2135 const labelList& oldCellMap = map().oldCellMap();
2136 const labelList& oldFaceMap = map().oldFaceMap();
2137 const labelList& oldPointMap = map().oldPointMap();
2138 const labelList& oldPatchMap = map().oldPatchMap();
2140 forAll(constructPatchMap, procI)
2142 if (procI != sendProc && constructPatchMap[procI].size())
2160 Pout<<
nl <<
"MERGED MESH FROM:" << sendProc <<
endl;
2161 printMeshInfo(mesh_);
2162 printFieldInfo<volScalarField>(mesh_);
2163 printFieldInfo<volVectorField>(mesh_);
2164 printFieldInfo<volSphericalTensorField>(mesh_);
2165 printFieldInfo<volSymmTensorField>(mesh_);
2166 printFieldInfo<volTensorField>(mesh_);
2167 printFieldInfo<surfaceScalarField>(mesh_);
2168 printFieldInfo<surfaceVectorField>(mesh_);
2169 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2170 printFieldInfo<surfaceSymmTensorField>(mesh_);
2171 printFieldInfo<surfaceTensorField>(mesh_);
2182 printMeshInfo(mesh_);
2183 printFieldInfo<volScalarField>(mesh_);
2184 printFieldInfo<volVectorField>(mesh_);
2185 printFieldInfo<volSphericalTensorField>(mesh_);
2186 printFieldInfo<volSymmTensorField>(mesh_);
2187 printFieldInfo<volTensorField>(mesh_);
2188 printFieldInfo<surfaceScalarField>(mesh_);
2189 printFieldInfo<surfaceVectorField>(mesh_);
2190 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2191 printFieldInfo<surfaceSymmTensorField>(mesh_);
2192 printFieldInfo<surfaceTensorField>(mesh_);
2205 addProcPatches(sourceNewProc, procPatchID);
2214 getProcBoundaryPatch
2223 repatch(newPatchID, constructFaceMap);
2227 mergeSharedPoints(constructPointMap);
2231 initPatchFields<volScalarField, processorFvPatchField<scalar> >
2235 initPatchFields<volVectorField, processorFvPatchField<vector> >
2247 initPatchFields<volSymmTensorField, processorFvPatchField<symmTensor> >
2251 initPatchFields<volTensorField, processorFvPatchField<tensor> >
2255 initPatchFields<surfaceScalarField, processorFvsPatchField<scalar> >
2259 initPatchFields<surfaceVectorField, processorFvsPatchField<vector> >
2279 initPatchFields<surfaceTensorField, processorFvsPatchField<tensor> >
2285 mesh_.setInstance(mesh_.time().timeName());
2292 printMeshInfo(mesh_);
2293 printFieldInfo<volScalarField>(mesh_);
2294 printFieldInfo<volVectorField>(mesh_);
2295 printFieldInfo<volSphericalTensorField>(mesh_);
2296 printFieldInfo<volSymmTensorField>(mesh_);
2297 printFieldInfo<volTensorField>(mesh_);
2298 printFieldInfo<surfaceScalarField>(mesh_);
2299 printFieldInfo<surfaceVectorField>(mesh_);
2300 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2301 printFieldInfo<surfaceSymmTensorField>(mesh_);
2302 printFieldInfo<surfaceTensorField>(mesh_);
2317 oldPatchNMeshPoints,