69 referPatchID_(referPatchID)
74 if (nbrProc_[a] < nbrProc_[
b])
78 else if (nbrProc_[a] > nbrProc_[
b])
85 return referPatchID_[a] < referPatchID_[
b];
94 void Foam::fvMeshDistribute::inplaceRenumberWithFlip
97 const bool oldToNewHasFlip,
98 const bool lstHasFlip,
102 if (!lstHasFlip && !oldToNewHasFlip)
113 label val = lst[elemI];
129 <<
"Problem : zero value " << val
130 <<
" at index " << elemI <<
" out of " << lst.size()
137 label newVal = oldToNew[val];
153 <<
"Problem : zero value " << newVal
154 <<
" at index " << elemI <<
" out of " 162 lst[elemI] =
sign*(newVal+1);
170 const bool selectEqual,
179 if (selectEqual == (
values[i] == value))
190 if (selectEqual == (
values[i] == value))
207 DynamicList<word> mergedNames;
210 mergedNames = procNames;
215 mergedNames.push_uniq(
name);
227 Pout<<
"Primitives:" <<
nl 237 Pout<<
" " <<
pp.index() <<
" name:" <<
pp.name()
238 <<
" size:" <<
pp.size()
239 <<
" start:" <<
pp.start()
240 <<
" type:" <<
pp.type()
247 Pout<<
" " << zn.index() <<
" name:" << zn.
name()
248 <<
" size:" << zn.size() <<
endl;
254 Pout<<
" " << zn.index() <<
" name:" << zn.
name()
255 <<
" size:" << zn.size() <<
endl;
261 Pout<<
" " << zn.index() <<
" name:" << zn.
name()
262 <<
" size:" << zn.size() <<
endl;
269 const primitiveMesh&
mesh,
277 <<
"Current coupling info:" 280 forAll(sourceFace, bFacei)
284 Pout<<
" meshFace:" << meshFacei
286 <<
" connects to proc:" << sourceProc[bFacei]
287 <<
"/face:" << sourceFace[bFacei]
288 <<
" which will move to proc:" << sourceNewNbrProc[bFacei]
294 Foam::label Foam::fvMeshDistribute::findNonEmptyPatch()
const 298 const polyBoundaryMesh&
patches = mesh_.boundaryMesh();
308 const auto* cpp = isA<cyclicACMIPolyPatch>(
pp);
312 isCoupledPatch.
set(patchi);
313 const label dupPatchID = cpp->nonOverlapPatchID();
314 if (dupPatchID != -1)
316 isCoupledPatch.set(dupPatchID);
319 else if (
pp.coupled())
321 isCoupledPatch.set(patchi);
325 label nonEmptyPatchi = -1;
333 !isA<emptyPolyPatch>(
pp)
334 && !isCoupledPatch(patchi)
335 && !isA<mappedPatchBase>(
pp)
338 nonEmptyPatchi = patchi;
343 if (nonEmptyPatchi == -1)
346 <<
"Cannot find a patch which is not of type empty, mapped or" 348 <<
"There has to be at least one such patch for" 354 Pout<<
"findNonEmptyPatch : using patch " << nonEmptyPatchi
356 <<
" type:" <<
patches[nonEmptyPatchi].type()
357 <<
" to put exposed faces into." <<
endl;
363 label procPatchi = -1;
367 if (isA<processorPolyPatch>(
patches[patchi]))
371 else if (procPatchi != -1)
374 <<
"Processor patches should be at end of patch list." 376 <<
"Have processor patch " << procPatchi
377 <<
" followed by non-processor patch " << patchi
383 return nonEmptyPatchi;
416 fld[facei] = (
n[facei] & testNormal);
429 newPfld[i] = (nBf[patchi][i] & testNormal);
448 scalar
cos = (
n[facei] & testNormal);
454 <<
"On internal face " << facei <<
" at " 456 <<
" the field value is " <<
fld[facei]
457 <<
" whereas cos angle of " << testNormal
458 <<
" with mesh normal " <<
n[facei]
471 scalar
cos = (np[i] & testNormal);
475 label facei = fvp.patch().start()+i;
478 <<
"On face " << facei
479 <<
" on patch " << fvp.patch().name()
481 <<
" the field value is " << fvp[i]
482 <<
" whereas cos angle of " << testNormal
483 <<
" with mesh normal " << np[i]
495 const label destinationPatch
503 labelList newPatchID(mesh_.nBoundaryFaces(), -1);
505 for (
const polyPatch&
pp : mesh_.boundaryMesh())
507 if (isA<processorPolyPatch>(
pp))
511 Pout<<
"Moving all faces of patch " <<
pp.name()
512 <<
" into patch " << destinationPatch
521 ) = destinationPatch;
529 autoPtr<mapPolyMesh> map = repatch(newPatchID, dummyFaceMaps);
537 forAll(mesh_.boundaryMesh(), patchi)
539 if (!isA<processorPolyPatch>(mesh_.boundaryMesh()[patchi]))
541 oldToNew[patchi] = newi++;
544 label nNonProcPatches = newi;
547 forAll(mesh_.boundaryMesh(), patchi)
549 if (isA<processorPolyPatch>(mesh_.boundaryMesh()[patchi]))
551 oldToNew[patchi] = newi++;
567 polyTopoChange meshMod(mesh_);
569 forAll(newPatchID, bFacei)
571 if (newPatchID[bFacei] != -1)
573 label facei = mesh_.nInternalFaces() + bFacei;
575 label zoneID = mesh_.faceZones().whichZone(facei);
576 bool zoneFlip =
false;
580 const faceZone& fZone = mesh_.faceZones()[zoneID];
581 zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
588 mesh_.faces()[facei],
590 mesh_.faceOwner()[facei],
607 PtrList<FieldField<fvsPatchField, scalar>> sFlds;
608 saveBoundaryFields<scalar, surfaceMesh>(sFlds);
609 PtrList<FieldField<fvsPatchField, vector>> vFlds;
610 saveBoundaryFields<vector, surfaceMesh>(vFlds);
611 PtrList<FieldField<fvsPatchField, sphericalTensor>> sptFlds;
612 saveBoundaryFields<sphericalTensor, surfaceMesh>(sptFlds);
613 PtrList<FieldField<fvsPatchField, symmTensor>> sytFlds;
614 saveBoundaryFields<symmTensor, surfaceMesh>(sytFlds);
615 PtrList<FieldField<fvsPatchField, tensor>> tFlds;
616 saveBoundaryFields<tensor, surfaceMesh>(tFlds);
627 const bool oldMoving = mesh_.moving(
false);
628 autoPtr<mapPolyMesh> mapPtr = meshMod.changeMesh(mesh_,
false,
true);
629 mesh_.moving(oldMoving);
630 mapPolyMesh& map = *mapPtr;
634 mesh_.updateMesh(map);
638 mapBoundaryFields<scalar, surfaceMesh>(map, sFlds);
639 mapBoundaryFields<vector, surfaceMesh>(map, vFlds);
640 mapBoundaryFields<sphericalTensor, surfaceMesh>(map, sptFlds);
641 mapBoundaryFields<symmTensor, surfaceMesh>(map, sytFlds);
642 mapBoundaryFields<tensor, surfaceMesh>(map, tFlds);
646 if (map.hasMotionPoints())
648 mesh_.movePoints(map.preMotionPoints());
655 label index = map.reverseFaceMap().find(-1);
660 <<
"reverseFaceMap contains -1 at index:" 662 <<
"This means that the repatch operation was not just" 667 forAll(constructFaceMap, proci)
669 inplaceRenumberWithFlip
671 map.reverseFaceMap(),
674 constructFaceMap[proci]
697 forAll(pointToGlobalMaster, pointi)
699 if (pointToGlobalMaster[pointi] != -1)
707 Pout<<
"mergeSharedPoints : found " << nShared
708 <<
" points on processor boundaries" <<
nl <<
endl;
711 Map<label> globalMasterToLocalMaster(2*nShared);
712 Map<label> pointToMaster(2*nShared);
715 forAll(pointToGlobalMaster, pointi)
717 label globali = pointToGlobalMaster[pointi];
720 const auto iter = globalMasterToLocalMaster.cfind(globali);
725 pointToMaster.insert(pointi, *iter);
731 globalMasterToLocalMaster.insert(globali, pointi);
732 pointToMaster.insert(pointi, pointi);
737 reduce(nMatch, sumOp<label>());
741 Pout<<
"mergeSharedPoints : found " 742 << nMatch <<
" mergeable points" <<
nl <<
endl;
752 polyTopoChange meshMod(mesh_);
760 const bool oldMoving = mesh_.moving(
false);
761 autoPtr<mapPolyMesh> mapPtr = meshMod.changeMesh(mesh_,
false,
true);
762 mesh_.moving(oldMoving);
763 mapPolyMesh& map = *mapPtr;
766 mesh_.updateMesh(map);
769 forAll(constructPointMap, proci)
771 labelList& constructMap = constructPointMap[proci];
775 label oldPointi = constructMap[i];
777 label
newPointi = map.reversePointMap()[oldPointi];
790 <<
"Problem. oldPointi:" << oldPointi
800 void Foam::fvMeshDistribute::getCouplingData
813 const label nBnd = mesh_.nBoundaryFaces();
814 sourceFace.setSize(nBnd);
815 sourceProc.setSize(nBnd);
816 sourcePatch.setSize(nBnd);
817 sourceNewNbrProc.setSize(nBnd);
819 const polyBoundaryMesh&
patches = mesh_.boundaryMesh();
831 label offset =
pp.start() - mesh_.nInternalFaces();
836 label bndI = offset + i;
837 nbrFaces[bndI] =
pp.start()+i;
841 SubList<label>(nbrNewNbrProc,
pp.size(), offset) =
855 label offset =
pp.start() - mesh_.nInternalFaces();
857 if (isA<processorPolyPatch>(
pp))
859 const processorPolyPatch& procPatch =
860 refCast<const processorPolyPatch>(
pp);
864 if (procPatch.owner())
869 label bndI = offset + i;
870 sourceFace[bndI] =
pp.start()+i;
872 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
880 label bndI = offset + i;
881 sourceFace[bndI] = nbrFaces[bndI];
882 sourceProc[bndI] = procPatch.neighbProcNo();
883 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
889 if (isA<processorCyclicPolyPatch>(
pp))
891 patchi = refCast<const processorCyclicPolyPatch>
899 label bndI = offset + i;
900 sourcePatch[bndI] = patchi;
903 else if (isA<cyclicPolyPatch>(
pp))
905 const cyclicPolyPatch& cpp = refCast<const cyclicPolyPatch>(
pp);
911 label bndI = offset + i;
912 sourceFace[bndI] =
pp.start()+i;
914 sourcePatch[bndI] = patchi;
915 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
922 label bndI = offset + i;
923 sourceFace[bndI] = nbrFaces[bndI];
925 sourcePatch[bndI] = patchi;
926 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
935 label bndI = offset + i;
936 sourceFace[bndI] = -1;
937 sourceProc[bndI] = -1;
938 sourcePatch[bndI] = patchi;
939 sourceNewNbrProc[bndI] = -1;
946 sourcePointMaster.resize_nocopy(mesh_.nPoints());
947 sourcePointMaster = -1;
950 const globalIndex globalPoints(mesh_.nPoints());
952 const globalMeshData& gmd = mesh_.globalData();
954 const labelList& meshPoints = cpp.meshPoints();
955 const mapDistribute& slavesMap = gmd.globalCoPointSlavesMap();
958 labelList elems(slavesMap.constructSize(), -1);
959 forAll(meshPoints, pointi)
967 label globalPointi = globalPoints.toGlobal(meshPoints[pointi]);
968 elems[pointi] = globalPointi;
971 label sloti = slots[i];
972 if (sloti >= meshPoints.size())
976 elems[slots[i]] = globalPointi;
983 slavesMap.reverseDistribute(elems.size(), elems,
false);
986 forAll(meshPoints, pointi)
988 sourcePointMaster[meshPoints[pointi]] = elems[pointi];
995 void Foam::fvMeshDistribute::subsetCouplingData
1005 const label oldInternalFaces,
1025 forAll(subFace, newBFacei)
1029 label oldFacei =
faceMap[newFacei];
1032 if (oldFacei < oldInternalFaces)
1034 subFace[newBFacei] = oldFacei;
1036 subPatch[newBFacei] = -1;
1038 label oldOwn = oldFaceOwner[oldFacei];
1039 label oldNei = oldFaceNeighbour[oldFacei];
1044 subNewNbrProc[newBFacei] = oldDistribution[oldNei];
1049 subNewNbrProc[newBFacei] = oldDistribution[oldOwn];
1055 label oldBFacei = oldFacei - oldInternalFaces;
1057 subFace[newBFacei] = sourceFace[oldBFacei];
1058 subProc[newBFacei] = sourceProc[oldBFacei];
1059 subPatch[newBFacei] = sourcePatch[oldBFacei];
1060 subNewNbrProc[newBFacei] = sourceNewNbrProc[oldBFacei];
1065 subPointMaster = UIndirectList<label>(sourcePointMaster, pointMap);
1071 void Foam::fvMeshDistribute::findCouples
1073 const primitiveMesh&
mesh,
1079 const primitiveMesh& domainMesh,
1092 forAll(domainProc, bFacei)
1094 if (domainProc[bFacei] != -1 && domainPatch[bFacei] == -1)
1098 labelPair(domainFace[bFacei], domainProc[bFacei]),
1107 masterCoupledFaces.setSize(domainFace.size());
1108 slaveCoupledFaces.setSize(domainFace.size());
1111 forAll(sourceFace, bFacei)
1113 if (sourceProc[bFacei] != -1 && sourcePatch[bFacei] == -1)
1115 labelPair myData(sourceFace[bFacei], sourceProc[bFacei]);
1117 const auto iter = map.cfind(myData);
1121 label nbrBFacei = *iter;
1124 slaveCoupledFaces[coupledI] =
1125 domainMesh.nInternalFaces()
1133 masterCoupledFaces.setSize(coupledI);
1134 slaveCoupledFaces.setSize(coupledI);
1138 Pout<<
"findCouples : found " << coupledI
1139 <<
" faces that will be stitched" <<
nl <<
endl;
1144 void Foam::fvMeshDistribute::findCouples
1146 const UPtrList<polyMesh>&
meshes,
1147 const PtrList<labelList>& domainSourceFaces,
1148 const PtrList<labelList>& domainSourceProcs,
1149 const PtrList<labelList>& domainSourcePatchs,
1165 const labelList& domainProc = domainSourceProcs[meshi];
1166 const labelList& domainPatch = domainSourcePatchs[meshi];
1168 forAll(domainProc, bFacei)
1170 if (domainProc[bFacei] != -1 && domainPatch[bFacei] == -1)
1172 nProcFaces[meshi]++;
1180 Pout<<
"fvMeshDistribute::findCouples : nProcFaces:" 1194 dynLocalFace[meshi].reserve(nProcFaces[meshi]);
1195 dynRemoteProc[meshi].reserve(nProcFaces[meshi]);
1196 dynRemoteFace[meshi].reserve(nProcFaces[meshi]);
1202 LabelPairMap<labelPair> map(2*
sum(nProcFaces));
1210 const labelList& domainFace = domainSourceFaces[meshi];
1211 const labelList& domainProc = domainSourceProcs[meshi];
1212 const labelList& domainPatch = domainSourcePatchs[meshi];
1214 forAll(domainProc, bFacei)
1216 if (domainProc[bFacei] != -1 && domainPatch[bFacei] == -1)
1223 auto fnd = map.find(
key);
1228 map.emplace(
key, meshi, bFacei);
1233 const label matchProci = fnd().first();
1234 const label matchFacei = fnd().second();
1236 dynLocalFace[meshi].append(bFacei);
1237 dynRemoteProc[meshi].append(matchProci);
1238 dynRemoteFace[meshi].append(matchFacei);
1239 nProcFaces[meshi]++;
1241 dynLocalFace[matchProci].append(matchFacei);
1242 dynRemoteProc[matchProci].append(meshi);
1243 dynRemoteFace[matchProci].append(bFacei);
1244 nProcFaces[matchProci]++;
1253 Pout<<
"fvMeshDistribute::findCouples : stored procFaces:" 1254 << map.size() <<
endl;
1264 localBoundaryFace[meshi] = std::move(dynLocalFace[meshi]);
1265 remoteFaceProc[meshi] = std::move(dynRemoteProc[meshi]);
1266 remoteBoundaryFace[meshi] = std::move(dynRemoteFace[meshi]);
1273 Pout<<
"fvMeshDistribute::findCouples : found matches:" 1282 const primitiveMesh&
mesh,
1283 const mapAddedPolyMesh& map,
1285 const label nInternalFaces1,
1291 forAll(boundaryData0, oldBFacei)
1293 label newFacei = map.oldFaceMap()[oldBFacei + map.nOldInternalFaces()];
1299 boundaryData0[oldBFacei];
1303 forAll(boundaryData1, addedBFacei)
1305 label newFacei = map.addedFaceMap()[addedBFacei + nInternalFaces1];
1310 boundaryData1[addedBFacei];
1314 return newBoundaryData;
1320 const primitiveMesh&
mesh,
1321 const mapAddedPolyMesh& map,
1328 forAll(boundaryData0, oldPointi)
1330 label
newPointi = map.oldPointMap()[oldPointi];
1335 newBoundaryData[
newPointi] = boundaryData0[oldPointi];
1339 forAll(boundaryData1, addedPointi)
1341 label
newPointi = map.addedPointMap()[addedPointi];
1345 newBoundaryData[
newPointi] = boundaryData1[addedPointi];
1349 return newBoundaryData;
1357 const label oldInternalPatchi
1361 polyTopoChange meshMod(mesh_);
1365 removeCells cellRemover(mesh_,
false);
1368 labelList exposedFaces(cellRemover.getExposedFaces(cellsToRemove));
1371 cellRemover.setRefinement
1375 labelList(exposedFaces.size(), oldInternalPatchi),
1386 PtrList<Field<scalar>> sFlds;
1387 saveInternalFields(sFlds);
1388 PtrList<Field<vector>> vFlds;
1389 saveInternalFields(vFlds);
1390 PtrList<Field<sphericalTensor>> sptFlds;
1391 saveInternalFields(sptFlds);
1392 PtrList<Field<symmTensor>> sytFlds;
1393 saveInternalFields(sytFlds);
1394 PtrList<Field<tensor>> tFlds;
1395 saveInternalFields(tFlds);
1401 const bool oldMoving = mesh_.moving(
false);
1402 autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh_,
false,
false);
1403 mesh_.moving(oldMoving);
1406 mesh_.updateMesh(map());
1413 mapExposedFaces(map(), sFlds);
1414 mapExposedFaces(map(), vFlds);
1415 mapExposedFaces(map(), sptFlds);
1416 mapExposedFaces(map(), sytFlds);
1417 mapExposedFaces(map(), tFlds);
1425 if (map().hasMotionPoints())
1427 mesh_.movePoints(map().preMotionPoints());
1437 void Foam::fvMeshDistribute::addProcPatches
1441 List<Map<label>>& procPatchID
1453 sortedOrder(nbrProc, indices, lessProcPatches(nbrProc, referPatchID));
1459 label bFacei = indices[i];
1460 label proci = nbrProc[bFacei];
1464 if (!procPatchID[proci].
found(referPatchID[bFacei]))
1469 if (referPatchID[bFacei] == -1)
1473 processorPolyPatch
pp 1477 mesh_.boundaryMesh().size(),
1478 mesh_.boundaryMesh(),
1483 procPatchID[proci].insert
1485 referPatchID[bFacei],
1498 const coupledPolyPatch& pcPatch
1499 = refCast<const coupledPolyPatch>
1501 mesh_.boundaryMesh()[referPatchID[bFacei]]
1503 processorCyclicPolyPatch
pp 1507 mesh_.boundaryMesh().size(),
1508 mesh_.boundaryMesh(),
1515 procPatchID[proci].insert
1517 referPatchID[bFacei],
1539 const List<Map<label>>& procPatchID
1548 label origPatchi = referPatchID[bFacei];
1551 else if (nbrProc[bFacei] != -1)
1553 label origPatchi = referPatchID[bFacei];
1554 patchIDs[bFacei] = procPatchID[nbrProc[bFacei]][origPatchi];
1566 void Foam::fvMeshDistribute::sendMesh
1585 Pout<<
"Sending to domain " << domain <<
nl 1595 CompactListList<label> zonePoints;
1601 forAll(pointZoneNames, nameI)
1603 label myZoneID = pointZones.findZoneID(pointZoneNames[nameI]);
1607 rowSizes[nameI] = pointZones[myZoneID].size();
1610 zonePoints.setSize(rowSizes);
1612 forAll(pointZoneNames, nameI)
1614 label myZoneID = pointZones.findZoneID(pointZoneNames[nameI]);
1618 zonePoints[nameI].deepCopy(pointZones[myZoneID]);
1624 CompactListList<label> zoneFaces;
1625 CompactListList<bool> zoneFaceFlip;
1631 forAll(faceZoneNames, nameI)
1633 label myZoneID = faceZones.findZoneID(faceZoneNames[nameI]);
1637 rowSizes[nameI] = faceZones[myZoneID].size();
1641 zoneFaces.setSize(rowSizes);
1642 zoneFaceFlip.setSize(rowSizes);
1644 forAll(faceZoneNames, nameI)
1646 label myZoneID = faceZones.findZoneID(faceZoneNames[nameI]);
1650 zoneFaces[nameI].deepCopy(faceZones[myZoneID]);
1651 zoneFaceFlip[nameI].deepCopy(faceZones[myZoneID].flipMap());
1657 CompactListList<label> zoneCells;
1663 forAll(cellZoneNames, nameI)
1665 label myZoneID = cellZones.findZoneID(cellZoneNames[nameI]);
1669 rowSizes[nameI] = cellZones[myZoneID].size();
1673 zoneCells.setSize(rowSizes);
1675 forAll(cellZoneNames, nameI)
1677 label myZoneID = cellZones.findZoneID(cellZoneNames[nameI]);
1681 zoneCells[nameI].deepCopy(cellZones[myZoneID]);
1718 << sourcePointMaster;
1723 Pout<<
"Started sending mesh to domain " << domain
1747 faceList domainFaces = CompactListList<label>(fromNbr).unpack<face>();
1750 PtrList<entry> patchEntries(fromNbr);
1752 CompactListList<label> zonePoints(fromNbr);
1753 CompactListList<label> zoneFaces(fromNbr);
1754 CompactListList<bool> zoneFaceFlip(fromNbr);
1755 CompactListList<label> zoneCells(fromNbr);
1760 >> domainSourcePatch
1761 >> domainSourceNewNbrProc
1762 >> domainSourcePointMaster;
1774 std::move(domainPoints),
1775 std::move(domainFaces),
1776 std::move(domainAllOwner),
1777 std::move(domainAllNeighbour),
1780 fvMesh& domainMesh = *domainMeshPtr;
1784 forAll(patchEntries, patchi)
1791 patchEntries[patchi].keyword(),
1792 patchEntries[patchi].
dict(),
1794 domainMesh.boundaryMesh()
1799 domainMesh.addFvPatches(
patches,
false);
1802 List<pointZone*> pZonePtrs(pointZoneNames.size());
1805 pZonePtrs[i] =
new pointZone
1810 domainMesh.pointZones()
1814 List<faceZone*> fZonePtrs(faceZoneNames.size());
1817 fZonePtrs[i] =
new faceZone
1823 domainMesh.faceZones()
1827 List<cellZone*> cZonePtrs(cellZoneNames.size());
1830 cZonePtrs[i] =
new cellZone
1835 domainMesh.cellZones()
1838 domainMesh.addZones(pZonePtrs, fZonePtrs, cZonePtrs);
1840 return domainMeshPtr;
1846 Foam::fvMeshDistribute::fvMeshDistribute(
fvMesh&
mesh)
1869 <<
"At index " << celli <<
" distribution:" << newProc
1887 <<
"Size of distribution:" 1893 const polyBoundaryMesh&
patches = mesh_.boundaryMesh();
1899 <<
"This application requires all non-processor patches" 1900 <<
" to be present in the same order on all patches" <<
nl 1901 <<
"followed by the processor patches (which of course are unique)." 1903 <<
"Local patches:" << mesh_.boundaryMesh().names()
1908 const label nOldPoints(mesh_.nPoints());
1909 const label nOldFaces(mesh_.nFaces());
1910 const label nOldCells(mesh_.nCells());
1916 oldPatchNMeshPoints[patchi] =
patches[patchi].nPoints();
1932 std::move(oldPatchStarts),
1933 std::move(oldPatchNMeshPoints),
1951 const wordList pointZoneNames(mergeWordList(mesh_.pointZones().names()));
1952 reorderZones<pointZone>(pointZoneNames, mesh_.pointZones());
1954 const wordList faceZoneNames(mergeWordList(mesh_.faceZones().names()));
1955 reorderZones<faceZone>(faceZoneNames, mesh_.faceZones());
1957 const wordList cellZoneNames(mergeWordList(mesh_.cellZones().names()));
1958 reorderZones<cellZone>(cellZoneNames, mesh_.cellZones());
2021 mesh_.resetMotion();
2025 HashTable<wordList> allFieldNames;
2027 getFieldNames<volScalarField>(mesh_, allFieldNames);
2028 getFieldNames<volVectorField>(mesh_, allFieldNames);
2029 getFieldNames<volSphericalTensorField>(mesh_, allFieldNames);
2030 getFieldNames<volSymmTensorField>(mesh_, allFieldNames);
2031 getFieldNames<volTensorField>(mesh_, allFieldNames);
2033 getFieldNames<surfaceScalarField>(mesh_, allFieldNames);
2034 getFieldNames<surfaceVectorField>(mesh_, allFieldNames);
2035 getFieldNames<surfaceSphericalTensorField>(mesh_, allFieldNames);
2036 getFieldNames<surfaceSymmTensorField>(mesh_, allFieldNames);
2037 getFieldNames<surfaceTensorField>(mesh_, allFieldNames);
2039 getFieldNames<volScalarField::Internal>
2045 getFieldNames<volVectorField::Internal>
2051 getFieldNames<volSphericalTensorField::Internal>
2057 getFieldNames<volSymmTensorField::Internal>
2063 getFieldNames<volTensorField::Internal>
2072 const label oldInternalPatchi = findNonEmptyPatch();
2079 autoPtr<mapPolyMesh> repatchMap = deleteProcPatches(oldInternalPatchi);
2082 repatchFaceMap = repatchMap().faceMap();
2089 repatchMap().reverseFaceMap(),
2090 mesh_.nBoundaryFaces(),
2091 mesh_.nInternalFaces()
2093 - mesh_.nInternalFaces()
2107 Pout<<
nl <<
"MESH WITH PROC PATCHES DELETED:" <<
endl;
2108 printMeshInfo(mesh_);
2109 printFieldInfo<volScalarField>(mesh_);
2110 printFieldInfo<volVectorField>(mesh_);
2111 printFieldInfo<volSphericalTensorField>(mesh_);
2112 printFieldInfo<volSymmTensorField>(mesh_);
2113 printFieldInfo<volTensorField>(mesh_);
2114 printFieldInfo<surfaceScalarField>(mesh_);
2115 printFieldInfo<surfaceVectorField>(mesh_);
2116 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2117 printFieldInfo<surfaceSymmTensorField>(mesh_);
2118 printFieldInfo<surfaceTensorField>(mesh_);
2119 printIntFieldInfo<volScalarField::Internal>(mesh_);
2120 printIntFieldInfo<volVectorField::Internal>(mesh_);
2121 printIntFieldInfo<volSphericalTensorField::Internal>(mesh_);
2122 printIntFieldInfo<volSymmTensorField::Internal>(mesh_);
2123 printIntFieldInfo<volTensorField::Internal>(mesh_);
2144 labelList nSendCells(countCells(distribution));
2158 forAll(nSendCells, recvProc)
2167 <<
"SUBSETTING FOR DOMAIN " << recvProc
2168 <<
" cells to send:" 2169 << nSendCells[recvProc]
2175 UOPstream str(recvProc, pBufs);
2178 fvMeshSubset subsetter
2187 subCellMap[recvProc] = subsetter.cellMap();
2188 subFaceMap[recvProc] = subsetter.faceFlipMap();
2189 inplaceRenumberWithFlip
2194 subFaceMap[recvProc]
2196 subPointMap[recvProc] = subsetter.pointMap();
2197 subPatchMap[recvProc] = subsetter.patchMap();
2209 subsetter.subMesh(),
2210 subsetter.pointMap(),
2211 subsetter.faceMap(),
2212 subsetter.cellMap(),
2216 mesh_.faceNeighbour(),
2217 mesh_.nInternalFaces(),
2228 procSourceNewNbrProc,
2229 procSourcePointMaster
2237 subsetter.subMesh(),
2246 procSourceNewNbrProc,
2247 procSourcePointMaster,
2253 sendFields<volScalarField>
2260 sendFields<volVectorField>
2267 sendFields<volSphericalTensorField>
2274 sendFields<volSymmTensorField>
2281 sendFields<volTensorField>
2290 sendFields<surfaceScalarField>
2297 sendFields<surfaceVectorField>
2304 sendFields<surfaceSphericalTensorField>
2311 sendFields<surfaceSymmTensorField>
2318 sendFields<surfaceTensorField>
2327 sendFields<volScalarField::Internal>
2334 sendFields<volVectorField::Internal>
2341 sendFields<volSphericalTensorField::Internal>
2348 sendFields<volSymmTensorField::Internal>
2355 sendFields<volTensorField::Internal>
2373 pBufs.finishedSends();
2377 Pout<<
"Finished sending and receiving : " 2387 const labelList oldFaceOwner(mesh_.faceOwner());
2388 const labelList oldFaceNeighbour(mesh_.faceNeighbour());
2389 const label oldInternalFaces = mesh_.nInternalFaces();
2392 autoPtr<mapPolyMesh> subMap
2415 for (
const label facei : flip)
2432 subMap().pointMap(),
2450 domainSourceNewNbrProc,
2451 domainSourcePointMaster
2454 sourceFace.transfer(domainSourceFace);
2455 sourceProc.transfer(domainSourceProc);
2456 sourcePatch.transfer(domainSourcePatch);
2457 sourceNewNbrProc.transfer(domainSourceNewNbrProc);
2458 sourcePointMaster.transfer(domainSourcePointMaster);
2466 printMeshInfo(mesh_);
2467 printFieldInfo<volScalarField>(mesh_);
2468 printFieldInfo<volVectorField>(mesh_);
2469 printFieldInfo<volSphericalTensorField>(mesh_);
2470 printFieldInfo<volSymmTensorField>(mesh_);
2471 printFieldInfo<volTensorField>(mesh_);
2472 printFieldInfo<surfaceScalarField>(mesh_);
2473 printFieldInfo<surfaceVectorField>(mesh_);
2474 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2475 printFieldInfo<surfaceSymmTensorField>(mesh_);
2476 printFieldInfo<surfaceTensorField>(mesh_);
2477 printIntFieldInfo<volScalarField::Internal>(mesh_);
2478 printIntFieldInfo<volVectorField::Internal>(mesh_);
2479 printIntFieldInfo<volSphericalTensorField::Internal>(mesh_);
2480 printIntFieldInfo<volSymmTensorField::Internal>(mesh_);
2481 printIntFieldInfo<volTensorField::Internal>(mesh_);
2503 #define doLocalCode(FieldType, Variable) \ 2504 PtrList<PtrList<FieldType>> Variable(UPstream::nProcs()); 2527 forAll(nRecvCells, sendProc)
2535 <<
"RECEIVING FROM DOMAIN " << sendProc
2536 <<
" cells to receive:" 2537 << nRecvCells[sendProc]
2543 UIPstream str(sendProc, pBufs);
2548 autoPtr<fvMesh> domainMeshPtr = receiveMesh
2555 const_cast<Time&>(mesh_.time()),
2557 domainSourceFaces.emplace_set(sendProc),
2558 domainSourceProcs.emplace_set(sendProc),
2559 domainSourcePatchs.emplace_set(sendProc),
2560 domainSourceNewNbrProcs.emplace_set(sendProc),
2561 domainSourcePointMasters.emplace_set(sendProc),
2564 domainMeshPtrs.set(sendProc, std::move(domainMeshPtr));
2565 fvMesh& domainMesh = domainMeshPtrs[sendProc];
2575 #define doLocalCode(FieldType, Variable) \ 2576 receiveFields<FieldType> \ 2581 Variable.emplace_set(sendProc), \ 2616 UPtrList<polyMesh>
meshes(domainMeshPtrs.size());
2617 UPtrList<fvMesh> fvMeshes(domainMeshPtrs.size());
2618 forAll(domainMeshPtrs, proci)
2620 if (domainMeshPtrs.set(proci))
2622 meshes.
set(proci, &domainMeshPtrs[proci]);
2623 fvMeshes.
set(proci, &domainMeshPtrs[proci]);
2661 const label nOldInternalFaces = mesh_.nInternalFaces();
2662 const labelList oldFaceOwner(mesh_.faceOwner());
2666 const bool oldMoving = mesh_.moving(
false);
2685 mesh_.moving(oldMoving);
2691 printMeshInfo(mesh_);
2692 printFieldInfo<volScalarField>(mesh_);
2693 printFieldInfo<volVectorField>(mesh_);
2694 printFieldInfo<volSphericalTensorField>(mesh_);
2695 printFieldInfo<volSymmTensorField>(mesh_);
2696 printFieldInfo<volTensorField>(mesh_);
2697 printFieldInfo<surfaceScalarField>(mesh_);
2698 printFieldInfo<surfaceVectorField>(mesh_);
2699 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2700 printFieldInfo<surfaceSymmTensorField>(mesh_);
2701 printFieldInfo<surfaceTensorField>(mesh_);
2702 printIntFieldInfo<volScalarField::Internal>(mesh_);
2703 printIntFieldInfo<volVectorField::Internal>(mesh_);
2704 printIntFieldInfo<volSphericalTensorField::Internal>(mesh_);
2705 printIntFieldInfo<volSymmTensorField::Internal>(mesh_);
2706 printIntFieldInfo<volTensorField::Internal>(mesh_);
2712 sourceProc.resize_nocopy(mesh_.nBoundaryFaces());
2714 sourcePatch.resize_nocopy(mesh_.nBoundaryFaces());
2716 sourceFace.resize_nocopy(mesh_.nBoundaryFaces());
2718 sourceNewNbrProc.resize_nocopy(mesh_.nBoundaryFaces());
2719 sourceNewNbrProc = -1;
2720 sourcePointMaster.resize_nocopy(mesh_.nPoints());
2721 sourcePointMaster = -1;
2723 if (mesh_.nPoints() > 0)
2727 if (domainSourceFaces.set(meshi))
2729 const label nIntFaces =
2733 :
meshes[meshi].nInternalFaces()
2739 :
meshes[meshi].faceOwner()
2743 const labelList& cellMap = constructCellMap[meshi];
2746 domainSourceFaces[meshi];
2748 domainSourceProcs[meshi];
2750 domainSourcePatchs[meshi];
2752 domainSourceNewNbrProcs[meshi];
2753 UIndirectList<label>
2756 constructPointMap[meshi]
2757 ) = domainSourcePointMasters[meshi];
2760 forAll(domainSourceFace, bFacei)
2762 const label oldFacei = bFacei+nIntFaces;
2763 const label allFacei =
faceMap[oldFacei];
2764 const label allbFacei = allFacei-mesh_.nInternalFaces();
2768 sourceProc[allbFacei] = domainSourceProc[bFacei];
2769 sourcePatch[allbFacei] = domainSourcePatch[bFacei];
2770 sourceFace[allbFacei] = domainSourceFace[bFacei];
2771 sourceNewNbrProc[allbFacei] =
2772 domainSourceNewNbr[bFacei];
2780 const label allFacei =
faceMap[oldFacei];
2781 const label allOwn = mesh_.faceOwner()[allFacei];
2783 if (cellMap[faceOwner[oldFacei]] == allOwn)
2807 printMeshInfo(mesh_);
2808 printFieldInfo<volScalarField>(mesh_);
2809 printFieldInfo<volVectorField>(mesh_);
2810 printFieldInfo<volSphericalTensorField>(mesh_);
2811 printFieldInfo<volSymmTensorField>(mesh_);
2812 printFieldInfo<volTensorField>(mesh_);
2813 printFieldInfo<surfaceScalarField>(mesh_);
2814 printFieldInfo<surfaceVectorField>(mesh_);
2815 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2816 printFieldInfo<surfaceSymmTensorField>(mesh_);
2817 printFieldInfo<surfaceTensorField>(mesh_);
2818 printIntFieldInfo<volScalarField::Internal>(mesh_);
2819 printIntFieldInfo<volVectorField::Internal>(mesh_);
2820 printIntFieldInfo<volSphericalTensorField::Internal>(mesh_);
2821 printIntFieldInfo<volSymmTensorField::Internal>(mesh_);
2822 printIntFieldInfo<volTensorField::Internal>(mesh_);
2829 mergeSharedPoints(sourcePointMaster, constructPointMap);
2838 List<Map<label>> procPatchID;
2841 addProcPatches(sourceNewNbrProc, sourcePatch, procPatchID);
2860 repatch(newPatchID, constructFaceMap);
2864 initPatchFields<volScalarField, processorFvPatchField<scalar>>
2868 initPatchFields<volVectorField, processorFvPatchField<vector>>
2875 processorFvPatchField<sphericalTensor>
2880 initPatchFields<volSymmTensorField, processorFvPatchField<symmTensor>>
2884 initPatchFields<volTensorField, processorFvPatchField<tensor>>
2890 mesh_.setInstance(mesh_.time().timeName());
2897 printMeshInfo(mesh_);
2898 printFieldInfo<volScalarField>(mesh_);
2899 printFieldInfo<volVectorField>(mesh_);
2900 printFieldInfo<volSphericalTensorField>(mesh_);
2901 printFieldInfo<volSymmTensorField>(mesh_);
2902 printFieldInfo<volTensorField>(mesh_);
2903 printFieldInfo<surfaceScalarField>(mesh_);
2904 printFieldInfo<surfaceVectorField>(mesh_);
2905 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2906 printFieldInfo<surfaceSymmTensorField>(mesh_);
2907 printFieldInfo<surfaceTensorField>(mesh_);
2908 printIntFieldInfo<volScalarField::Internal>(mesh_);
2909 printIntFieldInfo<volVectorField::Internal>(mesh_);
2910 printIntFieldInfo<volSphericalTensorField::Internal>(mesh_);
2911 printIntFieldInfo<volSymmTensorField::Internal>(mesh_);
2912 printIntFieldInfo<volTensorField::Internal>(mesh_);
2924 std::move(oldPatchStarts),
2925 std::move(oldPatchNMeshPoints),
2927 std::move(subPointMap),
2928 std::move(subFaceMap),
2929 std::move(subCellMap),
2930 std::move(subPatchMap),
2932 std::move(constructPointMap),
2933 std::move(constructFaceMap),
2934 std::move(constructCellMap),
2935 std::move(constructPatchMap),
dimensionedScalar sign(const dimensionedScalar &ds)
fvsPatchField< vector > fvsPatchVectorField
const labelList patchIDs(pbm.indices(polyPatchNames, true))
fvsPatchField< scalar > fvsPatchScalarField
GeometricField< symmTensor, fvPatchField, volMesh > volSymmTensorField
ZoneMesh< faceZone, polyMesh > faceZoneMesh
A ZoneMesh with the type faceZone.
const surfaceVectorField & Sf() const
Return cell face area vectors.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1)
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
List of names generated by calling name() for each list item and filtered for matches.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label nPoints() const noexcept
Number of mesh points.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual const labelList & faceNeighbour() const
Return face neighbour.
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
const word & name() const noexcept
Return the object name.
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
GeometricField< tensor, fvPatchField, volMesh > volTensorField
IntListType renumber(const labelUList &oldToNew, const IntListType &input)
Renumber the values (not the indices) of a list.
List< bool > select(const label n, const labelUList &locations)
Construct a selection list of bools (all false) with the given pre-size, subsequently add specified l...
constexpr char nl
The newline '\n' character (0x0a)
void inplaceReorder(const labelUList &oldToNew, ListType &input, const bool prune=false)
Inplace reorder the elements of a list.
label start() const noexcept
The start label of boundary faces in the polyMesh face list.
UIndirectList< label > labelUIndList
UIndirectList of labels.
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
GeometricField< sphericalTensor, fvsPatchField, surfaceMesh > surfaceSphericalTensorField
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bool & parRun() noexcept
Test if this a parallel run.
Less function class that can be used for sorting processor patches.
A bounding box defined in terms of min/max extrema points.
static CompactListList< T > pack(const UList< SubListType > &lists, const bool checkOverflow=false)
Construct by packing together the list of lists.
GeometricBoundaryField< scalar, fvsPatchField, surfaceMesh > Boundary
Type of boundary fields.
Ignore writing from objectRegistry::writeObject()
quaternion normalised(const quaternion &q)
Return the normalised (unit) quaternion of the given quaternion.
const dimensionSet dimless
Dimensionless.
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
const Time & time() const
Return the top-level database.
label nFaces() const noexcept
Number of mesh faces.
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
A PrimitivePatch with an IndirectList for the faces, const reference for the point field...
GeometricField< vector, fvPatchField, volMesh > volVectorField
virtual const fileName & name() const override
Get the name of the output serial stream. (eg, the name of the Fstream file name) ...
List< labelList > labelListList
List of labelList.
DimensionedField< scalar, volMesh > Internal
The internal field type from which this GeometricField is derived.
#define doLocalCode(FieldType, Variable)
GeometricField< sphericalTensor, fvPatchField, volMesh > volSphericalTensorField
UList< label > labelUList
A UList of labels.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
static void broadcast(Type &value, const label comm=UPstream::worldComm)
Broadcast content (contiguous or non-contiguous) to all communicator ranks. Does nothing in non-paral...
Various functions to operate on Lists.
virtual const pointField & points() const
Return raw points.
#define forAll(list, i)
Loop across all elements in list.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
static const char *const typeName
Typename for Field.
List< face > faceList
List of faces.
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
PtrList< polyPatch > polyPatchList
Store lists of polyPatch as a PtrList.
label size() const noexcept
The number of elements in table.
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator). It is 1 for serial run. ...
Sends/receives parts of mesh+fvfields to neighbouring processors. Used in load balancing.
vectorField pointField
pointField is a vectorField.
static void gatherList(const List< commsStruct > &comms, List< T > &values, const int tag, const label comm)
Gather data, but keep individual values separate. Uses the specified communication schedule...
const dimensionedScalar e
Elementary charge.
dimensionedScalar cos(const dimensionedScalar &ds)
GeometricField< symmTensor, fvsPatchField, surfaceMesh > surfaceSymmTensorField
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
bool operator()(const label a, const label b)
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i), works like std::iota() but returning a...
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
static void mergePoints(const polyMesh &, const Map< label > &pointToMaster, polyTopoChange &meshMod)
Helper: Merge points.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
static word defaultRegion
Return the default region name.
wordList names() const
Return a list of patch names.
label size() const noexcept
The number of entries in the list.
GeometricField< tensor, fvsPatchField, surfaceMesh > surfaceTensorField
Foam::PtrList< Foam::fvMesh > meshes(regionNames.size())
static autoPtr< mapAddedPolyMesh > add(fvMesh &mesh0, const fvMesh &mesh1, const faceCoupleInfo &coupleInfo, const bool validBoundary=true, const bool fullyMapped=false)
Inplace add mesh to fvMesh. Maps all stored fields. Returns map.
virtual const labelList & faceOwner() const
Return face owner.
label nInternalFaces() const noexcept
Number of internal faces.
ZoneMesh< pointZone, polyMesh > pointZoneMesh
A ZoneMesh with the type pointZone.
virtual const faceList & faces() const
Return raw faces.
Accumulating histogram of values. Specified bin resolution automatic generation of bins...
errorManip< error > abort(error &err)
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie...
A HashTable to objects of type <T> with a labelPair key. The hashing is based on labelPair (FixedList...
const surfaceScalarField & magSf() const
Return cell face area magnitudes.
bool checkParallelSync(const bool report=false) const
Check whether all procs have all patches and in same order.
static void allToAll(const UList< int32_t > &sendData, UList< int32_t > &recvData, const label communicator=worldComm)
Exchange int32_t data with all ranks in communicator.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value formatted with the given precision.
int debug
Static debugging option.
Pair< label > labelPair
A pair of labels.
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
defineTypeNameAndDebug(combustionModel, 0)
autoPtr< mapDistributePolyMesh > distribute(const labelList &dist)
Send cells to neighbours according to distribution.
const word typeName("volScalarField::Internal")
static void printMeshInfo(const polyMesh &)
Print some info on mesh.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const vectorField & faceCentres() const
bool empty() const noexcept
True if the list is empty (ie, size() is zero)
const pointZoneMesh & pointZones() const noexcept
Return point zone mesh.
List< word > wordList
List of word.
void inplaceRenumber(const labelUList &oldToNew, IntListType &input)
Inplace renumber the values (not the indices) of a list.
static tmp< surfaceScalarField > generateTestField(const fvMesh &)
Generate a test field on faces.
#define WarningInFunction
Report a warning using Foam::Warning.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
label nCells() const noexcept
Number of mesh cells.
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
static void printCoupleInfo(const primitiveMesh &, const labelList &, const labelList &, const labelList &, const labelList &)
Print some info on coupling data.
Mesh data needed to do the Finite Volume discretisation.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
const polyBoundaryMesh & patches
lessProcPatches(const labelList &nbrProc, const labelList &referPatchID)
HashTable< label, labelPair, Foam::Hash< labelPair > > labelPairLookup
This is a Map of a labelPair to a label. Used for e.g. for face1, face2 to shared edge...
const cellZoneMesh & cellZones() const noexcept
Return cell zone mesh.
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
Reduce inplace (cf. MPI Allreduce) using specified communication schedule.
"nonBlocking" : (MPI_Isend, MPI_Irecv)
static autoPtr< polyPatch > New(const word &patchType, const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm)
Return pointer to a new patch created on freestore from components.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Mesh consisting of general polyhedral cells.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
List< label > labelList
A List of labels.
A class for managing temporary objects.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
A patch is a list of labels that address the faces in the global face list.
label nBoundaryFaces() const noexcept
Number of boundary faces (== nFaces - nInternalFaces)
static labelList countCells(const labelList &)
Helper function: count cells per processor in wanted distribution.
static void testField(const surfaceScalarField &)
Check whether field consistent with face orientation.
Defines the attributes of an object for which implicit objectRegistry management is supported...
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
ZoneMesh< cellZone, polyMesh > cellZoneMesh
A ZoneMesh with the type cellZone.
bool set(const Key &key, const T &obj)
Copy assign a new entry, overwriting existing entries.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
static constexpr const zero Zero
Global zero (0)