49 void Foam::domainDecomposition::decomposePoints()
53 fvMesh& procMesh = procMeshes_[proci];
55 const label pointsCompare =
59 procMeshes_[proci].pointsInstance()
62 if (pointsCompare == -1)
69 procPointAddressing_[proci]
77 void Foam::domainDecomposition::reconstructPoints()
79 const label pointsCompare =
82 completeMesh().pointsInstance(),
83 procMeshes_[0].pointsInstance()
86 if (pointsCompare == 1)
90 for (
label proci = 0; proci < nProcs(); proci++)
92 const fvMesh& procMesh = procMeshes_[proci];
94 completePoints.rmap(procMesh.points(), procPointAddressing_[proci]);
97 completeMesh_->setPoints(completePoints);
102 bool Foam::domainDecomposition::completeConformal()
const
104 return completeMesh().conformal();
108 bool Foam::domainDecomposition::procsConformal()
const
110 forAll(procMeshes_, proci)
112 if (!procMeshes_[proci].conformal())
122 void Foam::domainDecomposition::unconform()
125 auto checkNonConformalCoupledPatchOrdering = []
129 const fvPatch& nbrFvp,
134 if (fvp.size() != nbrFvp.size())
137 <<
"Coupled patches " << fvp.name() <<
" and "
138 << nbrFvp.name() <<
" are not the same size"
144 for (
label i = 1; i < fvp.size(); ++ i)
148 polyFacesPf[i - 1] > polyFacesPf[i]
150 : polyFacesPf[i - 1] == polyFacesPf[i]
151 ? nbrPolyFacesPf[i - 1] >= nbrPolyFacesPf[i]
156 <<
"Coupled patches " << fvp.name()
157 <<
" and " << nbrFvp.name()
158 <<
" are not in order";
160 if (procs[0] == procs[1])
163 <<
" on process #" << procs[0];
173 <<
"Coupled patches " << fvp.name()
174 <<
" and " << nbrFvp.name()
175 <<
" are in order" <<
endl;
179 auto checkNonConformalErrorPatchOrdering = []
188 for (
label i = 1; i < fvp.size(); ++ i)
190 if (polyFacesPf[i - 1] > polyFacesPf[i])
193 <<
"Error patch " << fvp.name()
194 <<
" is not in order";
199 <<
" on process #" << proci;
209 <<
"Error patch " << fvp.name()
210 <<
" is in order" <<
endl;
213 if (completeConformal() && procsConformal())
217 else if (!completeConformal() && procsConformal())
221 forAll(procMeshes_, proci)
223 forAll(procFaceAddressing()[proci], procFacei)
226 mag(procFaceAddressing()[proci][procFacei]) - 1;
228 faceProcFace[facei] =
229 faceProcFace[facei] == -
labelMax ? procFacei : -1;
236 forAll(procMeshes_, proci)
238 fvMesh& procMesh = procMeshes_[proci];
241 procFaceAddressingBf()[proci];
246 procMesh.polyFacesBf()
251 forAll(procMesh.boundary(), procNccPatchi)
253 const fvPatch& fvp = procMesh.boundary()[procNccPatchi];
255 if (isA<nonConformalFvPatch>(fvp))
257 const label completeNccPatchi =
258 isA<processorCyclicFvPatch>(fvp)
259 ? refCast<const processorCyclicFvPatch>(fvp)
263 polyFacesBf[procNccPatchi] =
269 completeMesh().polyFacesBf()[completeNccPatchi],
270 mag(faceAddressingBf[procNccPatchi]) - 1
274 const label size = polyFacesBf[procNccPatchi].size();
276 Sf.boundaryFieldRef()[procNccPatchi].resize(size,
Zero);
277 Cf.boundaryFieldRef()[procNccPatchi].resize(size,
Zero);
286 NullObjectRef<surfaceScalarField>(),
294 forAll(procMeshes_, proci)
299 procMeshes_[proci].boundary()[
patchi];
304 isA<nonConformalCoupledFvPatch>(fvp)
305 && refCast<const nonConformalCoupledFvPatch>(fvp).owner()
310 label nbrProci = -1, nbrNccPatchi = -1;
311 if (isA<cyclicFvPatch>(fvp))
315 refCast<const cyclicFvPatch>(fvp).nbrPatchID();
317 else if (isA<processorCyclicFvPatch>(fvp))
319 typedef processorCyclicFvPatch PcFvp;
321 const PcFvp& pcFvp = refCast<const PcFvp>(fvp);
323 nbrProci = pcFvp.neighbProcNo();
325 const fvBoundaryMesh& nbrFvPatches =
326 procMeshes_[nbrProci].boundary();
328 forAll(nbrFvPatches, nbrNccPatchj)
330 const fvPatch& nbrFvp =
331 nbrFvPatches[nbrNccPatchj];
333 if (isA<PcFvp>(nbrFvp))
335 const PcFvp& nbrPcFvp =
336 refCast<const PcFvp>(nbrFvp);
340 nbrPcFvp.neighbProcNo()
342 && nbrPcFvp.referPatchID()
343 == pcFvp.referPatch().nbrPatchID()
346 nbrNccPatchi = nbrNccPatchj;
352 if (nbrNccPatchi == -1)
355 <<
"Opposite processor patch not found for "
356 <<
"patch " << fvp.name() <<
" on proc #"
363 <<
"Non-conformal-coupled type not recognised "
364 <<
"for patch " << fvp.name() <<
" on proc #"
368 checkNonConformalCoupledPatchOrdering
371 procMeshes_[proci].boundary()[nccPatchi],
372 procMeshes_[nbrProci].
boundary()[nbrNccPatchi],
373 procMeshes_[proci].polyFacesBf()[nccPatchi],
374 procMeshes_[nbrProci].polyFacesBf()[nbrNccPatchi]
379 if (isA<nonConformalErrorFvPatch>(fvp))
383 checkNonConformalErrorPatchOrdering
386 procMeshes_[proci].
boundary()[ncePatchi],
387 procMeshes_[proci].polyFacesBf()[ncePatchi]
394 else if (completeConformal() && !procsConformal())
402 completeMesh().polyFacesBf()
407 forAll(procMeshes_, proci)
409 const fvMesh& procMesh = procMeshes_[proci];
412 procFaceAddressingBf()[proci];
414 forAll(procMesh.boundary(), procNccPatchi)
416 const fvPatch& fvp = procMesh.boundary()[procNccPatchi];
418 if (isA<nonConformalFvPatch>(fvp))
420 const label completeNccPatchi =
421 isA<processorCyclicFvPatch>(fvp)
422 ? refCast<const processorCyclicFvPatch>(fvp)
429 max(
mag(faceAddressingBf[procNccPatchi])),
430 polyFacesBf[completeNccPatchi].size()
433 polyFacesBf[completeNccPatchi].resize(size, -1);
434 Sf.boundaryFieldRef()[completeNccPatchi].resize(size,
Zero);
435 Cf.boundaryFieldRef()[completeNccPatchi].resize(size,
Zero);
437 polyFacesBf[completeNccPatchi].labelField::rmap
443 procFaceAddressing_[proci],
444 procMesh.polyFacesBf()[procNccPatchi]
447 mag(faceAddressingBf[procNccPatchi]) - 1
453 completeMesh_->unconform
458 NullObjectRef<surfaceScalarField>(),
467 const fvPatch& fvp = completeMesh().boundary()[
patchi];
472 isA<nonConformalCyclicFvPatch>(fvp)
473 && refCast<const nonConformalCoupledFvPatch>(fvp).owner()
478 const label nbrNccPatchi =
479 refCast<const nonConformalCyclicFvPatch>(fvp)
482 checkNonConformalCoupledPatchOrdering
485 completeMesh().boundary()[nccPatchi],
486 completeMesh().boundary()[nbrNccPatchi],
487 completeMesh().polyFacesBf()[nccPatchi],
488 completeMesh().polyFacesBf()[nbrNccPatchi]
493 if (isA<nonConformalErrorFvPatch>(fvp))
497 checkNonConformalErrorPatchOrdering
500 completeMesh().
boundary()[ncePatchi],
501 completeMesh().polyFacesBf()[ncePatchi]
514 Foam::label Foam::domainDecomposition::compareInstances
520 const word& constant = runTimes_.completeTime().constant();
522 if (a == constant &&
b == constant)
return 0;
524 if (a == constant)
return +1;
526 if (
b == constant)
return -1;
528 const scalar aValue = instant(a).value();
529 const scalar bValue = instant(
b).value();
531 if (aValue < bValue)
return +1;
533 if (aValue > bValue)
return -1;
539 void Foam::domainDecomposition::validateComplete()
const
541 if (!completeMesh_.valid())
544 <<
"Complete data requested but complete mesh has not been "
550 void Foam::domainDecomposition::validateProcs()
const
552 if (!procMeshes_.set(0))
555 <<
"Decomposed data requested but decomposed mesh has not been "
561 void Foam::domainDecomposition::readComplete(
const bool stitch)
570 runTimes_.completeTime().name(),
571 runTimes_.completeTime(),
585 void Foam::domainDecomposition::readProcs()
587 for (
label proci = 0; proci < nProcs(); proci++)
597 runTimes_.procTimes()[proci].name(),
598 runTimes_.procTimes()[proci],
610 void Foam::domainDecomposition::readCompleteAddressing()
618 completeMesh().facesInstance(),
619 completeMesh().meshSubDir,
629 void Foam::domainDecomposition::readProcsAddressing()
631 for (
label proci = 0; proci < nProcs(); proci++)
633 const fvMesh& procMesh = procMeshes_[proci];
635 procPointAddressing_[proci] =
640 "pointProcAddressing",
641 procMesh.facesInstance(),
650 procFaceAddressing_[proci] =
655 "faceProcAddressing",
656 procMesh.facesInstance(),
665 procCellAddressing_[proci] =
670 "cellProcAddressing",
671 procMesh.facesInstance(),
683 void Foam::domainDecomposition::readAddressing()
685 readCompleteAddressing();
686 readProcsAddressing();
698 forAll(runTimes_.procTimes(), proci)
712 void Foam::domainDecomposition::writeCompleteAddressing()
const
719 completeMesh().facesInstance(),
720 completeMesh().meshSubDir,
732 void Foam::domainDecomposition::writeProcsAddressing()
const
734 for (
label proci = 0; proci < nProcs(); proci++)
736 const fvMesh& procMesh = procMeshes_[proci];
742 "pointProcAddressing",
743 procMesh.facesInstance(),
749 procPointAddressing_[proci]
751 pointProcAddressing.write();
757 "faceProcAddressing",
758 procMesh.facesInstance(),
764 procFaceAddressing_[proci]
766 faceProcAddressing.write();
772 "cellProcAddressing",
773 procMesh.facesInstance(),
779 procCellAddressing_[proci]
781 cellProcAddressing.write();
786 void Foam::domainDecomposition::writeAddressing()
const
788 writeCompleteAddressing();
789 writeProcsAddressing();
793 void Foam::domainDecomposition::writeProcPoints(
const fileName& inst)
795 IOobject completePointsIo
806 if (!completePointsIo.headerOk())
return;
810 for (
label proci = 0; proci < nProcs(); proci++)
827 procPointAddressing_[proci]
836 void Foam::domainDecomposition::writeCompletePoints(
const fileName& inst)
853 for (
label proci = 0; proci < nProcs(); proci++)
855 IOobject procPointsIo
866 if (!procPointsIo.headerOk())
return;
871 procPointAddressing_[proci]
875 completePoints.write();
889 completeMesh_(nullptr),
890 procMeshes_(nProcs()),
892 procPointAddressing_(nProcs()),
893 procFaceAddressing_(nProcs()),
894 procCellAddressing_(nProcs()),
895 procFaceAddressingBf_()
914 completeMesh().facesInstance(),
921 completeMesh().facesInstance(),
922 completeMesh().meshDir(),
923 runTimes_.procTimes()[0]
927 "cellProcAddressing",
928 completeMesh().facesInstance(),
929 completeMesh().meshDir(),
930 runTimes_.procTimes()[0]
945 readCompleteAddressing();
948 <<
nl <<
" Processor meshes exist but have no addressing."
949 <<
nl <<
nl <<
" This could be because the processor meshes "
950 <<
"have changed. Decomposing the" <<
nl <<
" mesh would "
951 <<
"overwrite that change. If you are sure that this is "
952 <<
"appropriate," <<
nl <<
" then delete the "
954 <<
" directories and re-run this" <<
nl <<
" command."
964 completeMesh().facesInstance()
965 != runTimes_.completeTime().name()
966 && completeMesh().facesInstance()
967 != runTimes_.completeTime().constant()
971 <<
"Cannot begin mesh decomposition at time "
972 <<
fileName(runTimes_.completeTime().name()) <<
nl
973 <<
"The mesh at this instant is that of an earlier"
974 <<
" time " << completeMesh().facesInstance() <<
nl
975 <<
"Decomposition must start from this earlier time"
982 if (!completeConformal())
984 procFaceAddressingBf_.clear();
985 forAll(procMeshes_, proci) procMeshes_[proci].conform();
993 writeProcPoints(completeMesh().facesInstance());
1007 procMeshes()[0].facesInstance(),
1008 procMeshes()[0].meshDir(),
1009 runTimes_.completeTime()
1014 procMeshes()[0].facesInstance(),
1015 procMeshes()[0].meshDir(),
1016 runTimes_.completeTime()
1020 "cellProcAddressing",
1021 procMeshes()[0].facesInstance(),
1033 procMeshes()[0].pointsInstance(),
1034 procMeshes()[0].meshDir(),
1035 runTimes_.completeTime()
1038 readComplete(completePointsIo.
headerOk());
1046 readProcsAddressing();
1049 <<
nl <<
" A complete mesh exists but has no "
1050 << addrIo.
name() <<
" addressing." <<
nl <<
nl <<
" This "
1051 <<
"could be because the complete mesh has changed. "
1052 <<
"Reconstructing the" <<
nl <<
" mesh would overwrite "
1053 <<
"that change. If you are sure that this is appropriate,"
1055 <<
" directory and re-run this command." <<
nl <<
nl
1056 <<
" Or, it could be because the complete and processor "
1057 <<
"meshes were decomposed" <<
nl <<
" by a version of "
1058 <<
"OpenFOAM that pre-dates the automatic generation of "
1059 <<
nl <<
" " << addrIo.
name() <<
" addressing. This will be "
1060 <<
"assumed and the " << addrIo.
name() <<
" addressing will"
1061 <<
nl <<
" be re-built" <<
nl <<
endl;
1063 cellProc_ =
labelList(completeMesh().nCells(), -1);
1065 for (
label proci = 0; proci < nProcs(); proci++)
1070 procCellAddressing_[proci]
1074 writeCompleteAddressing();
1077 reconstructPoints();
1083 procMeshes()[0].facesInstance()
1084 != runTimes_.procTimes()[0].name()
1085 && procMeshes()[0].facesInstance()
1086 != runTimes_.procTimes()[0].constant()
1090 <<
"Cannot begin mesh reconstruction at time "
1091 <<
fileName(runTimes_.procTimes()[0].name()) <<
nl
1092 <<
"The mesh at this instant is that of an earlier"
1093 <<
" time " << procMeshes()[0].facesInstance() <<
nl
1094 <<
"Reconstruction must start from this earlier time"
1101 if (!procsConformal())
1103 procFaceAddressingBf_.clear();
1104 completeMesh_->conform();
1108 writeComplete(doSets);
1112 writeCompletePoints(procMeshes()[0].facesInstance());
1125 const label facesCompare =
1128 completeMesh().facesInstance(),
1129 procMeshes_[0].facesInstance()
1133 if (facesCompare == -1)
1141 procFaceAddressingBf_.clear();
1146 if (facesCompare == +1)
1149 <<
"Cannot decompose at time "
1150 << procMeshes_[0].facesInstance()
1151 <<
" because the processor mesh topology has evolved further"
1158 const label pointsCompare =
1161 completeMesh().pointsInstance(),
1162 procMeshes_[0].pointsInstance()
1167 if (pointsCompare == -1)
1173 if (pointsCompare == +1)
1176 <<
"Cannot decompose at time "
1177 << procMeshes_[0].pointsInstance()
1178 <<
" because the processor mesh geometry has evolved further"
1189 procFaceAddressingBf_.clear();
1190 forAll(procMeshes_, proci) procMeshes_[proci].conform();
1205 const label facesCompare =
1208 completeMesh().facesInstance(),
1209 procMeshes_[0].facesInstance()
1213 if (facesCompare == -1)
1216 <<
"Cannot reconstruct at time "
1217 << completeMesh().facesInstance()
1218 <<
" because the complete mesh topology has evolved further"
1225 procFaceAddressingBf_.clear();
1231 if (facesCompare == +1)
1239 const label pointsCompare =
1242 completeMesh().pointsInstance(),
1243 procMeshes_[0].pointsInstance()
1247 if (pointsCompare == -1)
1250 <<
"Cannot reconstruct at time "
1251 << completeMesh().pointsInstance()
1252 <<
" because the complete mesh geometry has evolved further"
1258 if (pointsCompare == +1)
1260 reconstructPoints();
1270 procFaceAddressingBf_.clear();
1271 completeMesh_->conform();
1286 if (procFaceAddressingBf_.empty())
1294 forAll(procMeshes_, proci)
1296 const fvMesh& procMesh = procMeshes_[proci];
1302 if (isA<cyclicFvPatch>(fvp))
1304 refPatchProcPatchTable[procPatchi].insert
1310 else if (isA<processorCyclicFvPatch>(fvp))
1313 refCast<const processorCyclicFvPatch>(fvp);
1326 nonConformalProcFaceAddressingBf(nProcs());
1327 forAll(nonConformalProcFaceAddressingBf, proci)
1329 nonConformalProcFaceAddressingBf[proci].
resize
1331 procMeshes_[proci].
boundary().size()
1334 if (completeMesh().conformal() && procMeshes_[0].conformal())
1338 else if (!completeMesh().conformal())
1342 completeMesh().polyFacesBf();
1347 const fvPatch& fvp = completeMesh().boundary()[nccPatchi];
1349 if (!isA<nonConformalCyclicFvPatch>(fvp))
continue;
1352 refCast<const nonConformalCyclicFvPatch>(fvp);
1354 if (!nccFvp.
owner())
continue;
1358 forAll(polyFacesBf[nccPatchi], nccPatchFacei)
1360 const label facei = polyFacesBf[nccPatchi][nccPatchFacei];
1361 const label celli = completeMesh().faceOwner()[facei];
1362 const label proci = cellProc_[celli];
1364 const label nbrFacei =
1365 polyFacesBf[nccNbrPatchi][nccPatchFacei];
1366 const label nbrCelli =
1367 completeMesh().faceOwner()[nbrFacei];
1368 const label nbrProci = cellProc_[nbrCelli];
1370 const label procNccPatchi =
1371 refPatchProcPatchTable
1372 [nccPatchi][
labelPair(proci, nbrProci)];
1373 const label nbrProcNccPatchi =
1374 refPatchProcPatchTable
1375 [nccNbrPatchi][
labelPair(nbrProci, proci)];
1377 nonConformalProcFaceAddressingBf[proci][procNccPatchi]
1378 .
append(nccPatchFacei + 1);
1379 nonConformalProcFaceAddressingBf[nbrProci][nbrProcNccPatchi]
1380 .
append(nccPatchFacei + 1);
1387 const fvPatch& fvp = completeMesh().boundary()[ncePatchi];
1389 if (!isA<nonConformalErrorFvPatch>(fvp))
continue;
1391 forAll(polyFacesBf[ncePatchi], ncePatchFacei)
1393 const label facei = polyFacesBf[ncePatchi][ncePatchFacei];
1394 const label celli = completeMesh().faceOwner()[facei];
1395 const label proci = cellProc_[celli];
1397 nonConformalProcFaceAddressingBf[proci][ncePatchi]
1398 .
append(ncePatchFacei + 1);
1409 const fvPatch& fvp = completeMesh().boundary()[nccPatchi];
1411 if (!isA<nonConformalCyclicFvPatch>(fvp))
continue;
1414 refCast<const nonConformalCyclicFvPatch>(fvp);
1416 if (!nccFvp.
owner())
continue;
1421 labelPairTable procCounts;
1425 refPatchProcPatchTable[nccPatchi],
1429 procCounts.insert(iter.key(), 0);
1439 const label proci = iter.key().first();
1440 const label nbrProci = iter.key().second();
1442 const labelPair procNbrProcStar(proci, nbrProci);
1443 const labelPair nbrProcProcStar(nbrProci, proci);
1445 const label procNccPatchi =
1446 refPatchProcPatchTable
1447 [nccPatchi][procNbrProcStar];
1448 const label nbrProcNccPatchi =
1449 refPatchProcPatchTable
1450 [nccNbrPatchi][nbrProcProcStar];
1454 .polyFacesBf()[procNccPatchi]
1457 if (iter() >= size)
continue;
1459 const label procFacei =
1460 procMeshes_[proci].polyFacesBf()
1461 [procNccPatchi][iter()];
1462 const label nbrProcFacei =
1463 procMeshes_[nbrProci].polyFacesBf()
1464 [nbrProcNccPatchi][iter()];
1468 procFaceAddressing_[proci][procFacei] - 1,
1469 procFaceAddressing_[nbrProci][nbrProcFacei] - 1
1472 if (faceNbrFace > faceNbrFaceStar)
1474 procNbrProc = procNbrProcStar;
1475 faceNbrFace = faceNbrFaceStar;
1488 const labelPair nbrProcProc(nbrProci, proci);
1490 const label procNccPatchi =
1491 refPatchProcPatchTable[nccPatchi][procNbrProc];
1492 const label nbrProcNccPatchi =
1493 refPatchProcPatchTable[nccNbrPatchi][nbrProcProc];
1495 nonConformalProcFaceAddressingBf
1497 nonConformalProcFaceAddressingBf
1501 procCounts[procNbrProc] ++;
1509 const fvPatch& fvp = completeMesh().boundary()[ncePatchi];
1511 if (!isA<nonConformalErrorFvPatch>(fvp))
continue;
1520 forAll(procCounts, procStari)
1523 procMeshes_[procStari]
1524 .polyFacesBf()[ncePatchi]
1527 if (procCounts[procStari] >= size)
continue;
1529 const label procFacei =
1530 procMeshes_[procStari].polyFacesBf()
1531 [ncePatchi][procCounts[procStari]];
1533 const label faceStari =
1534 procFaceAddressing_[procStari][procFacei] - 1;
1536 if (facei > faceStari)
1549 nonConformalProcFaceAddressingBf
1553 procCounts[proci] ++;
1560 procFaceAddressingBf_.
resize(nProcs());
1561 forAll(procMeshes_, proci)
1563 const fvMesh& procMesh = procMeshes_[proci];
1565 procFaceAddressingBf_.
set
1572 calculatedFvsPatchLabelField::typeName
1580 if (isA<nonConformalFvPatch>(fvp))
1582 procFaceAddressingBf_[proci][procPatchi] =
1583 nonConformalProcFaceAddressingBf[proci][procPatchi];
1585 else if (isA<processorCyclicFvPatch>(fvp))
1587 const label completePatchi =
1588 refCast<const processorCyclicFvPatch>(fvp)
1591 procFaceAddressingBf_[proci][procPatchi] =
1593 - completeMesh().boundaryMesh()[completePatchi].start();
1595 else if (isA<processorFvPatch>(fvp))
1597 procFaceAddressingBf_[proci][procPatchi] =
1602 procFaceAddressingBf_[proci][procPatchi] =
1604 - completeMesh().boundaryMesh()[procPatchi].start();
1610 return procFaceAddressingBf_;
1616 const bool topologyWrite =
1624 completeMesh().write();
1628 if (!topologyWrite)
return;
1637 for (
label proci = 0; proci < nProcs(); proci++)
1639 const fvMesh& procMesh = procMeshes_[proci];
1641 const labelList& cellMap = procCellAddressing()[proci];
1643 const labelList& pointMap = procPointAddressing()[proci];
1649 runTimes_.procTimes()[proci].
name(),
1669 || (pointSets.
empty() && !pointSetObjects.
empty())
1678 const cellSet procSet(*iter());
1702 cSet.
insert(cellMap[iter.key()]);
1707 const faceSet procSet(*iter());
1738 if (!pointSets.
found(iter.key()))
1754 pointSet& cSet = *pointSets[iter.key()];
1760 cSet.
insert(pointMap[iter.key()]);
1789 for (
label proci = 0; proci < nProcs(); proci++)
1791 const fvMesh& procMesh = procMeshes_[proci];
1793 cellMaps.
set(proci, &procCellAddressing_[proci]);
1794 pointMaps.
set(proci, &procPointAddressing_[proci]);
1803 completeMesh().facesInstance(),
1818 completeMesh().facesInstance(),
1837 const bool topologyWrite =
1842 for (
label proci = 0; proci < nProcs(); proci++)
1844 const fvMesh& procMesh = procMeshes_[proci];
1855 if (!topologyWrite)
return;
1864 completeMesh().facesInstance(),
1898 for (
label proci = 0; proci < nProcs(); proci++)
1900 const fvMesh& procMesh = procMeshes_[proci];
1906 forAll(procCellAddressing_[proci], i)
1908 if (cs.
found(procCellAddressing_[proci][i]))
1919 forAll(procFaceAddressing_[proci], i)
1921 if (cs.
found(
mag(procFaceAddressing_[proci][i]) - 1))
1932 forAll(procPointAddressing_[proci], i)
1934 if (cs.
found(procPointAddressing_[proci][i]))
1950 completeMesh().facesInstance(),
1958 for (
label proci = 0; proci < nProcs(); proci++)
1960 const fvMesh& procMesh = procMeshes_[proci];
1967 completeMesh().facesInstance(),
1975 procCellAddressing_[proci],
1976 procPointAddressing_[proci]
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Generic GeometricBoundaryField class.
GeometricBoundaryField< Type, PatchField, GeoMesh > Boundary
Type of the boundary field.
static const GeometricField< Type, PatchField, GeoMesh > & null()
Return a null geometric field.
A HashTable specialisation for hashing pointers.
bool insert(const Key &key)
Insert a new entry.
An STL-conforming hash table.
bool set(const Key &, const T &newElmt)
Assign a new hashedEntry, overwriting existing entries.
label size() const
Return number of elements in table.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
bool empty() const
Return true if the hash table is empty.
bool found(const Key &) const
Return true if hashedEntry is found in table.
List of IOobjects with searching and retrieving facilities.
IOobjectList lookupClass(const word &className) const
Return the list for all IOobjects of a given class.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
fileName relativePath() const
Return the path relative to the case directory.
fileName & instance() const
Return the instance directory, constant, system, <time> etc.
bool headerOk()
Read header of local object without type-checking.
const word & name() const
Return name.
static unsigned int defaultPrecision()
Return the default precision.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void append(const T &)
Append an element at the end of the list.
void resize(const label)
Alias for setSize(const label)
void size(const label)
Override size to be inconsistent with allocated storage.
const Type & second() const
Return second.
const Type & first() const
Return first.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
bool set(const label) const
Is element set.
void append(T *)
Append an element at the end of the list.
A List with indirect addressing.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
bool set(const label) const
Is element set.
A collection of cell labels.
virtual label nbrPatchID() const
Return neighbour.
Automatic domain decomposition class for finite-volume meshes.
label nProcs() const
Return the number of processors in the decomposition.
void writeProcs(const bool doSets) const
Write the decomposed meshes and associated data.
bool readDecompose(const bool doSets)
Read in the complete mesh. Read the processor meshes if they are.
void writeComplete(const bool doSets) const
Write the decomposed meshes and associated data.
bool readReconstruct(const bool doSets)
Read in the processor meshes. Read the complete mesh if it is.
const PtrList< surfaceLabelField::Boundary > & procFaceAddressingBf() const
Access the labels of faces for each processor (see notes above)
const fvMesh & completeMesh() const
Access the global mesh.
domainDecomposition(const processorRunTimes &procRunTimes, const word ®ionName)
Construct from processor run times and region name.
fvMesh::readUpdateState readUpdateReconstruct()
Read-update for reconstruction.
fvMesh::readUpdateState readUpdateDecompose()
Read-update for decomposition.
virtual ~domainDecomposition()
Destructor.
A class for handling file names.
word name() const
Return file name (part beyond last /)
Mesh data needed to do the Finite Volume discretisation.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
virtual bool write(const bool write=true) const
Write mesh using IO settings from time.
const word & name() const
Return reference to name.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
const List< T >::subList patchSlice(const List< T > &l) const
Slice list to patch.
Various for reading/decomposing/reconstructing/distributing refinement data.
readUpdateState
Enumeration defining the state of the mesh after a read update.
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
label referPatchID() const
Return the referring patch ID.
virtual int neighbProcNo() const
Return neighbour processor number.
Transfers refinement levels such that slow transition between levels is maintained....
virtual bool write(const bool write=true) const
Write using setting from DB.
Templated form of IOobject providing type information for file reading and header type checking.
bool headerOk()
Read header (uses typeGlobalFile to find file) and check.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define WarningInFunction
Report a warning using Foam::Warning.
#define InfoInFunction
Report an information message using Foam::Info.
tmp< VolField< typename outerProduct< vector, Type >::type > > reconstruct(const SurfaceField< Type > &ssf)
errorManipArg< error, int > exit(error &err, const int errNo=1)
Pair< label > labelPair
Label pair.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
vectorField pointField
pointField is a vectorField.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
dimensioned< scalar > mag(const dimensioned< Type > &)
vectorIOField pointIOField
pointIOField is a vectorIOField.
defineTypeNameAndDebug(combustionModel, 0)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
IOList< label > labelIOList
Label container classes.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
Field< label > labelField
Specialisation of Field<T> for label.
label count(const ListType &l, typename ListType::const_reference x)
Count the number of occurrences of a value in a list.
static const label labelMax
SurfaceField< vector > surfaceVectorField
Ostream & indent(Ostream &os)
Indent stream.
faceListList boundary(nPatches)