49 if (polyFacesPf.
size() != nbrPolyFacesPf.
size())
52 <<
"Coupled patches " << fvp.
name() <<
" and "
53 << nbrFvp.
name() <<
" are not the same size"
57 if (polyFacesPf.
size())
59 for (
label i = 1; i < polyFacesPf.
size(); ++ i)
63 polyFacesPf[i - 1] > polyFacesPf[i]
65 : polyFacesPf[i - 1] == polyFacesPf[i]
66 ? nbrPolyFacesPf[i - 1] >= nbrPolyFacesPf[i]
71 <<
"Coupled patches " << fvp.
name()
72 <<
" and " << nbrFvp.
name()
73 <<
" are not in order";
75 if (procs[0] == procs[1])
78 <<
" on process #" << procs[0];
88 <<
"Coupled patches " << fvp.
name()
89 <<
" and " << nbrFvp.
name()
90 <<
" are in order" <<
endl;
105 if (polyFacesPf[i - 1] > polyFacesPf[i])
108 <<
"Error patch " << fvp.
name()
109 <<
" is not in order";
114 <<
" on process #" << proci;
124 <<
"Error patch " << fvp.
name()
125 <<
" is in order" <<
endl;
131 const fvMesh& completeMesh,
142 isA<nonConformalCyclicFvPatch>(fvp)
143 && refCast<const nonConformalCoupledFvPatch>(fvp).owner()
147 const label nbrNccPatchi =
148 refCast<const nonConformalCyclicFvPatch>(fvp)
155 completeMesh.
boundary()[nbrNccPatchi],
164 isA<nonConformalMappedWallFvPatch>(fvp)
165 && refCast<const nonConformalMappedWallFvPatch>(fvp).owner()
169 refCast<const nonConformalMappedWallFvPatch>(fvp);
177 const label nbrNcmwPatchi =
178 nbrCompleteMesh.boundary()[ncmwFvp.
nbrPatchName()].index();
183 completeMesh.
boundary()[ncmwPatchi],
184 nbrCompleteMesh.boundary()[nbrNcmwPatchi],
186 nbrCompleteMesh.polyFacesBf()[ncmwPatchi]
191 if (isA<nonConformalErrorFvPatch>(fvp))
217 procMeshes[proci].boundary()[
patchi];
222 isA<nonConformalCoupledFvPatch>(fvp)
223 && refCast<const nonConformalCoupledFvPatch>(fvp).owner()
228 label nbrProci = -1, nbrNccPatchi = -1;
229 if (isA<cyclicFvPatch>(fvp))
233 refCast<const cyclicFvPatch>(fvp).nbrPatchIndex();
235 else if (isA<processorCyclicFvPatch>(fvp))
239 const PcFvp& pcFvp = refCast<const PcFvp>(fvp);
241 nbrProci = pcFvp.neighbProcNo();
244 procMeshes[nbrProci].boundary();
246 forAll(nbrFvPatches, nbrNccPatchj)
249 nbrFvPatches[nbrNccPatchj];
251 if (isA<PcFvp>(nbrFvp))
253 const PcFvp& nbrPcFvp =
254 refCast<const PcFvp>(nbrFvp);
258 nbrPcFvp.neighbProcNo()
260 && nbrPcFvp.referPatchIndex()
261 == pcFvp.referPatch().nbrPatchIndex()
264 nbrNccPatchi = nbrNccPatchj;
270 if (nbrNccPatchi == -1)
273 <<
"Opposite processor patch not found for "
274 <<
"patch " << fvp.
name() <<
" on proc #"
281 <<
"Non-conformal-coupled type not recognised "
282 <<
"for patch " << fvp.
name() <<
" on proc #"
289 procMeshes[proci].boundary()[nccPatchi],
290 procMeshes[nbrProci].
boundary()[nbrNccPatchi],
291 procMeshes[proci].polyFacesBf()[nccPatchi],
292 procMeshes[nbrProci].polyFacesBf()[nbrNccPatchi]
299 isA<nonConformalMappedWallFvPatch>(fvp)
300 && refCast<const nonConformalMappedWallFvPatch>(fvp).owner()
306 refCast<const nonConformalMappedWallFvPatch>(fvp);
312 const NcmpfFvsplf& polyFacesPf =
313 refCast<const NcmpfFvsplf>
314 (procMeshes[proci].polyFacesBf()[ncmwPatchi]);
316 forAll(procMeshes, nbrProci)
318 const fvMesh& nbrProcMesh =
320 .procMeshes()[nbrProci];
324 const label nbrNcmwPatchi =
330 refCast<const nonConformalMappedWallFvPatch>
331 (nbrProcMesh.
boundary()[nbrNcmwPatchi]);
333 const NcmpfFvsplf& nbrPolyFacesPf =
334 refCast<const NcmpfFvsplf>
344 procMeshes[proci].polyFacesBf()[ncmwPatchi],
345 polyFacesPf.procSizes()[nbrProci],
346 polyFacesPf.procOffsets()[nbrProci]
351 nbrPolyFacesPf.procSizes()[proci],
352 nbrPolyFacesPf.procOffsets()[proci]
359 if (isA<nonConformalErrorFvPatch>(fvp))
366 procMeshes[proci].
boundary()[ncePatchi],
367 procMeshes[proci].polyFacesBf()[ncePatchi]
380 bool Foam::domainDecomposition::sortReconstructNonConformalCyclicAddressing_ =
383 "sortReconstructNonConformalCyclicAddressing",
390 bool Foam::domainDecomposition::completeConformal()
const
396 bool Foam::domainDecomposition::procsConformal()
const
398 forAll(procMeshes_, proci)
400 if (!procMeshes_[proci].conformal())
410 Foam::labelList Foam::domainDecomposition::completeFaceAddressing()
const
414 forAll(procMeshes_, proci)
416 forAll(procFaceAddressing()[proci], procFacei)
419 mag(procFaceAddressing()[proci][procFacei]) - 1;
421 result[facei] = result[facei] == -
labelMax ? procFacei : -1;
430 Foam::domainDecomposition::nonConformalCyclicProcCyclics()
const
432 List<labelPairLabelTable> result(completeMesh().
boundary().size());
434 forAll(procMeshes_, proci)
436 const fvMesh& procMesh = procMeshes_[proci];
438 forAll(procMesh.boundary(), procPatchi)
440 const fvPatch& fvp = procMesh.boundary()[procPatchi];
442 if (isA<nonConformalCyclicFvPatch>(fvp))
444 result[procPatchi].insert
451 if (isA<nonConformalProcessorCyclicFvPatch>(fvp))
453 const processorCyclicFvPatch& pcFvp =
454 refCast<const processorCyclicFvPatch>(fvp);
456 result[pcFvp.referPatchIndex()].insert
470 Foam::domainDecomposition::nonConformalMappedWallProcOffsets
472 const bool appendSize
475 PtrList<labelListList> result(completeMesh().
boundary().size());
478 completeMesh().polyFacesBf();
482 const fvPatch& fvp = completeMesh().boundary()[ncmwPatchi];
484 if (!isA<nonConformalMappedWallFvPatch>(fvp))
continue;
486 const nonConformalMappedWallFvPatch& ncmwFvp =
487 refCast<const nonConformalMappedWallFvPatch>(fvp);
489 const domainDecomposition& nbrDecomposition =
490 regionMeshes_[ncmwFvp.nbrRegionName()]();
492 const fvMesh& nbrCompleteMesh = nbrDecomposition.completeMesh();
494 const label nbrNcmwPatchi =
495 nbrCompleteMesh.boundary()[ncmwFvp.nbrPatchName()].index();
498 nbrCompleteMesh.polyFacesBf();
509 forAll(polyFacesBf[ncmwPatchi], ncmwPatchFacei)
511 const label facei = polyFacesBf[ncmwPatchi][ncmwPatchFacei];
512 const label celli = completeMesh().faceOwner()[facei];
513 const label proci = cellProc_[celli];
515 const label nbrFacei =
516 nbrPolyFacesBf[nbrNcmwPatchi][ncmwPatchFacei];
517 const label nbrCelli =
518 nbrCompleteMesh.faceOwner()[nbrFacei];
519 const label nbrProci = nbrDecomposition.cellProc()[nbrCelli];
521 procNbrProcCounts[proci][nbrProci] ++;
525 forAll(procNbrProcCounts, proci)
529 forAll(procNbrProcCounts[proci], nbrProci)
532 count += procNbrProcCounts[proci][nbrProci];
533 procNbrProcCounts[proci][nbrProci] = count0;
538 procNbrProcCounts[proci].last() =
count;
547 void Foam::domainDecomposition::decomposeNonConformalCyclicAddressing
549 const label nccPatchi,
550 const List<labelPairLabelTable>& nonConformalCyclicProcCyclics,
551 List<List<DynamicList<label>>>& nonConformalProcFaceAddressingBf
555 completeMesh().polyFacesBf();
557 const nonConformalCyclicFvPatch& nccFvp =
558 refCast<const nonConformalCyclicFvPatch>
560 completeMesh().
boundary()[nccPatchi]
563 if (!nccFvp.owner())
return;
565 const label nbrNccPatchi = nccFvp.nbrPatchIndex();
567 forAll(polyFacesBf[nccPatchi], nccPatchFacei)
569 const label facei = polyFacesBf[nccPatchi][nccPatchFacei];
570 const label celli = completeMesh().faceOwner()[facei];
571 const label proci = cellProc_[celli];
573 const label nbrFacei = polyFacesBf[nbrNccPatchi][nccPatchFacei];
574 const label nbrCelli = completeMesh().faceOwner()[nbrFacei];
575 const label nbrProci = cellProc_[nbrCelli];
577 const label procNccPatchi =
578 nonConformalCyclicProcCyclics
580 const label nbrProcNccPatchi =
581 nonConformalCyclicProcCyclics
582 [nbrNccPatchi][
labelPair(nbrProci, proci)];
584 nonConformalProcFaceAddressingBf[proci][procNccPatchi]
585 .append(nccPatchFacei + 1);
586 nonConformalProcFaceAddressingBf[nbrProci][nbrProcNccPatchi]
587 .append(nccPatchFacei + 1);
592 void Foam::domainDecomposition::decomposeNonConformalMappedWallAddressing
594 const label ncmwPatchi,
595 PtrList<labelListList>& nonConformalMappedWallProcOffsets,
596 List<List<DynamicList<label>>>& nonConformalProcFaceAddressingBf
600 completeMesh().polyFacesBf();
602 const nonConformalMappedWallFvPatch& ncmwFvp =
603 refCast<const nonConformalMappedWallFvPatch>
605 completeMesh().
boundary()[ncmwPatchi]
608 const domainDecomposition& nbrDecomposition =
609 regionMeshes_[ncmwFvp.nbrRegionName()]();
611 const fvMesh& nbrCompleteMesh = nbrDecomposition.completeMesh();
614 nbrCompleteMesh.polyFacesBf();
616 const label nbrNcmwPatchi =
617 nbrCompleteMesh.boundary()[ncmwFvp.nbrPatchName()].index();
621 nonConformalMappedWallProcOffsets[ncmwPatchi];
622 forAll(procOffsets, proci)
624 nonConformalProcFaceAddressingBf[proci][ncmwPatchi]
625 .resize(procOffsets[proci].last());
630 forAll(polyFacesBf[ncmwPatchi], ncmwPatchFacei)
632 const label facei = polyFacesBf[ncmwPatchi][ncmwPatchFacei];
633 const label celli = completeMesh().faceOwner()[facei];
634 const label proci = cellProc_[celli];
636 const label nbrFacei = nbrPolyFacesBf[nbrNcmwPatchi][ncmwPatchFacei];
637 const label nbrCelli = nbrCompleteMesh.faceOwner()[nbrFacei];
638 const label nbrProci = nbrDecomposition.cellProc()[nbrCelli];
640 nonConformalProcFaceAddressingBf
641 [proci][ncmwPatchi][procOffsets[proci][nbrProci] ++] =
647 void Foam::domainDecomposition::decomposeNonConformalErrorAddressing
649 const label ncePatchi,
650 List<List<DynamicList<label>>>& nonConformalProcFaceAddressingBf
654 completeMesh().polyFacesBf();
656 forAll(polyFacesBf[ncePatchi], ncePatchFacei)
658 const label facei = polyFacesBf[ncePatchi][ncePatchFacei];
659 const label celli = completeMesh().faceOwner()[facei];
660 const label proci = cellProc_[celli];
662 nonConformalProcFaceAddressingBf[proci][ncePatchi]
663 .append(ncePatchFacei + 1);
668 void Foam::domainDecomposition::reconstructNonConformalCyclicAddressing
670 const label nccPatchi,
671 const List<labelPairLabelTable>& nonConformalCyclicProcCyclics,
672 List<List<DynamicList<label>>>& nonConformalProcFaceAddressingBf
675 const nonConformalCyclicFvPatch& nccFvp =
676 refCast<const nonConformalCyclicFvPatch>
678 completeMesh().
boundary()[nccPatchi]
681 if (!nccFvp.owner())
return;
683 const label nbrNccPatchi = nccFvp.nbrPatchIndex();
685 label nccPatchFacei = 0;
686 labelPairLabelTable procNccPatchFaceis;
690 nonConformalCyclicProcCyclics[nccPatchi],
694 procNccPatchFaceis.insert(iter.key(), 0);
704 const label proci = iter.key().first();
705 const label nbrProci = iter.key().second();
707 const labelPair procNbrProcStar(proci, nbrProci);
708 const labelPair nbrProcProcStar(nbrProci, proci);
710 const label procNccPatchi =
711 nonConformalCyclicProcCyclics[nccPatchi][procNbrProcStar];
712 const label nbrProcNccPatchi =
713 nonConformalCyclicProcCyclics[nbrNccPatchi][nbrProcProcStar];
715 const label procNccPatchFacei = iter();
717 procMeshes_[proci].polyFacesBf()[procNccPatchi].size();
719 if (procNccPatchFacei >= size)
continue;
721 const label procFacei =
722 procMeshes_[proci].polyFacesBf()
723 [procNccPatchi][procNccPatchFacei];
724 const label nbrProcFacei =
725 procMeshes_[nbrProci].polyFacesBf()
726 [nbrProcNccPatchi][procNccPatchFacei];
730 procFaceAddressing_[proci][procFacei] - 1,
731 procFaceAddressing_[nbrProci][nbrProcFacei] - 1
734 if (faceNbrFace > faceNbrFaceStar)
736 procNbrProc = procNbrProcStar;
737 faceNbrFace = faceNbrFaceStar;
747 const label proci = procNbrProc.first();
748 const label nbrProci = procNbrProc.second();
750 const labelPair nbrProcProc(nbrProci, proci);
752 const label procNccPatchi =
753 nonConformalCyclicProcCyclics[nccPatchi][procNbrProc];
754 const label nbrProcNccPatchi =
755 nonConformalCyclicProcCyclics[nbrNccPatchi][nbrProcProc];
757 nonConformalProcFaceAddressingBf[proci][procNccPatchi]
758 .append(nccPatchFacei + 1);
759 nonConformalProcFaceAddressingBf[nbrProci][nbrProcNccPatchi]
760 .append(nccPatchFacei + 1);
763 procNccPatchFaceis[procNbrProc] ++;
769 void Foam::domainDecomposition::sortReconstructNonConformalCyclicAddressing
771 const label nccPatchi,
772 const List<labelPairLabelTable>& nonConformalCyclicProcCyclics,
773 List<List<DynamicList<label>>>& nonConformalProcFaceAddressingBf
776 const nonConformalCyclicFvPatch& nccFvp =
777 refCast<const nonConformalCyclicFvPatch>
779 completeMesh().
boundary()[nccPatchi]
782 if (!nccFvp.owner())
return;
784 const label nbrNccPatchi = nccFvp.nbrPatchIndex();
790 nonConformalCyclicProcCyclics[nccPatchi],
794 const label proci = iter.key().first();
795 const label nbrProci = iter.key().second();
797 const label procNccPatchi = iter();
798 const label nbrProcNccPatchi =
799 nonConformalCyclicProcCyclics
800 [nbrNccPatchi][
labelPair(nbrProci, proci)];
803 procMeshes_[proci].polyFacesBf()[procNccPatchi];
805 procMeshes_[nbrProci].polyFacesBf()[nbrProcNccPatchi];
807 nonConformalProcFaceAddressingBf[proci][procNccPatchi]
808 .resize(procPolyFacesPf.size());
809 nonConformalProcFaceAddressingBf[nbrProci][nbrProcNccPatchi]
810 .resize(nbrProcPolyFacesPf.size());
814 const fvPatch& origFvp = nccFvp.origPatch();
815 const fvPatch& nbrOrigFvp = nccFvp.nbrPatch().origPatch();
819 DynamicList<FixedList<label, 7>> indices;
823 nonConformalCyclicProcCyclics[nccPatchi],
827 const label proci = iter.key().first();
828 const label nbrProci = iter.key().second();
830 const label procNccPatchi = iter();
831 const label nbrProcNccPatchi =
832 nonConformalCyclicProcCyclics
833 [nbrNccPatchi][
labelPair(nbrProci, proci)];
836 procMeshes_[proci].polyFacesBf()[procNccPatchi];
838 procMeshes_[nbrProci].polyFacesBf()[nbrProcNccPatchi];
840 forAll(procPolyFacesPf, procPatchFacei)
842 const label procPolyFacei =
843 procPolyFacesPf[procPatchFacei];
844 const label nbrProcPolyFacei =
845 nbrProcPolyFacesPf[procPatchFacei];
847 const label completePolyFacei =
848 procFaceAddressing_[proci][procPolyFacei] - 1;
849 const label nbcCompletePolyFacei =
850 procFaceAddressing_[nbrProci][nbrProcPolyFacei] - 1;
858 completePolyFacei - origFvp.start(),
859 nbcCompletePolyFacei - nbrOrigFvp.start(),
869 [](
const FixedList<label, 7>& a,
const FixedList<label, 7>&
b)
878 const label proci = indices[i][0];
879 const label nbrProci = indices[i][1];
880 const label procNccPatchi = indices[i][2];
881 const label nbrProcNccPatchi = indices[i][3];
884 const label procPatchFacei = indices[i][6];
886 nonConformalProcFaceAddressingBf
887 [proci][procNccPatchi][procPatchFacei] = i + 1;
888 nonConformalProcFaceAddressingBf
889 [nbrProci][nbrProcNccPatchi][procPatchFacei] = i + 1;
894 void Foam::domainDecomposition::reconstructNonConformalMappedWallAddressing
896 const label ncmwPatchi,
897 List<List<DynamicList<label>>>& nonConformalProcFaceAddressingBf
900 const nonConformalMappedWallFvPatch& ncmwFvp =
901 refCast<const nonConformalMappedWallFvPatch>
903 completeMesh().
boundary()[ncmwPatchi]
906 const bool owner = ncmwFvp.owner();
908 const domainDecomposition& nbrDecomposition =
909 regionMeshes_[ncmwFvp.nbrRegionName()]();
911 const label nbrNcmwPatchi =
912 nbrDecomposition.completeMesh()
913 .boundary()[ncmwFvp.nbrPatchName()]
916 auto calcProcOffsets = []
918 const domainDecomposition& meshes,
919 const label ncmwPatchi
924 forAll(meshes.procMeshes(), proci)
927 nonConformalMappedPolyFacesFvsPatchLabelField
930 const NcmpfFvsplf& polyFacesPf =
931 refCast<const NcmpfFvsplf>
932 (meshes.procMeshes()[proci].polyFacesBf()[ncmwPatchi]);
934 result[proci] = polyFacesPf.procOffsets();
935 result[proci].append(polyFacesPf.size());
941 calcProcOffsets(*
this, ncmwPatchi);
943 calcProcOffsets(nbrDecomposition, nbrNcmwPatchi);
945 label ncmwPatchFacei = 0;
953 forAll(procNcmwPatchFaceis, proci)
955 forAll(procNcmwPatchFaceis[proci], nbrProci)
957 const labelPair procNbrProcStar(proci, nbrProci);
959 const label procNcmwPatchFacei =
960 procNcmwPatchFaceis[proci][nbrProci];
962 procOffsets[proci][nbrProci + 1]
963 - procOffsets[proci][nbrProci];
965 if (procNcmwPatchFacei >= size)
continue;
967 const label procFacei =
968 procMeshes_[proci].polyFacesBf()
970 [procNcmwPatchFacei + procOffsets[proci][nbrProci]];
971 const label nbrProcFacei =
972 nbrDecomposition.procMeshes()[nbrProci].polyFacesBf()
974 [procNcmwPatchFacei + nbrProcOffsets[nbrProci][proci]];
978 procFaceAddressing_[proci][procFacei] - 1,
980 .procFaceAddressing_[nbrProci][nbrProcFacei] - 1
986 ? faceNbrFace > faceNbrFaceStar
990 procNbrProc = procNbrProcStar;
991 faceNbrFace = faceNbrFaceStar;
1002 const label proci = procNbrProc.first();
1003 const label nbrProci = procNbrProc.second();
1005 nonConformalProcFaceAddressingBf[proci][ncmwPatchi]
1006 .append(ncmwPatchFacei + 1);
1009 procNcmwPatchFaceis[proci][nbrProci] ++;
1015 void Foam::domainDecomposition::reconstructNonConformalErrorAddressing
1017 const label ncePatchi,
1018 List<List<DynamicList<label>>>& nonConformalProcFaceAddressingBf
1021 label ncePatchFacei = 0;
1022 labelList procNcePatchFaceis(nProcs(), 0);
1028 forAll(procNcePatchFaceis, procStari)
1031 procMeshes_[procStari].polyFacesBf()[ncePatchi].size();
1033 if (procNcePatchFaceis[procStari] >= size)
continue;
1035 const label procFacei =
1036 procMeshes_[procStari].polyFacesBf()
1037 [ncePatchi][procNcePatchFaceis[procStari]];
1039 const label faceStari =
1040 procFaceAddressing_[procStari][procFacei] - 1;
1042 if (facei > faceStari)
1055 nonConformalProcFaceAddressingBf[proci][ncePatchi]
1056 .append(ncePatchFacei + 1);
1059 procNcePatchFaceis[proci] ++;
1066 Foam::domainDecomposition::nonConformalProcFaceAddressingBf()
const
1072 List<List<DynamicList<label>>> result(nProcs());
1075 result[proci].resize
1077 procMeshes_[proci].
boundary().size()
1081 if (completeConformal() && procsConformal())
1085 else if (!completeConformal())
1087 const List<labelPairLabelTable> nonConformalCyclicProcCyclics =
1088 this->nonConformalCyclicProcCyclics();
1090 PtrList<labelListList> nonConformalMappedWallProcOffsets =
1091 this->nonConformalMappedWallProcOffsets(
true);
1096 const fvPatch& fvp = completeMesh().boundary()[ncPatchi];
1098 if (isA<nonConformalCyclicFvPatch>(fvp))
1100 decomposeNonConformalCyclicAddressing
1103 nonConformalCyclicProcCyclics,
1108 if (isA<nonConformalMappedWallFvPatch>(fvp))
1110 decomposeNonConformalMappedWallAddressing
1113 nonConformalMappedWallProcOffsets,
1118 if (isA<nonConformalErrorFvPatch>(fvp))
1120 decomposeNonConformalErrorAddressing(ncPatchi, result);
1126 const List<labelPairLabelTable> nonConformalCyclicProcCyclics =
1127 this->nonConformalCyclicProcCyclics();
1132 const fvPatch& fvp = completeMesh().boundary()[ncPatchi];
1134 if (isA<nonConformalCyclicFvPatch>(fvp))
1136 if (sortReconstructNonConformalCyclicAddressing_)
1138 sortReconstructNonConformalCyclicAddressing
1141 nonConformalCyclicProcCyclics,
1147 reconstructNonConformalCyclicAddressing
1150 nonConformalCyclicProcCyclics,
1156 if (isA<nonConformalMappedWallFvPatch>(fvp))
1158 reconstructNonConformalMappedWallAddressing(ncPatchi, result);
1161 if (isA<nonConformalErrorFvPatch>(fvp))
1163 reconstructNonConformalErrorAddressing(ncPatchi, result);
1172 void Foam::domainDecomposition::unconformComplete()
1177 completeMesh().polyFacesBf()
1182 forAll(procMeshes_, proci)
1184 const fvMesh& procMesh = procMeshes_[proci];
1187 procFaceAddressingBf()[proci];
1189 forAll(procMesh.boundary(), procNcPatchi)
1191 const fvPatch& fvp = procMesh.boundary()[procNcPatchi];
1193 if (!isA<nonConformalFvPatch>(fvp))
continue;
1195 const label completeNcPatchi =
1196 isA<processorCyclicFvPatch>(fvp)
1197 ? refCast<const processorCyclicFvPatch>(fvp)
1204 max(
mag(faceAddressingBf[procNcPatchi])),
1205 polyFacesBf[completeNcPatchi].size()
1208 polyFacesBf[completeNcPatchi].resize(size, -1);
1209 polyFacesBf[completeNcPatchi].labelField::rmap
1215 procFaceAddressing_[proci],
1216 procMesh.polyFacesBf()[procNcPatchi]
1219 mag(faceAddressingBf[procNcPatchi]) - 1
1224 Sf.boundaryFieldRef()[completeNcPatchi].resize(size,
Zero);
1225 Cf.boundaryFieldRef()[completeNcPatchi].resize(size,
Zero);
1229 completeMesh_->unconform
1234 NullObjectRef<surfaceScalarField>(),
1238 completeMesh_->setPolyFacesBfInstance(procMeshes_[0].polyFacesBfInstance());
1247 void Foam::domainDecomposition::unconformProcs()
1249 const labelList completeFaceAddressing =
1250 this->completeFaceAddressing();
1252 const PtrList<labelListList> nonConformalMappedWallProcOffsets =
1253 this->nonConformalMappedWallProcOffsets(
false);
1255 forAll(procMeshes_, proci)
1257 fvMesh& procMesh = procMeshes_[proci];
1260 procFaceAddressingBf()[proci];
1265 procMesh.polyFacesBf()
1270 forAll(procMesh.boundary(), procNcPatchi)
1272 const fvPatch& fvp = procMesh.boundary()[procNcPatchi];
1274 if (!isA<nonConformalFvPatch>(fvp))
continue;
1276 const label completeNcPatchi =
1277 isA<processorCyclicFvPatch>(fvp)
1278 ? refCast<const processorCyclicFvPatch>(fvp)
1282 polyFacesBf[procNcPatchi] =
1285 completeFaceAddressing,
1288 completeMesh().polyFacesBf()[completeNcPatchi],
1289 mag(faceAddressingBf[procNcPatchi]) - 1
1293 if (isA<nonConformalMappedWallFvPatch>(fvp))
1296 nonConformalMappedPolyFacesFvsPatchLabelField
1299 refCast<NcmpfFvsplf>(polyFacesBf[procNcPatchi]).procOffsets() =
1300 nonConformalMappedWallProcOffsets[procNcPatchi][proci];
1303 const label size = polyFacesBf[procNcPatchi].size();
1307 Sf.boundaryFieldRef()[procNcPatchi].resize(size,
Zero);
1308 Cf.boundaryFieldRef()[procNcPatchi].resize(size,
Zero);
1316 NullObjectRef<surfaceScalarField>(),
1320 procMesh.setPolyFacesBfInstance(completeMesh().polyFacesBfInstance());
1331 void Foam::domainDecomposition::unconform()
1333 if (completeConformal() && procsConformal())
1337 else if (!completeConformal() && procsConformal())
1341 else if (completeConformal() && !procsConformal())
1343 unconformComplete();
#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.
GeometricBoundaryField< Type, PatchField, GeoMesh > Boundary
Type of the boundary field.
static const GeometricField< Type, PatchField, GeoMesh > & null()
Return a null geometric field.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
A List obtained as a section of another List.
label size() const
Return the number of elements in the UList.
Automatic domain decomposition class for finite-volume meshes.
const fvMesh & completeMesh() const
Access the global mesh.
Mesh data needed to do the Finite Volume discretisation.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
const GeometricBoundaryField< label, fvsPatchField, surfaceMesh > & polyFacesBf() const
Return face-poly-face addressing.
bool conformal() const
Return whether the fvMesh is conformal with the polyMesh.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
virtual label size() const
Return size.
virtual const word & name() const
Return name.
const word & nbrPatchName() const
Name of the patch to map from.
const word & nbrRegionName() const
Name of the region to map from.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define InfoInFunction
Report an information message using Foam::Info.
int optimisationSwitch(const char *name, const int defaultValue=0)
Lookup optimisation switch or add default value.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Pair< label > labelPair
Label pair.
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.
void checkNonConformalErrorPatchOrdering(const label &proci, const fvPatch &fvp, const labelList &polyFacesPf)
void checkProcMeshesOrdering(const PtrList< fvMesh > &procMeshes, const multiDomainDecomposition ®ionMeshes)
void reverse(UList< T > &, const label n)
List< labelList > labelListList
A List of labelList.
dimensioned< scalar > mag(const dimensioned< Type > &)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
Field< label > labelField
Specialisation of Field<T> for label.
void stableSort(UList< T > &)
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
UList< label > labelUList
void checkCompleteMeshOrdering(const fvMesh &completeMesh, const multiDomainDecomposition ®ionMeshes)
void checkNonConformalCoupledPatchOrdering(const labelPair &procs, const fvPatch &fvp, const fvPatch &nbrFvp, const labelUList &polyFacesPf, const labelUList &nbrPolyFacesPf)
faceListList boundary(nPatches)