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.appendUniq(
name);
227 Pout<<
"Primitives:" <<
nl 241 Pout<<
" " << patchi <<
" name:" << pp.
name()
242 <<
" size:" << pp.size()
243 <<
" start:" << pp.
start()
244 <<
" type:" << pp.type()
254 Pout<<
" " << zoneI <<
" name:" << pz.
name()
255 <<
" size:" << pz.size()
265 Pout<<
" " << zoneI <<
" name:" << fz.
name()
266 <<
" size:" << fz.size()
276 Pout<<
" " << zoneI <<
" name:" << cz.
name()
277 <<
" size:" << cz.size()
286 const primitiveMesh&
mesh,
294 <<
"Current coupling info:" 297 forAll(sourceFace, bFacei)
301 Pout<<
" meshFace:" << meshFacei
303 <<
" connects to proc:" << sourceProc[bFacei]
304 <<
"/face:" << sourceFace[bFacei]
305 <<
" which will move to proc:" << sourceNewNbrProc[bFacei]
311 Foam::label Foam::fvMeshDistribute::findNonEmptyPatch()
const 315 const polyBoundaryMesh&
patches = mesh_.boundaryMesh();
324 const polyPatch& pp =
patches[patchi];
325 const auto* cpp = isA<cyclicACMIPolyPatch>(pp);
329 isCoupledPatch.
set(patchi);
330 const label dupPatchID = cpp->nonOverlapPatchID();
331 if (dupPatchID != -1)
333 isCoupledPatch.set(dupPatchID);
336 else if (pp.coupled())
338 isCoupledPatch.set(patchi);
342 label nonEmptyPatchi = -1;
346 const polyPatch& pp =
patches[patchi];
350 !isA<emptyPolyPatch>(pp)
351 && !isCoupledPatch(patchi)
352 && !isA<mappedPatchBase>(pp)
355 nonEmptyPatchi = patchi;
360 if (nonEmptyPatchi == -1)
363 <<
"Cannot find a patch which is not of type empty, mapped or" 365 <<
"There has to be at least one such patch for" 371 Pout<<
"findNonEmptyPatch : using patch " << nonEmptyPatchi
373 <<
" type:" <<
patches[nonEmptyPatchi].type()
374 <<
" to put exposed faces into." <<
endl;
380 label procPatchi = -1;
384 if (isA<processorPolyPatch>(
patches[patchi]))
388 else if (procPatchi != -1)
391 <<
"Processor patches should be at end of patch list." 393 <<
"Have processor patch " << procPatchi
394 <<
" followed by non-processor patch " << patchi
400 return nonEmptyPatchi;
433 fld[facei] = (
n[facei] & testNormal);
446 newPfld[i] = (nBf[patchi][i] & testNormal);
465 scalar
cos = (
n[facei] & testNormal);
471 <<
"On internal face " << facei <<
" at " 473 <<
" the field value is " <<
fld[facei]
474 <<
" whereas cos angle of " << testNormal
475 <<
" with mesh normal " <<
n[facei]
488 scalar
cos = (np[i] & testNormal);
492 label facei = fvp.patch().start()+i;
495 <<
"On face " << facei
496 <<
" on patch " << fvp.patch().name()
498 <<
" the field value is " << fvp[i]
499 <<
" whereas cos angle of " << testNormal
500 <<
" with mesh normal " << np[i]
512 const label destinationPatch
520 labelList newPatchID(mesh_.nBoundaryFaces(), -1);
522 for (
const polyPatch& pp : mesh_.boundaryMesh())
524 if (isA<processorPolyPatch>(pp))
528 Pout<<
"Moving all faces of patch " << pp.
name()
529 <<
" into patch " << destinationPatch
538 ) = destinationPatch;
546 autoPtr<mapPolyMesh> map = repatch(newPatchID, dummyFaceMaps);
554 forAll(mesh_.boundaryMesh(), patchi)
556 if (!isA<processorPolyPatch>(mesh_.boundaryMesh()[patchi]))
558 oldToNew[patchi] = newi++;
561 label nNonProcPatches = newi;
564 forAll(mesh_.boundaryMesh(), patchi)
566 if (isA<processorPolyPatch>(mesh_.boundaryMesh()[patchi]))
568 oldToNew[patchi] = newi++;
584 polyTopoChange meshMod(mesh_);
586 forAll(newPatchID, bFacei)
588 if (newPatchID[bFacei] != -1)
590 label facei = mesh_.nInternalFaces() + bFacei;
592 label zoneID = mesh_.faceZones().whichZone(facei);
593 bool zoneFlip =
false;
597 const faceZone& fZone = mesh_.faceZones()[zoneID];
598 zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
605 mesh_.faces()[facei],
607 mesh_.faceOwner()[facei],
624 PtrList<FieldField<fvsPatchField, scalar>> sFlds;
625 saveBoundaryFields<scalar, surfaceMesh>(sFlds);
626 PtrList<FieldField<fvsPatchField, vector>> vFlds;
627 saveBoundaryFields<vector, surfaceMesh>(vFlds);
628 PtrList<FieldField<fvsPatchField, sphericalTensor>> sptFlds;
629 saveBoundaryFields<sphericalTensor, surfaceMesh>(sptFlds);
630 PtrList<FieldField<fvsPatchField, symmTensor>> sytFlds;
631 saveBoundaryFields<symmTensor, surfaceMesh>(sytFlds);
632 PtrList<FieldField<fvsPatchField, tensor>> tFlds;
633 saveBoundaryFields<tensor, surfaceMesh>(tFlds);
644 const bool oldMoving = mesh_.moving(
false);
645 autoPtr<mapPolyMesh> mapPtr = meshMod.changeMesh(mesh_,
false,
true);
646 mesh_.moving(oldMoving);
647 mapPolyMesh& map = *mapPtr;
651 mesh_.updateMesh(map);
655 mapBoundaryFields<scalar, surfaceMesh>(map, sFlds);
656 mapBoundaryFields<vector, surfaceMesh>(map, vFlds);
657 mapBoundaryFields<sphericalTensor, surfaceMesh>(map, sptFlds);
658 mapBoundaryFields<symmTensor, surfaceMesh>(map, sytFlds);
659 mapBoundaryFields<tensor, surfaceMesh>(map, tFlds);
663 if (map.hasMotionPoints())
665 mesh_.movePoints(map.preMotionPoints());
672 label index = map.reverseFaceMap().find(-1);
677 <<
"reverseFaceMap contains -1 at index:" 679 <<
"This means that the repatch operation was not just" 684 forAll(constructFaceMap, proci)
686 inplaceRenumberWithFlip
688 map.reverseFaceMap(),
691 constructFaceMap[proci]
714 forAll(pointToGlobalMaster, pointi)
716 if (pointToGlobalMaster[pointi] != -1)
724 Pout<<
"mergeSharedPoints : found " << nShared
725 <<
" points on processor boundaries" <<
nl <<
endl;
728 Map<label> globalMasterToLocalMaster(2*nShared);
729 Map<label> pointToMaster(2*nShared);
732 forAll(pointToGlobalMaster, pointi)
734 label globali = pointToGlobalMaster[pointi];
737 const auto iter = globalMasterToLocalMaster.cfind(globali);
742 pointToMaster.insert(pointi, *iter);
748 globalMasterToLocalMaster.insert(globali, pointi);
749 pointToMaster.insert(pointi, pointi);
754 reduce(nMatch, sumOp<label>());
758 Pout<<
"mergeSharedPoints : found " 759 << nMatch <<
" mergeable points" <<
nl <<
endl;
769 polyTopoChange meshMod(mesh_);
777 const bool oldMoving = mesh_.moving(
false);
778 autoPtr<mapPolyMesh> mapPtr = meshMod.changeMesh(mesh_,
false,
true);
779 mesh_.moving(oldMoving);
780 mapPolyMesh& map = *mapPtr;
783 mesh_.updateMesh(map);
786 forAll(constructPointMap, proci)
788 labelList& constructMap = constructPointMap[proci];
792 label oldPointi = constructMap[i];
794 label
newPointi = map.reversePointMap()[oldPointi];
807 <<
"Problem. oldPointi:" << oldPointi
817 void Foam::fvMeshDistribute::getCouplingData
830 const label nBnd = mesh_.nBoundaryFaces();
831 sourceFace.setSize(nBnd);
832 sourceProc.setSize(nBnd);
833 sourcePatch.setSize(nBnd);
834 sourceNewNbrProc.setSize(nBnd);
836 const polyBoundaryMesh&
patches = mesh_.boundaryMesh();
844 const polyPatch& pp =
patches[patchi];
848 label offset = pp.
start() - mesh_.nInternalFaces();
853 label bndI = offset + i;
854 nbrFaces[bndI] = pp.start()+i;
858 SubList<label>(nbrNewNbrProc, pp.size(), offset) =
871 const polyPatch& pp =
patches[patchi];
872 label offset = pp.
start() - mesh_.nInternalFaces();
874 if (isA<processorPolyPatch>(pp))
876 const processorPolyPatch& procPatch =
877 refCast<const processorPolyPatch>(pp);
881 if (procPatch.owner())
886 label bndI = offset + i;
887 sourceFace[bndI] = pp.start()+i;
889 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
897 label bndI = offset + i;
898 sourceFace[bndI] = nbrFaces[bndI];
899 sourceProc[bndI] = procPatch.neighbProcNo();
900 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
906 if (isA<processorCyclicPolyPatch>(pp))
908 patchi = refCast<const processorCyclicPolyPatch>
916 label bndI = offset + i;
917 sourcePatch[bndI] = patchi;
920 else if (isA<cyclicPolyPatch>(pp))
922 const cyclicPolyPatch& cpp = refCast<const cyclicPolyPatch>(pp);
928 label bndI = offset + i;
929 sourceFace[bndI] = pp.start()+i;
931 sourcePatch[bndI] = patchi;
932 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
939 label bndI = offset + i;
940 sourceFace[bndI] = nbrFaces[bndI];
942 sourcePatch[bndI] = patchi;
943 sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
952 label bndI = offset + i;
953 sourceFace[bndI] = -1;
954 sourceProc[bndI] = -1;
955 sourcePatch[bndI] = patchi;
956 sourceNewNbrProc[bndI] = -1;
963 sourcePointMaster.setSize(mesh_.nPoints());
964 sourcePointMaster = -1;
967 const globalIndex globalPoints(mesh_.nPoints());
969 const globalMeshData& gmd = mesh_.globalData();
971 const labelList& meshPoints = cpp.meshPoints();
972 const mapDistribute& slavesMap = gmd.globalCoPointSlavesMap();
975 labelList elems(slavesMap.constructSize(), -1);
976 forAll(meshPoints, pointi)
984 label globalPointi = globalPoints.toGlobal(meshPoints[pointi]);
985 elems[pointi] = globalPointi;
988 label sloti = slots[i];
989 if (sloti >= meshPoints.size())
993 elems[slots[i]] = globalPointi;
1000 slavesMap.reverseDistribute(elems.size(), elems,
false);
1003 forAll(meshPoints, pointi)
1005 sourcePointMaster[meshPoints[pointi]] = elems[pointi];
1012 void Foam::fvMeshDistribute::subsetCouplingData
1022 const label oldInternalFaces,
1042 forAll(subFace, newBFacei)
1046 label oldFacei =
faceMap[newFacei];
1049 if (oldFacei < oldInternalFaces)
1051 subFace[newBFacei] = oldFacei;
1053 subPatch[newBFacei] = -1;
1055 label oldOwn = oldFaceOwner[oldFacei];
1056 label oldNei = oldFaceNeighbour[oldFacei];
1061 subNewNbrProc[newBFacei] = oldDistribution[oldNei];
1066 subNewNbrProc[newBFacei] = oldDistribution[oldOwn];
1072 label oldBFacei = oldFacei - oldInternalFaces;
1074 subFace[newBFacei] = sourceFace[oldBFacei];
1075 subProc[newBFacei] = sourceProc[oldBFacei];
1076 subPatch[newBFacei] = sourcePatch[oldBFacei];
1077 subNewNbrProc[newBFacei] = sourceNewNbrProc[oldBFacei];
1082 subPointMaster = UIndirectList<label>(sourcePointMaster, pointMap);
1088 void Foam::fvMeshDistribute::findCouples
1090 const primitiveMesh&
mesh,
1096 const primitiveMesh& domainMesh,
1109 forAll(domainProc, bFacei)
1111 if (domainProc[bFacei] != -1 && domainPatch[bFacei] == -1)
1115 labelPair(domainFace[bFacei], domainProc[bFacei]),
1124 masterCoupledFaces.setSize(domainFace.size());
1125 slaveCoupledFaces.setSize(domainFace.size());
1128 forAll(sourceFace, bFacei)
1130 if (sourceProc[bFacei] != -1 && sourcePatch[bFacei] == -1)
1132 labelPair myData(sourceFace[bFacei], sourceProc[bFacei]);
1134 const auto iter = map.cfind(myData);
1138 label nbrBFacei = *iter;
1141 slaveCoupledFaces[coupledI] =
1142 domainMesh.nInternalFaces()
1150 masterCoupledFaces.setSize(coupledI);
1151 slaveCoupledFaces.setSize(coupledI);
1155 Pout<<
"findCouples : found " << coupledI
1156 <<
" faces that will be stitched" <<
nl <<
endl;
1161 void Foam::fvMeshDistribute::findCouples
1163 const UPtrList<polyMesh>&
meshes,
1164 const PtrList<labelList>& domainSourceFaces,
1165 const PtrList<labelList>& domainSourceProcs,
1166 const PtrList<labelList>& domainSourcePatchs,
1182 const labelList& domainProc = domainSourceProcs[meshi];
1183 const labelList& domainPatch = domainSourcePatchs[meshi];
1185 forAll(domainProc, bFacei)
1187 if (domainProc[bFacei] != -1 && domainPatch[bFacei] == -1)
1189 nProcFaces[meshi]++;
1197 Pout<<
"fvMeshDistribute::findCouples : nProcFaces:" 1211 dynLocalFace[meshi].setCapacity(nProcFaces[meshi]);
1212 dynRemoteProc[meshi].setCapacity(nProcFaces[meshi]);
1213 dynRemoteFace[meshi].setCapacity(nProcFaces[meshi]);
1219 LabelPairMap<labelPair> map(2*
sum(nProcFaces));
1227 const labelList& domainFace = domainSourceFaces[meshi];
1228 const labelList& domainProc = domainSourceProcs[meshi];
1229 const labelList& domainPatch = domainSourcePatchs[meshi];
1231 forAll(domainProc, bFacei)
1233 if (domainProc[bFacei] != -1 && domainPatch[bFacei] == -1)
1240 auto fnd = map.find(
key);
1245 map.emplace(
key, meshi, bFacei);
1250 const label matchProci = fnd().first();
1251 const label matchFacei = fnd().second();
1253 dynLocalFace[meshi].append(bFacei);
1254 dynRemoteProc[meshi].append(matchProci);
1255 dynRemoteFace[meshi].append(matchFacei);
1256 nProcFaces[meshi]++;
1258 dynLocalFace[matchProci].append(matchFacei);
1259 dynRemoteProc[matchProci].append(meshi);
1260 dynRemoteFace[matchProci].append(bFacei);
1261 nProcFaces[matchProci]++;
1270 Pout<<
"fvMeshDistribute::findCouples : stored procFaces:" 1271 << map.size() <<
endl;
1281 localBoundaryFace[meshi] = std::move(dynLocalFace[meshi]);
1282 remoteFaceProc[meshi] = std::move(dynRemoteProc[meshi]);
1283 remoteBoundaryFace[meshi] = std::move(dynRemoteFace[meshi]);
1290 Pout<<
"fvMeshDistribute::findCouples : found matches:" 1299 const primitiveMesh&
mesh,
1300 const mapAddedPolyMesh& map,
1302 const label nInternalFaces1,
1308 forAll(boundaryData0, oldBFacei)
1310 label newFacei = map.oldFaceMap()[oldBFacei + map.nOldInternalFaces()];
1316 boundaryData0[oldBFacei];
1320 forAll(boundaryData1, addedBFacei)
1322 label newFacei = map.addedFaceMap()[addedBFacei + nInternalFaces1];
1327 boundaryData1[addedBFacei];
1331 return newBoundaryData;
1337 const primitiveMesh&
mesh,
1338 const mapAddedPolyMesh& map,
1345 forAll(boundaryData0, oldPointi)
1347 label
newPointi = map.oldPointMap()[oldPointi];
1352 newBoundaryData[
newPointi] = boundaryData0[oldPointi];
1356 forAll(boundaryData1, addedPointi)
1358 label
newPointi = map.addedPointMap()[addedPointi];
1362 newBoundaryData[
newPointi] = boundaryData1[addedPointi];
1366 return newBoundaryData;
1374 const label oldInternalPatchi
1378 polyTopoChange meshMod(mesh_);
1382 removeCells cellRemover(mesh_,
false);
1385 labelList exposedFaces(cellRemover.getExposedFaces(cellsToRemove));
1388 cellRemover.setRefinement
1392 labelList(exposedFaces.size(), oldInternalPatchi),
1403 PtrList<Field<scalar>> sFlds;
1404 saveInternalFields(sFlds);
1405 PtrList<Field<vector>> vFlds;
1406 saveInternalFields(vFlds);
1407 PtrList<Field<sphericalTensor>> sptFlds;
1408 saveInternalFields(sptFlds);
1409 PtrList<Field<symmTensor>> sytFlds;
1410 saveInternalFields(sytFlds);
1411 PtrList<Field<tensor>> tFlds;
1412 saveInternalFields(tFlds);
1418 const bool oldMoving = mesh_.moving(
false);
1419 autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh_,
false,
false);
1420 mesh_.moving(oldMoving);
1423 mesh_.updateMesh(map());
1430 mapExposedFaces(map(), sFlds);
1431 mapExposedFaces(map(), vFlds);
1432 mapExposedFaces(map(), sptFlds);
1433 mapExposedFaces(map(), sytFlds);
1434 mapExposedFaces(map(), tFlds);
1442 if (map().hasMotionPoints())
1444 mesh_.movePoints(map().preMotionPoints());
1454 void Foam::fvMeshDistribute::addProcPatches
1458 List<Map<label>>& procPatchID
1470 sortedOrder(nbrProc, indices, lessProcPatches(nbrProc, referPatchID));
1476 label bFacei = indices[i];
1477 label proci = nbrProc[bFacei];
1481 if (!procPatchID[proci].
found(referPatchID[bFacei]))
1486 if (referPatchID[bFacei] == -1)
1490 processorPolyPatch pp
1494 mesh_.boundaryMesh().size(),
1495 mesh_.boundaryMesh(),
1500 procPatchID[proci].insert
1502 referPatchID[bFacei],
1515 const coupledPolyPatch& pcPatch
1516 = refCast<const coupledPolyPatch>
1518 mesh_.boundaryMesh()[referPatchID[bFacei]]
1520 processorCyclicPolyPatch pp
1524 mesh_.boundaryMesh().size(),
1525 mesh_.boundaryMesh(),
1532 procPatchID[proci].insert
1534 referPatchID[bFacei],
1556 const List<Map<label>>& procPatchID
1565 label origPatchi = referPatchID[bFacei];
1566 patchIDs[bFacei] = origPatchi;
1568 else if (nbrProc[bFacei] != -1)
1570 label origPatchi = referPatchID[bFacei];
1571 patchIDs[bFacei] = procPatchID[nbrProc[bFacei]][origPatchi];
1575 patchIDs[bFacei] = -1;
1583 void Foam::fvMeshDistribute::sendMesh
1602 Pout<<
"Sending to domain " << domain <<
nl 1612 CompactListList<label> zonePoints;
1618 forAll(pointZoneNames, nameI)
1620 label myZoneID = pointZones.findZoneID(pointZoneNames[nameI]);
1624 rowSizes[nameI] = pointZones[myZoneID].size();
1627 zonePoints.setSize(rowSizes);
1629 forAll(pointZoneNames, nameI)
1631 label myZoneID = pointZones.findZoneID(pointZoneNames[nameI]);
1635 zonePoints[nameI].deepCopy(pointZones[myZoneID]);
1641 CompactListList<label> zoneFaces;
1642 CompactListList<bool> zoneFaceFlip;
1648 forAll(faceZoneNames, nameI)
1650 label myZoneID = faceZones.findZoneID(faceZoneNames[nameI]);
1654 rowSizes[nameI] = faceZones[myZoneID].size();
1658 zoneFaces.setSize(rowSizes);
1659 zoneFaceFlip.setSize(rowSizes);
1661 forAll(faceZoneNames, nameI)
1663 label myZoneID = faceZones.findZoneID(faceZoneNames[nameI]);
1667 zoneFaces[nameI].deepCopy(faceZones[myZoneID]);
1668 zoneFaceFlip[nameI].deepCopy(faceZones[myZoneID].flipMap());
1674 CompactListList<label> zoneCells;
1680 forAll(cellZoneNames, nameI)
1682 label myZoneID = cellZones.findZoneID(cellZoneNames[nameI]);
1686 rowSizes[nameI] = cellZones[myZoneID].size();
1690 zoneCells.setSize(rowSizes);
1692 forAll(cellZoneNames, nameI)
1694 label myZoneID = cellZones.findZoneID(cellZoneNames[nameI]);
1698 zoneCells[nameI].deepCopy(cellZones[myZoneID]);
1735 << sourcePointMaster;
1740 Pout<<
"Started sending mesh to domain " << domain
1764 faceList domainFaces = CompactListList<label>(fromNbr).unpack<face>();
1767 PtrList<entry> patchEntries(fromNbr);
1769 CompactListList<label> zonePoints(fromNbr);
1770 CompactListList<label> zoneFaces(fromNbr);
1771 CompactListList<bool> zoneFaceFlip(fromNbr);
1772 CompactListList<label> zoneCells(fromNbr);
1777 >> domainSourcePatch
1778 >> domainSourceNewNbrProc
1779 >> domainSourcePointMaster;
1791 std::move(domainPoints),
1792 std::move(domainFaces),
1793 std::move(domainAllOwner),
1794 std::move(domainAllNeighbour),
1797 fvMesh& domainMesh = *domainMeshPtr;
1801 forAll(patchEntries, patchi)
1808 patchEntries[patchi].keyword(),
1809 patchEntries[patchi].
dict(),
1811 domainMesh.boundaryMesh()
1816 domainMesh.addFvPatches(
patches,
false);
1819 List<pointZone*> pZonePtrs(pointZoneNames.size());
1822 pZonePtrs[i] =
new pointZone
1827 domainMesh.pointZones()
1831 List<faceZone*> fZonePtrs(faceZoneNames.size());
1834 fZonePtrs[i] =
new faceZone
1840 domainMesh.faceZones()
1844 List<cellZone*> cZonePtrs(cellZoneNames.size());
1847 cZonePtrs[i] =
new cellZone
1852 domainMesh.cellZones()
1855 domainMesh.addZones(pZonePtrs, fZonePtrs, cZonePtrs);
1857 return domainMeshPtr;
1863 Foam::fvMeshDistribute::fvMeshDistribute(
fvMesh&
mesh)
1886 <<
"At index " << celli <<
" distribution:" << newProc
1904 <<
"Size of distribution:" 1910 const polyBoundaryMesh&
patches = mesh_.boundaryMesh();
1916 <<
"This application requires all non-processor patches" 1917 <<
" to be present in the same order on all patches" <<
nl 1918 <<
"followed by the processor patches (which of course are unique)." 1920 <<
"Local patches:" << mesh_.boundaryMesh().names()
1925 const label nOldPoints(mesh_.nPoints());
1926 const label nOldFaces(mesh_.nFaces());
1927 const label nOldCells(mesh_.nCells());
1933 oldPatchNMeshPoints[patchi] =
patches[patchi].nPoints();
1949 std::move(oldPatchStarts),
1950 std::move(oldPatchNMeshPoints),
1968 const wordList pointZoneNames(mergeWordList(mesh_.pointZones().names()));
1969 reorderZones<pointZone>(pointZoneNames, mesh_.pointZones());
1971 const wordList faceZoneNames(mergeWordList(mesh_.faceZones().names()));
1972 reorderZones<faceZone>(faceZoneNames, mesh_.faceZones());
1974 const wordList cellZoneNames(mergeWordList(mesh_.cellZones().names()));
1975 reorderZones<cellZone>(cellZoneNames, mesh_.cellZones());
2038 mesh_.resetMotion();
2042 HashTable<wordList> allFieldNames;
2044 getFieldNames<volScalarField>(mesh_, allFieldNames);
2045 getFieldNames<volVectorField>(mesh_, allFieldNames);
2046 getFieldNames<volSphericalTensorField>(mesh_, allFieldNames);
2047 getFieldNames<volSymmTensorField>(mesh_, allFieldNames);
2048 getFieldNames<volTensorField>(mesh_, allFieldNames);
2050 getFieldNames<surfaceScalarField>(mesh_, allFieldNames);
2051 getFieldNames<surfaceVectorField>(mesh_, allFieldNames);
2052 getFieldNames<surfaceSphericalTensorField>(mesh_, allFieldNames);
2053 getFieldNames<surfaceSymmTensorField>(mesh_, allFieldNames);
2054 getFieldNames<surfaceTensorField>(mesh_, allFieldNames);
2056 getFieldNames<volScalarField::Internal>
2062 getFieldNames<volVectorField::Internal>
2068 getFieldNames<volSphericalTensorField::Internal>
2074 getFieldNames<volSymmTensorField::Internal>
2080 getFieldNames<volTensorField::Internal>
2089 const label oldInternalPatchi = findNonEmptyPatch();
2096 autoPtr<mapPolyMesh> repatchMap = deleteProcPatches(oldInternalPatchi);
2099 repatchFaceMap = repatchMap().faceMap();
2106 repatchMap().reverseFaceMap(),
2107 mesh_.nBoundaryFaces(),
2108 mesh_.nInternalFaces()
2110 - mesh_.nInternalFaces()
2124 Pout<<
nl <<
"MESH WITH PROC PATCHES DELETED:" <<
endl;
2125 printMeshInfo(mesh_);
2126 printFieldInfo<volScalarField>(mesh_);
2127 printFieldInfo<volVectorField>(mesh_);
2128 printFieldInfo<volSphericalTensorField>(mesh_);
2129 printFieldInfo<volSymmTensorField>(mesh_);
2130 printFieldInfo<volTensorField>(mesh_);
2131 printFieldInfo<surfaceScalarField>(mesh_);
2132 printFieldInfo<surfaceVectorField>(mesh_);
2133 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2134 printFieldInfo<surfaceSymmTensorField>(mesh_);
2135 printFieldInfo<surfaceTensorField>(mesh_);
2136 printIntFieldInfo<volScalarField::Internal>(mesh_);
2137 printIntFieldInfo<volVectorField::Internal>(mesh_);
2138 printIntFieldInfo<volSphericalTensorField::Internal>(mesh_);
2139 printIntFieldInfo<volSymmTensorField::Internal>(mesh_);
2140 printIntFieldInfo<volTensorField::Internal>(mesh_);
2161 labelList nSendCells(countCells(distribution));
2175 forAll(nSendCells, recvProc)
2184 <<
"SUBSETTING FOR DOMAIN " << recvProc
2185 <<
" cells to send:" 2186 << nSendCells[recvProc]
2192 UOPstream str(recvProc, pBufs);
2195 fvMeshSubset subsetter
2204 subCellMap[recvProc] = subsetter.cellMap();
2205 subFaceMap[recvProc] = subsetter.faceFlipMap();
2206 inplaceRenumberWithFlip
2211 subFaceMap[recvProc]
2213 subPointMap[recvProc] = subsetter.pointMap();
2214 subPatchMap[recvProc] = subsetter.patchMap();
2226 subsetter.subMesh(),
2227 subsetter.pointMap(),
2228 subsetter.faceMap(),
2229 subsetter.cellMap(),
2233 mesh_.faceNeighbour(),
2234 mesh_.nInternalFaces(),
2245 procSourceNewNbrProc,
2246 procSourcePointMaster
2254 subsetter.subMesh(),
2263 procSourceNewNbrProc,
2264 procSourcePointMaster,
2270 sendFields<volScalarField>
2277 sendFields<volVectorField>
2284 sendFields<volSphericalTensorField>
2291 sendFields<volSymmTensorField>
2298 sendFields<volTensorField>
2307 sendFields<surfaceScalarField>
2314 sendFields<surfaceVectorField>
2321 sendFields<surfaceSphericalTensorField>
2328 sendFields<surfaceSymmTensorField>
2335 sendFields<surfaceTensorField>
2344 sendFields<volScalarField::Internal>
2351 sendFields<volVectorField::Internal>
2358 sendFields<volSphericalTensorField::Internal>
2365 sendFields<volSymmTensorField::Internal>
2372 sendFields<volTensorField::Internal>
2394 pBufs.finishedSends(recvSizes);
2398 Pout<<
"Finished sending and receiving : " <<
flatOutput(recvSizes)
2409 const labelList oldFaceOwner(mesh_.faceOwner());
2410 const labelList oldFaceNeighbour(mesh_.faceNeighbour());
2411 const label oldInternalFaces = mesh_.nInternalFaces();
2414 autoPtr<mapPolyMesh> subMap
2437 for (
const label facei : flip)
2454 subMap().pointMap(),
2472 domainSourceNewNbrProc,
2473 domainSourcePointMaster
2476 sourceFace.transfer(domainSourceFace);
2477 sourceProc.transfer(domainSourceProc);
2478 sourcePatch.transfer(domainSourcePatch);
2479 sourceNewNbrProc.transfer(domainSourceNewNbrProc);
2480 sourcePointMaster.transfer(domainSourcePointMaster);
2488 printMeshInfo(mesh_);
2489 printFieldInfo<volScalarField>(mesh_);
2490 printFieldInfo<volVectorField>(mesh_);
2491 printFieldInfo<volSphericalTensorField>(mesh_);
2492 printFieldInfo<volSymmTensorField>(mesh_);
2493 printFieldInfo<volTensorField>(mesh_);
2494 printFieldInfo<surfaceScalarField>(mesh_);
2495 printFieldInfo<surfaceVectorField>(mesh_);
2496 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2497 printFieldInfo<surfaceSymmTensorField>(mesh_);
2498 printFieldInfo<surfaceTensorField>(mesh_);
2499 printIntFieldInfo<volScalarField::Internal>(mesh_);
2500 printIntFieldInfo<volVectorField::Internal>(mesh_);
2501 printIntFieldInfo<volSphericalTensorField::Internal>(mesh_);
2502 printIntFieldInfo<volSymmTensorField::Internal>(mesh_);
2503 printIntFieldInfo<volTensorField::Internal>(mesh_);
2531 PtrList<PtrList<surfaceSphericalTensorField>> ssptfs
2540 PtrList<PtrList<volSphericalTensorField::Internal>> dstfs
2544 PtrList<PtrList<volSymmTensorField::Internal>> dsytfs
2550 forAll(nRevcCells, sendProc)
2558 <<
"RECEIVING FROM DOMAIN " << sendProc
2559 <<
" cells to receive:" 2560 << nRevcCells[sendProc]
2566 UIPstream str(sendProc, pBufs);
2570 domainSourceFaces.set(sendProc,
new labelList(0));
2571 labelList& domainSourceFace = domainSourceFaces[sendProc];
2574 labelList& domainSourceProc = domainSourceProcs[sendProc];
2577 labelList& domainSourcePatch = domainSourcePatchs[sendProc];
2579 domainSourceNewNbrProcs.
set(sendProc,
new labelList(0));
2581 domainSourceNewNbrProcs[sendProc];
2583 domainSourcePointMasters.
set(sendProc,
new labelList(0));
2585 domainSourcePointMasters[sendProc];
2589 autoPtr<fvMesh> domainMeshPtr = receiveMesh
2596 const_cast<Time&>(mesh_.time()),
2600 domainSourceNewNbrProc,
2601 domainSourcePointMaster,
2604 domainMeshPtrs.set(sendProc, domainMeshPtr.ptr());
2605 fvMesh& domainMesh = domainMeshPtrs[sendProc];
2612 dictionary fieldDicts(str);
2615 vsfs.set(sendProc,
new PtrList<volScalarField>(0));
2616 receiveFields<volScalarField>
2624 vvfs.set(sendProc,
new PtrList<volVectorField>(0));
2625 receiveFields<volVectorField>
2636 new PtrList<volSphericalTensorField>(0)
2638 receiveFields<volSphericalTensorField>
2646 vsytfs.set(sendProc,
new PtrList<volSymmTensorField>(0));
2647 receiveFields<volSymmTensorField>
2655 vtfs.set(sendProc,
new PtrList<volTensorField>(0));
2656 receiveFields<volTensorField>
2666 ssfs.set(sendProc,
new PtrList<surfaceScalarField>(0));
2667 receiveFields<surfaceScalarField>
2675 svfs.set(sendProc,
new PtrList<surfaceVectorField>(0));
2676 receiveFields<surfaceVectorField>
2687 new PtrList<surfaceSphericalTensorField>(0)
2689 receiveFields<surfaceSphericalTensorField>
2697 ssytfs.set(sendProc,
new PtrList<surfaceSymmTensorField>(0));
2698 receiveFields<surfaceSymmTensorField>
2706 stfs.set(sendProc,
new PtrList<surfaceTensorField>(0));
2707 receiveFields<surfaceTensorField>
2720 new PtrList<volScalarField::Internal>(0)
2722 receiveFields<volScalarField::Internal>
2733 new PtrList<volVectorField::Internal>(0)
2735 receiveFields<volVectorField::Internal>
2746 new PtrList<volSphericalTensorField::Internal>(0)
2748 receiveFields<volSphericalTensorField::Internal>
2759 new PtrList<volSymmTensorField::Internal>(0)
2761 receiveFields<volSymmTensorField::Internal>
2772 new PtrList<volTensorField::Internal>(0)
2774 receiveFields<volTensorField::Internal>
2791 UPtrList<polyMesh>
meshes(domainMeshPtrs.size());
2792 UPtrList<fvMesh> fvMeshes(domainMeshPtrs.size());
2793 forAll(domainMeshPtrs, proci)
2795 if (domainMeshPtrs.set(proci))
2797 meshes.
set(proci, &domainMeshPtrs[proci]);
2798 fvMeshes.
set(proci, &domainMeshPtrs[proci]);
2844 const label nOldInternalFaces = mesh_.nInternalFaces();
2845 const labelList oldFaceOwner(mesh_.faceOwner());
2849 const bool oldMoving = mesh_.moving(
false);
2868 mesh_.moving(oldMoving);
2874 printMeshInfo(mesh_);
2875 printFieldInfo<volScalarField>(mesh_);
2876 printFieldInfo<volVectorField>(mesh_);
2877 printFieldInfo<volSphericalTensorField>(mesh_);
2878 printFieldInfo<volSymmTensorField>(mesh_);
2879 printFieldInfo<volTensorField>(mesh_);
2880 printFieldInfo<surfaceScalarField>(mesh_);
2881 printFieldInfo<surfaceVectorField>(mesh_);
2882 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2883 printFieldInfo<surfaceSymmTensorField>(mesh_);
2884 printFieldInfo<surfaceTensorField>(mesh_);
2885 printIntFieldInfo<volScalarField::Internal>(mesh_);
2886 printIntFieldInfo<volVectorField::Internal>(mesh_);
2887 printIntFieldInfo<volSphericalTensorField::Internal>(mesh_);
2888 printIntFieldInfo<volSymmTensorField::Internal>(mesh_);
2889 printIntFieldInfo<volTensorField::Internal>(mesh_);
2895 sourceProc.setSize(mesh_.nBoundaryFaces());
2897 sourcePatch.setSize(mesh_.nBoundaryFaces());
2899 sourceFace.setSize(mesh_.nBoundaryFaces());
2901 sourceNewNbrProc.setSize(mesh_.nBoundaryFaces());
2902 sourceNewNbrProc = -1;
2903 sourcePointMaster.setSize(mesh_.nPoints());
2904 sourcePointMaster = -1;
2906 if (mesh_.nPoints() > 0)
2910 if (domainSourceFaces.set(meshi))
2912 const label nIntFaces =
2916 :
meshes[meshi].nInternalFaces()
2922 :
meshes[meshi].faceOwner()
2926 const labelList& cellMap = constructCellMap[meshi];
2929 domainSourceFaces[meshi];
2931 domainSourceProcs[meshi];
2933 domainSourcePatchs[meshi];
2935 domainSourceNewNbrProcs[meshi];
2936 UIndirectList<label>
2939 constructPointMap[meshi]
2940 ) = domainSourcePointMasters[meshi];
2943 forAll(domainSourceFace, bFacei)
2945 const label oldFacei = bFacei+nIntFaces;
2946 const label allFacei =
faceMap[oldFacei];
2947 const label allbFacei = allFacei-mesh_.nInternalFaces();
2951 sourceProc[allbFacei] = domainSourceProc[bFacei];
2952 sourcePatch[allbFacei] = domainSourcePatch[bFacei];
2953 sourceFace[allbFacei] = domainSourceFace[bFacei];
2954 sourceNewNbrProc[allbFacei] =
2955 domainSourceNewNbr[bFacei];
2963 const label allFacei =
faceMap[oldFacei];
2964 const label allOwn = mesh_.faceOwner()[allFacei];
2966 if (cellMap[faceOwner[oldFacei]] == allOwn)
2990 printMeshInfo(mesh_);
2991 printFieldInfo<volScalarField>(mesh_);
2992 printFieldInfo<volVectorField>(mesh_);
2993 printFieldInfo<volSphericalTensorField>(mesh_);
2994 printFieldInfo<volSymmTensorField>(mesh_);
2995 printFieldInfo<volTensorField>(mesh_);
2996 printFieldInfo<surfaceScalarField>(mesh_);
2997 printFieldInfo<surfaceVectorField>(mesh_);
2998 printFieldInfo<surfaceSphericalTensorField>(mesh_);
2999 printFieldInfo<surfaceSymmTensorField>(mesh_);
3000 printFieldInfo<surfaceTensorField>(mesh_);
3001 printIntFieldInfo<volScalarField::Internal>(mesh_);
3002 printIntFieldInfo<volVectorField::Internal>(mesh_);
3003 printIntFieldInfo<volSphericalTensorField::Internal>(mesh_);
3004 printIntFieldInfo<volSymmTensorField::Internal>(mesh_);
3005 printIntFieldInfo<volTensorField::Internal>(mesh_);
3012 mergeSharedPoints(sourcePointMaster, constructPointMap);
3021 List<Map<label>> procPatchID;
3024 addProcPatches(sourceNewNbrProc, sourcePatch, procPatchID);
3043 repatch(newPatchID, constructFaceMap);
3047 initPatchFields<volScalarField, processorFvPatchField<scalar>>
3051 initPatchFields<volVectorField, processorFvPatchField<vector>>
3058 processorFvPatchField<sphericalTensor>
3063 initPatchFields<volSymmTensorField, processorFvPatchField<symmTensor>>
3067 initPatchFields<volTensorField, processorFvPatchField<tensor>>
3073 mesh_.setInstance(mesh_.time().timeName());
3080 printMeshInfo(mesh_);
3081 printFieldInfo<volScalarField>(mesh_);
3082 printFieldInfo<volVectorField>(mesh_);
3083 printFieldInfo<volSphericalTensorField>(mesh_);
3084 printFieldInfo<volSymmTensorField>(mesh_);
3085 printFieldInfo<volTensorField>(mesh_);
3086 printFieldInfo<surfaceScalarField>(mesh_);
3087 printFieldInfo<surfaceVectorField>(mesh_);
3088 printFieldInfo<surfaceSphericalTensorField>(mesh_);
3089 printFieldInfo<surfaceSymmTensorField>(mesh_);
3090 printFieldInfo<surfaceTensorField>(mesh_);
3091 printIntFieldInfo<volScalarField::Internal>(mesh_);
3092 printIntFieldInfo<volVectorField::Internal>(mesh_);
3093 printIntFieldInfo<volSphericalTensorField::Internal>(mesh_);
3094 printIntFieldInfo<volSymmTensorField::Internal>(mesh_);
3095 printIntFieldInfo<volTensorField::Internal>(mesh_);
3107 std::move(oldPatchStarts),
3108 std::move(oldPatchNMeshPoints),
3110 std::move(subPointMap),
3111 std::move(subFaceMap),
3112 std::move(subCellMap),
3113 std::move(subPatchMap),
3115 std::move(constructPointMap),
3116 std::move(constructFaceMap),
3117 std::move(constructCellMap),
3118 std::move(constructPatchMap),
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
dimensionedScalar sign(const dimensionedScalar &ds)
fvsPatchField< vector > fvsPatchVectorField
virtual const fileName & name() const
Get the name of the output serial stream. (eg, the name of the Fstream file name) ...
fvsPatchField< scalar > fvsPatchScalarField
List< labelList > labelListList
A List of labelList.
ZoneMesh< faceZone, polyMesh > faceZoneMesh
A ZoneMesh with the type faceZone.
const surfaceVectorField & Sf() const
Return cell face area vectors.
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.
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type set(const label i, bool val=true)
A bitSet::set() method for a list of bool.
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.
List< face > faceList
A List of faces.
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.
label size() const noexcept
The number of elements in table.
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)
Number of this process (starting from masterNo() = 0)
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< 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 processes in communicator.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
Various functions to operate on Lists.
virtual const pointField & points() const
Return raw points.
#define forAll(list, i)
Loop across all elements in list.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
static const char *const typeName
Typename for Field.
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.
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator) 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)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for 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)
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.
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 elements in the list.
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.
const word & name() const noexcept
The patch name.
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 integer data with all processors (in the 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 time name of given scalar time 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")
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
const pointZoneMesh & pointZones() const noexcept
Return point zone mesh.
List< word > wordList
A List of words.
static void printMeshInfo(const fvMesh &)
Print some info on mesh.
void inplaceRenumber(const labelUList &oldToNew, IntListType &input)
Inplace renumber the values (not the indices) of a list.
UIndirectList< label > labelUIndList
UIndirectList of labels.
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)
Am I the master rank.
label start() const
Return start label of this patch in the polyMesh face list.
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...
#define forAllReverse(list, i)
Reverse loop across all elements in list.
List< label > labelList
A List of labels.
A class for managing temporary objects.
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.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
static constexpr const zero Zero
Global zero (0)