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());
2028 mesh_.resetMotion();
2032 HashTable<wordList> allFieldNames;
2034 getFieldNames<volScalarField>(mesh_, allFieldNames);
2035 getFieldNames<volVectorField>(mesh_, allFieldNames);
2036 getFieldNames<volSphericalTensorField>(mesh_, allFieldNames);
2037 getFieldNames<volSymmTensorField>(mesh_, allFieldNames);
2038 getFieldNames<volTensorField>(mesh_, allFieldNames);
2040 getFieldNames<surfaceScalarField>(mesh_, allFieldNames);
2041 getFieldNames<surfaceVectorField>(mesh_, allFieldNames);
2042 getFieldNames<surfaceSphericalTensorField>(mesh_, allFieldNames);
2043 getFieldNames<surfaceSymmTensorField>(mesh_, allFieldNames);
2044 getFieldNames<surfaceTensorField>(mesh_, allFieldNames);
2046 getFieldNames<volScalarField::Internal>
2052 getFieldNames<volVectorField::Internal>
2058 getFieldNames<volSphericalTensorField::Internal>
2064 getFieldNames<volSymmTensorField::Internal>
2070 getFieldNames<volTensorField::Internal>
2079 const label oldInternalPatchi = findNonEmptyPatch();
2086 autoPtr<mapPolyMesh> repatchMap = deleteProcPatches(oldInternalPatchi);
2089 repatchFaceMap = repatchMap().faceMap();
2096 repatchMap().reverseFaceMap(),
2097 mesh_.nBoundaryFaces(),
2098 mesh_.nInternalFaces()
2100 - mesh_.nInternalFaces()
2114 Pout<<
nl <<
"MESH WITH PROC PATCHES DELETED:" <<
endl;
2115 printMeshInfo(mesh_);
2116 printFieldInfo<volScalarField>(mesh_);
2117 printFieldInfo<volVectorField>(mesh_);
2118 printFieldInfo<volSphericalTensorField>(mesh_);
2119 printFieldInfo<volSymmTensorField>(mesh_);
2120 printFieldInfo<volTensorField>(mesh_);
2121 printFieldInfo<surfaceScalarField>(mesh_);
2122 printFieldInfo<surfaceVectorField>(mesh_);
2123 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2124 printFieldInfo<surfaceSymmTensorField>(mesh_);
2125 printFieldInfo<surfaceTensorField>(mesh_);
2126 printIntFieldInfo<volScalarField::Internal>(mesh_);
2127 printIntFieldInfo<volVectorField::Internal>(mesh_);
2128 printIntFieldInfo<volSphericalTensorField::Internal>(mesh_);
2129 printIntFieldInfo<volSymmTensorField::Internal>(mesh_);
2130 printIntFieldInfo<volTensorField::Internal>(mesh_);
2151 labelList nSendCells(countCells(distribution));
2156 PstreamBuffers pBufs;
2165 forAll(nSendCells, recvProc)
2174 <<
"SUBSETTING FOR DOMAIN " << recvProc
2175 <<
" cells to send:" 2176 << nSendCells[recvProc]
2181 UOPstream str(recvProc, pBufs);
2184 fvMeshSubset subsetter
2193 subCellMap[recvProc] = subsetter.cellMap();
2194 subFaceMap[recvProc] = subsetter.faceFlipMap();
2195 inplaceRenumberWithFlip
2200 subFaceMap[recvProc]
2202 subPointMap[recvProc] = subsetter.pointMap();
2203 subPatchMap[recvProc] = subsetter.patchMap();
2215 subsetter.subMesh(),
2216 subsetter.pointMap(),
2217 subsetter.faceMap(),
2218 subsetter.cellMap(),
2222 mesh_.faceNeighbour(),
2223 mesh_.nInternalFaces(),
2234 procSourceNewNbrProc,
2235 procSourcePointMaster
2243 subsetter.subMesh(),
2252 procSourceNewNbrProc,
2253 procSourcePointMaster,
2259 sendFields<volScalarField>
2266 sendFields<volVectorField>
2273 sendFields<volSphericalTensorField>
2280 sendFields<volSymmTensorField>
2287 sendFields<volTensorField>
2296 sendFields<surfaceScalarField>
2303 sendFields<surfaceVectorField>
2310 sendFields<surfaceSphericalTensorField>
2317 sendFields<surfaceSymmTensorField>
2324 sendFields<surfaceTensorField>
2333 sendFields<volScalarField::Internal>
2340 sendFields<volVectorField::Internal>
2347 sendFields<volSphericalTensorField::Internal>
2354 sendFields<volSymmTensorField::Internal>
2361 sendFields<volTensorField::Internal>
2379 pBufs.finishedSends();
2383 Pout<<
"Finished sending and receiving : " 2393 const labelList oldFaceOwner(mesh_.faceOwner());
2394 const labelList oldFaceNeighbour(mesh_.faceNeighbour());
2395 const label oldInternalFaces = mesh_.nInternalFaces();
2398 autoPtr<mapPolyMesh> subMap
2421 for (
const label facei : flip)
2438 subMap().pointMap(),
2456 domainSourceNewNbrProc,
2457 domainSourcePointMaster
2460 sourceFace.transfer(domainSourceFace);
2461 sourceProc.transfer(domainSourceProc);
2462 sourcePatch.transfer(domainSourcePatch);
2463 sourceNewNbrProc.transfer(domainSourceNewNbrProc);
2464 sourcePointMaster.transfer(domainSourcePointMaster);
2472 printMeshInfo(mesh_);
2473 printFieldInfo<volScalarField>(mesh_);
2474 printFieldInfo<volVectorField>(mesh_);
2475 printFieldInfo<volSphericalTensorField>(mesh_);
2476 printFieldInfo<volSymmTensorField>(mesh_);
2477 printFieldInfo<volTensorField>(mesh_);
2478 printFieldInfo<surfaceScalarField>(mesh_);
2479 printFieldInfo<surfaceVectorField>(mesh_);
2480 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2481 printFieldInfo<surfaceSymmTensorField>(mesh_);
2482 printFieldInfo<surfaceTensorField>(mesh_);
2483 printIntFieldInfo<volScalarField::Internal>(mesh_);
2484 printIntFieldInfo<volVectorField::Internal>(mesh_);
2485 printIntFieldInfo<volSphericalTensorField::Internal>(mesh_);
2486 printIntFieldInfo<volSymmTensorField::Internal>(mesh_);
2487 printIntFieldInfo<volTensorField::Internal>(mesh_);
2509 #define doLocalCode(FieldType, Variable) \ 2510 PtrList<PtrList<FieldType>> Variable(UPstream::nProcs()); 2533 forAll(nRecvCells, sendProc)
2541 <<
"RECEIVING FROM DOMAIN " << sendProc
2542 <<
" cells to receive:" 2543 << nRecvCells[sendProc]
2549 UIPstream str(sendProc, pBufs);
2554 autoPtr<fvMesh> domainMeshPtr = receiveMesh
2561 const_cast<Time&>(mesh_.time()),
2563 domainSourceFaces.emplace_set(sendProc),
2564 domainSourceProcs.emplace_set(sendProc),
2565 domainSourcePatchs.emplace_set(sendProc),
2566 domainSourceNewNbrProcs.emplace_set(sendProc),
2567 domainSourcePointMasters.emplace_set(sendProc),
2570 domainMeshPtrs.set(sendProc, std::move(domainMeshPtr));
2571 fvMesh& domainMesh = domainMeshPtrs[sendProc];
2581 #define doLocalCode(FieldType, Variable) \ 2582 receiveFields<FieldType> \ 2587 Variable.emplace_set(sendProc), \ 2622 UPtrList<polyMesh>
meshes(domainMeshPtrs.size());
2623 UPtrList<fvMesh> fvMeshes(domainMeshPtrs.size());
2624 forAll(domainMeshPtrs, proci)
2626 if (domainMeshPtrs.set(proci))
2628 meshes.
set(proci, &domainMeshPtrs[proci]);
2629 fvMeshes.
set(proci, &domainMeshPtrs[proci]);
2667 const label nOldInternalFaces = mesh_.nInternalFaces();
2668 const labelList oldFaceOwner(mesh_.faceOwner());
2672 const bool oldMoving = mesh_.moving(
false);
2691 mesh_.moving(oldMoving);
2697 printMeshInfo(mesh_);
2698 printFieldInfo<volScalarField>(mesh_);
2699 printFieldInfo<volVectorField>(mesh_);
2700 printFieldInfo<volSphericalTensorField>(mesh_);
2701 printFieldInfo<volSymmTensorField>(mesh_);
2702 printFieldInfo<volTensorField>(mesh_);
2703 printFieldInfo<surfaceScalarField>(mesh_);
2704 printFieldInfo<surfaceVectorField>(mesh_);
2705 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2706 printFieldInfo<surfaceSymmTensorField>(mesh_);
2707 printFieldInfo<surfaceTensorField>(mesh_);
2708 printIntFieldInfo<volScalarField::Internal>(mesh_);
2709 printIntFieldInfo<volVectorField::Internal>(mesh_);
2710 printIntFieldInfo<volSphericalTensorField::Internal>(mesh_);
2711 printIntFieldInfo<volSymmTensorField::Internal>(mesh_);
2712 printIntFieldInfo<volTensorField::Internal>(mesh_);
2718 sourceProc.resize_nocopy(mesh_.nBoundaryFaces());
2720 sourcePatch.resize_nocopy(mesh_.nBoundaryFaces());
2722 sourceFace.resize_nocopy(mesh_.nBoundaryFaces());
2724 sourceNewNbrProc.resize_nocopy(mesh_.nBoundaryFaces());
2725 sourceNewNbrProc = -1;
2726 sourcePointMaster.resize_nocopy(mesh_.nPoints());
2727 sourcePointMaster = -1;
2729 if (mesh_.nPoints() > 0)
2733 if (domainSourceFaces.set(meshi))
2735 const label nIntFaces =
2739 :
meshes[meshi].nInternalFaces()
2745 :
meshes[meshi].faceOwner()
2749 const labelList& cellMap = constructCellMap[meshi];
2752 domainSourceFaces[meshi];
2754 domainSourceProcs[meshi];
2756 domainSourcePatchs[meshi];
2758 domainSourceNewNbrProcs[meshi];
2759 UIndirectList<label>
2762 constructPointMap[meshi]
2763 ) = domainSourcePointMasters[meshi];
2766 forAll(domainSourceFace, bFacei)
2768 const label oldFacei = bFacei+nIntFaces;
2769 const label allFacei =
faceMap[oldFacei];
2770 const label allbFacei = allFacei-mesh_.nInternalFaces();
2774 sourceProc[allbFacei] = domainSourceProc[bFacei];
2775 sourcePatch[allbFacei] = domainSourcePatch[bFacei];
2776 sourceFace[allbFacei] = domainSourceFace[bFacei];
2777 sourceNewNbrProc[allbFacei] =
2778 domainSourceNewNbr[bFacei];
2786 const label allFacei =
faceMap[oldFacei];
2787 const label allOwn = mesh_.faceOwner()[allFacei];
2789 if (cellMap[faceOwner[oldFacei]] == allOwn)
2813 printMeshInfo(mesh_);
2814 printFieldInfo<volScalarField>(mesh_);
2815 printFieldInfo<volVectorField>(mesh_);
2816 printFieldInfo<volSphericalTensorField>(mesh_);
2817 printFieldInfo<volSymmTensorField>(mesh_);
2818 printFieldInfo<volTensorField>(mesh_);
2819 printFieldInfo<surfaceScalarField>(mesh_);
2820 printFieldInfo<surfaceVectorField>(mesh_);
2821 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2822 printFieldInfo<surfaceSymmTensorField>(mesh_);
2823 printFieldInfo<surfaceTensorField>(mesh_);
2824 printIntFieldInfo<volScalarField::Internal>(mesh_);
2825 printIntFieldInfo<volVectorField::Internal>(mesh_);
2826 printIntFieldInfo<volSphericalTensorField::Internal>(mesh_);
2827 printIntFieldInfo<volSymmTensorField::Internal>(mesh_);
2828 printIntFieldInfo<volTensorField::Internal>(mesh_);
2835 mergeSharedPoints(sourcePointMaster, constructPointMap);
2844 List<Map<label>> procPatchID;
2847 addProcPatches(sourceNewNbrProc, sourcePatch, procPatchID);
2866 repatch(newPatchID, constructFaceMap);
2870 initPatchFields<volScalarField, processorFvPatchField<scalar>>
2874 initPatchFields<volVectorField, processorFvPatchField<vector>>
2881 processorFvPatchField<sphericalTensor>
2886 initPatchFields<volSymmTensorField, processorFvPatchField<symmTensor>>
2890 initPatchFields<volTensorField, processorFvPatchField<tensor>>
2896 mesh_.setInstance(mesh_.time().timeName());
2903 printMeshInfo(mesh_);
2904 printFieldInfo<volScalarField>(mesh_);
2905 printFieldInfo<volVectorField>(mesh_);
2906 printFieldInfo<volSphericalTensorField>(mesh_);
2907 printFieldInfo<volSymmTensorField>(mesh_);
2908 printFieldInfo<volTensorField>(mesh_);
2909 printFieldInfo<surfaceScalarField>(mesh_);
2910 printFieldInfo<surfaceVectorField>(mesh_);
2911 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2912 printFieldInfo<surfaceSymmTensorField>(mesh_);
2913 printFieldInfo<surfaceTensorField>(mesh_);
2914 printIntFieldInfo<volScalarField::Internal>(mesh_);
2915 printIntFieldInfo<volVectorField::Internal>(mesh_);
2916 printIntFieldInfo<volSphericalTensorField::Internal>(mesh_);
2917 printIntFieldInfo<volSymmTensorField::Internal>(mesh_);
2918 printIntFieldInfo<volTensorField::Internal>(mesh_);
2930 std::move(oldPatchStarts),
2931 std::move(oldPatchNMeshPoints),
2933 std::move(subPointMap),
2934 std::move(subFaceMap),
2935 std::move(subCellMap),
2936 std::move(subPatchMap),
2938 std::move(constructPointMap),
2939 std::move(constructFaceMap),
2940 std::move(constructCellMap),
2941 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 within 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 void gatherList(const UList< commsStruct > &comms, UList< T > &values, const int tag, const label comm)
Gather data, but keep individual values separate. Uses the specified communication schedule...
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.
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 within 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.
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.
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.
void reduce(T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce) using linear/tree communication schedule.
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)