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],
162 if (isA<nonConformalMappedWallFvPatch>(fvp))
167 refCast<const nonConformalMappedWallFvPatch>(fvp);
177 if (nbrCompleteMesh.conformal())
continue;
179 const label nbrNcmwPatchi =
183 refCast<const nonConformalMappedWallFvPatch>
184 (nbrCompleteMesh.boundary()[nbrNcmwPatchi]);
187 nbrCompleteMesh.polyFacesBf()[nbrNcmwPatchi];
192 ncmwFvp.
owner() ? ncmwFvp : nbrNcmwFvp,
193 ncmwFvp.
owner() ? nbrNcmwFvp : ncmwFvp,
194 ncmwFvp.
owner() ? polyFacesPf : nbrPolyFacesPf,
195 ncmwFvp.
owner() ? nbrPolyFacesPf : polyFacesPf
200 if (isA<nonConformalErrorFvPatch>(fvp))
226 procMeshes[proci].boundary()[
patchi];
231 isA<nonConformalCoupledFvPatch>(fvp)
232 && refCast<const nonConformalCoupledFvPatch>(fvp).owner()
237 label nbrProci = -1, nbrNccPatchi = -1;
238 if (isA<cyclicFvPatch>(fvp))
242 refCast<const cyclicFvPatch>(fvp).nbrPatchIndex();
244 else if (isA<processorCyclicFvPatch>(fvp))
248 const PcFvp& pcFvp = refCast<const PcFvp>(fvp);
250 nbrProci = pcFvp.neighbProcNo();
253 procMeshes[nbrProci].boundary();
255 forAll(nbrFvPatches, nbrNccPatchj)
258 nbrFvPatches[nbrNccPatchj];
260 if (isA<PcFvp>(nbrFvp))
262 const PcFvp& nbrPcFvp =
263 refCast<const PcFvp>(nbrFvp);
267 nbrPcFvp.neighbProcNo()
269 && nbrPcFvp.referPatchIndex()
270 == pcFvp.referPatch().nbrPatchIndex()
273 nbrNccPatchi = nbrNccPatchj;
279 if (nbrNccPatchi == -1)
282 <<
"Opposite processor patch not found for "
283 <<
"patch " << fvp.
name() <<
" on proc #"
290 <<
"Non-conformal-coupled type not recognised "
291 <<
"for patch " << fvp.
name() <<
" on proc #"
298 procMeshes[proci].boundary()[nccPatchi],
299 procMeshes[nbrProci].
boundary()[nbrNccPatchi],
300 procMeshes[proci].polyFacesBf()[nccPatchi],
301 procMeshes[nbrProci].polyFacesBf()[nbrNccPatchi]
306 if (isA<nonConformalMappedWallFvPatch>(fvp))
311 refCast<const nonConformalMappedWallFvPatch>(fvp);
317 const NcmpfFvsplf& polyFacesPf =
318 refCast<const NcmpfFvsplf>
319 (procMeshes[proci].polyFacesBf()[ncmwPatchi]);
321 forAll(procMeshes, nbrProci)
323 const fvMesh& nbrProcMesh =
325 .procMeshes()[nbrProci];
329 const label nbrNcmwPatchi =
335 refCast<const nonConformalMappedWallFvPatch>
336 (nbrProcMesh.
boundary()[nbrNcmwPatchi]);
338 const NcmpfFvsplf& nbrPolyFacesPf =
339 refCast<const NcmpfFvsplf>
344 procMeshes[proci].polyFacesBf()[ncmwPatchi],
345 polyFacesPf.procSizes()[nbrProci],
346 polyFacesPf.procOffsets()[nbrProci]
352 nbrPolyFacesPf.procSizes()[proci],
353 nbrPolyFacesPf.procOffsets()[proci]
359 ncmwFvp.
owner() ? proci : nbrProci,
360 ncmwFvp.
owner() ? nbrProci : proci
362 ncmwFvp.
owner() ? ncmwFvp : nbrNcmwFvp,
363 ncmwFvp.
owner() ? nbrNcmwFvp : ncmwFvp,
364 ncmwFvp.
owner() ? subPolyFacesPf : nbrSubPolyFacesPf,
365 ncmwFvp.owner() ? nbrSubPolyFacesPf : subPolyFacesPf
371 if (isA<nonConformalErrorFvPatch>(fvp))
378 procMeshes[proci].
boundary()[ncePatchi],
379 procMeshes[proci].polyFacesBf()[ncePatchi]
392 bool Foam::domainDecomposition::sortReconstructNonConformalCyclicAddressing_ =
395 "sortReconstructNonConformalCyclicAddressing",
402 bool Foam::domainDecomposition::completeConformal()
const
408 bool Foam::domainDecomposition::procsConformal()
const
410 forAll(procMeshes_, proci)
412 if (!procMeshes_[proci].conformal())
422 Foam::labelList Foam::domainDecomposition::completeFaceAddressing()
const
426 forAll(procMeshes_, proci)
428 forAll(procFaceAddressing()[proci], procFacei)
431 mag(procFaceAddressing()[proci][procFacei]) - 1;
433 result[facei] = result[facei] == -
labelMax ? procFacei : -1;
442 Foam::domainDecomposition::nonConformalCyclicProcCyclics()
const
444 List<labelPairLabelTable> result(completeMesh().
boundary().size());
446 forAll(procMeshes_, proci)
448 const fvMesh& procMesh = procMeshes_[proci];
450 forAll(procMesh.boundary(), procPatchi)
452 const fvPatch& fvp = procMesh.boundary()[procPatchi];
454 if (isA<nonConformalCyclicFvPatch>(fvp))
456 result[procPatchi].insert
463 if (isA<nonConformalProcessorCyclicFvPatch>(fvp))
465 const processorCyclicFvPatch& pcFvp =
466 refCast<const processorCyclicFvPatch>(fvp);
468 result[pcFvp.referPatchIndex()].insert
482 Foam::domainDecomposition::nonConformalMappedWallProcOffsets
484 const bool appendSize
487 PtrList<labelListList> result(completeMesh().
boundary().size());
490 completeMesh().polyFacesBf();
494 const fvPatch& fvp = completeMesh().boundary()[ncmwPatchi];
496 if (!isA<nonConformalMappedWallFvPatch>(fvp))
continue;
498 const nonConformalMappedWallFvPatch& ncmwFvp =
499 refCast<const nonConformalMappedWallFvPatch>(fvp);
501 const domainDecomposition& nbrDecomposition =
502 regionMeshes_[ncmwFvp.nbrRegionName()]();
504 const fvMesh& nbrCompleteMesh = nbrDecomposition.completeMesh();
506 const label nbrNcmwPatchi =
507 nbrCompleteMesh.boundary()[ncmwFvp.nbrPatchName()].index();
510 nbrCompleteMesh.polyFacesBf();
521 forAll(polyFacesBf[ncmwPatchi], ncmwPatchFacei)
523 const label facei = polyFacesBf[ncmwPatchi][ncmwPatchFacei];
524 const label celli = completeMesh().faceOwner()[facei];
525 const label proci = cellProc_[celli];
527 const label nbrFacei =
528 nbrPolyFacesBf[nbrNcmwPatchi][ncmwPatchFacei];
529 const label nbrCelli =
530 nbrCompleteMesh.faceOwner()[nbrFacei];
531 const label nbrProci = nbrDecomposition.cellProc()[nbrCelli];
533 procNbrProcCounts[proci][nbrProci] ++;
537 forAll(procNbrProcCounts, proci)
541 forAll(procNbrProcCounts[proci], nbrProci)
544 count += procNbrProcCounts[proci][nbrProci];
545 procNbrProcCounts[proci][nbrProci] = count0;
550 procNbrProcCounts[proci].last() =
count;
559 void Foam::domainDecomposition::decomposeNonConformalCyclicAddressing
561 const label nccPatchi,
562 const List<labelPairLabelTable>& nonConformalCyclicProcCyclics,
563 List<List<DynamicList<label>>>& nonConformalProcFaceAddressingBf
567 completeMesh().polyFacesBf();
569 const nonConformalCyclicFvPatch& nccFvp =
570 refCast<const nonConformalCyclicFvPatch>
572 completeMesh().
boundary()[nccPatchi]
575 if (!nccFvp.owner())
return;
577 const label nbrNccPatchi = nccFvp.nbrPatchIndex();
579 forAll(polyFacesBf[nccPatchi], nccPatchFacei)
581 const label facei = polyFacesBf[nccPatchi][nccPatchFacei];
582 const label celli = completeMesh().faceOwner()[facei];
583 const label proci = cellProc_[celli];
585 const label nbrFacei = polyFacesBf[nbrNccPatchi][nccPatchFacei];
586 const label nbrCelli = completeMesh().faceOwner()[nbrFacei];
587 const label nbrProci = cellProc_[nbrCelli];
589 const label procNccPatchi =
590 nonConformalCyclicProcCyclics
592 const label nbrProcNccPatchi =
593 nonConformalCyclicProcCyclics
594 [nbrNccPatchi][
labelPair(nbrProci, proci)];
596 nonConformalProcFaceAddressingBf[proci][procNccPatchi]
597 .append(nccPatchFacei + 1);
598 nonConformalProcFaceAddressingBf[nbrProci][nbrProcNccPatchi]
599 .append(nccPatchFacei + 1);
604 void Foam::domainDecomposition::decomposeNonConformalMappedWallAddressing
606 const label ncmwPatchi,
607 PtrList<labelListList>& nonConformalMappedWallProcOffsets,
608 List<List<DynamicList<label>>>& nonConformalProcFaceAddressingBf
612 completeMesh().polyFacesBf();
614 const nonConformalMappedWallFvPatch& ncmwFvp =
615 refCast<const nonConformalMappedWallFvPatch>
617 completeMesh().
boundary()[ncmwPatchi]
620 const domainDecomposition& nbrDecomposition =
621 regionMeshes_[ncmwFvp.nbrRegionName()]();
623 const fvMesh& nbrCompleteMesh = nbrDecomposition.completeMesh();
626 nbrCompleteMesh.polyFacesBf();
628 const label nbrNcmwPatchi =
629 nbrCompleteMesh.boundary()[ncmwFvp.nbrPatchName()].index();
633 nonConformalMappedWallProcOffsets[ncmwPatchi];
634 forAll(procOffsets, proci)
636 nonConformalProcFaceAddressingBf[proci][ncmwPatchi]
637 .resize(procOffsets[proci].last());
642 forAll(polyFacesBf[ncmwPatchi], ncmwPatchFacei)
644 const label facei = polyFacesBf[ncmwPatchi][ncmwPatchFacei];
645 const label celli = completeMesh().faceOwner()[facei];
646 const label proci = cellProc_[celli];
648 const label nbrFacei = nbrPolyFacesBf[nbrNcmwPatchi][ncmwPatchFacei];
649 const label nbrCelli = nbrCompleteMesh.faceOwner()[nbrFacei];
650 const label nbrProci = nbrDecomposition.cellProc()[nbrCelli];
652 nonConformalProcFaceAddressingBf
653 [proci][ncmwPatchi][procOffsets[proci][nbrProci] ++] =
659 void Foam::domainDecomposition::decomposeNonConformalErrorAddressing
661 const label ncePatchi,
662 List<List<DynamicList<label>>>& nonConformalProcFaceAddressingBf
666 completeMesh().polyFacesBf();
668 forAll(polyFacesBf[ncePatchi], ncePatchFacei)
670 const label facei = polyFacesBf[ncePatchi][ncePatchFacei];
671 const label celli = completeMesh().faceOwner()[facei];
672 const label proci = cellProc_[celli];
674 nonConformalProcFaceAddressingBf[proci][ncePatchi]
675 .append(ncePatchFacei + 1);
680 void Foam::domainDecomposition::reconstructNonConformalCyclicAddressing
682 const label nccPatchi,
683 const List<labelPairLabelTable>& nonConformalCyclicProcCyclics,
684 List<List<DynamicList<label>>>& nonConformalProcFaceAddressingBf
687 const nonConformalCyclicFvPatch& nccFvp =
688 refCast<const nonConformalCyclicFvPatch>
690 completeMesh().
boundary()[nccPatchi]
693 if (!nccFvp.owner())
return;
695 const label nbrNccPatchi = nccFvp.nbrPatchIndex();
698 label nccPatchFacei = 0;
699 labelPairLabelTable procNccPatchFaceis;
703 nonConformalCyclicProcCyclics[nccPatchi],
707 procNccPatchFaceis.insert(iter.key(), 0);
720 const label proci = iter.key().first();
721 const label nbrProci = iter.key().second();
723 const labelPair procNbrProcStar(proci, nbrProci);
724 const labelPair nbrProcProcStar(nbrProci, proci);
726 const label procNccPatchi =
727 nonConformalCyclicProcCyclics[nccPatchi][procNbrProcStar];
728 const label nbrProcNccPatchi =
729 nonConformalCyclicProcCyclics[nbrNccPatchi][nbrProcProcStar];
731 const label procNccPatchFacei = iter();
733 procMeshes_[proci].polyFacesBf()[procNccPatchi].size();
735 if (procNccPatchFacei >= size)
continue;
737 const label procFacei =
738 procMeshes_[proci].polyFacesBf()
739 [procNccPatchi][procNccPatchFacei];
740 const label nbrProcFacei =
741 procMeshes_[nbrProci].polyFacesBf()
742 [nbrProcNccPatchi][procNccPatchFacei];
746 procFaceAddressing_[proci][procFacei] - 1,
747 procFaceAddressing_[nbrProci][nbrProcFacei] - 1
750 if (faceNbrFace > faceNbrFaceStar)
752 procNbrProc = procNbrProcStar;
753 faceNbrFace = faceNbrFaceStar;
763 const label proci = procNbrProc.first();
764 const label nbrProci = procNbrProc.second();
766 const labelPair nbrProcProc(nbrProci, proci);
768 const label procNccPatchi =
769 nonConformalCyclicProcCyclics[nccPatchi][procNbrProc];
770 const label nbrProcNccPatchi =
771 nonConformalCyclicProcCyclics[nbrNccPatchi][nbrProcProc];
773 nonConformalProcFaceAddressingBf[proci][procNccPatchi]
774 .append(nccPatchFacei + 1);
775 nonConformalProcFaceAddressingBf[nbrProci][nbrProcNccPatchi]
776 .append(nccPatchFacei + 1);
779 procNccPatchFaceis[procNbrProc] ++;
785 void Foam::domainDecomposition::sortReconstructNonConformalCyclicAddressing
787 const label nccPatchi,
788 const List<labelPairLabelTable>& nonConformalCyclicProcCyclics,
789 List<List<DynamicList<label>>>& nonConformalProcFaceAddressingBf
792 const nonConformalCyclicFvPatch& nccFvp =
793 refCast<const nonConformalCyclicFvPatch>
795 completeMesh().
boundary()[nccPatchi]
798 if (!nccFvp.owner())
return;
800 const label nbrNccPatchi = nccFvp.nbrPatchIndex();
806 nonConformalCyclicProcCyclics[nccPatchi],
810 const label proci = iter.key().first();
811 const label nbrProci = iter.key().second();
813 const label procNccPatchi = iter();
814 const label nbrProcNccPatchi =
815 nonConformalCyclicProcCyclics
816 [nbrNccPatchi][
labelPair(nbrProci, proci)];
819 procMeshes_[proci].polyFacesBf()[procNccPatchi];
821 procMeshes_[nbrProci].polyFacesBf()[nbrProcNccPatchi];
823 nonConformalProcFaceAddressingBf[proci][procNccPatchi]
824 .resize(procPolyFacesPf.size());
825 nonConformalProcFaceAddressingBf[nbrProci][nbrProcNccPatchi]
826 .resize(nbrProcPolyFacesPf.size());
830 const fvPatch& origFvp = nccFvp.origPatch();
831 const fvPatch& nbrOrigFvp = nccFvp.nbrPatch().origPatch();
835 DynamicList<FixedList<label, 7>> indices;
839 nonConformalCyclicProcCyclics[nccPatchi],
843 const label proci = iter.key().first();
844 const label nbrProci = iter.key().second();
846 const label procNccPatchi = iter();
847 const label nbrProcNccPatchi =
848 nonConformalCyclicProcCyclics
849 [nbrNccPatchi][
labelPair(nbrProci, proci)];
852 procMeshes_[proci].polyFacesBf()[procNccPatchi];
854 procMeshes_[nbrProci].polyFacesBf()[nbrProcNccPatchi];
856 forAll(procPolyFacesPf, procPatchFacei)
858 const label procPolyFacei =
859 procPolyFacesPf[procPatchFacei];
860 const label nbrProcPolyFacei =
861 nbrProcPolyFacesPf[procPatchFacei];
863 const label completePolyFacei =
864 procFaceAddressing_[proci][procPolyFacei] - 1;
865 const label nbcCompletePolyFacei =
866 procFaceAddressing_[nbrProci][nbrProcPolyFacei] - 1;
874 completePolyFacei - origFvp.start(),
875 nbcCompletePolyFacei - nbrOrigFvp.start(),
885 [](
const FixedList<label, 7>& a,
const FixedList<label, 7>&
b)
894 const label proci = indices[i][0];
895 const label nbrProci = indices[i][1];
896 const label procNccPatchi = indices[i][2];
897 const label nbrProcNccPatchi = indices[i][3];
900 const label procPatchFacei = indices[i][6];
902 nonConformalProcFaceAddressingBf
903 [proci][procNccPatchi][procPatchFacei] = i + 1;
904 nonConformalProcFaceAddressingBf
905 [nbrProci][nbrProcNccPatchi][procPatchFacei] = i + 1;
910 void Foam::domainDecomposition::reconstructNonConformalMappedWallAddressing
912 const label ncmwPatchi,
913 List<List<DynamicList<label>>>& nonConformalProcFaceAddressingBf
916 const nonConformalMappedWallFvPatch& ncmwFvp =
917 refCast<const nonConformalMappedWallFvPatch>
919 completeMesh().
boundary()[ncmwPatchi]
922 const bool owner = ncmwFvp.owner();
924 const domainDecomposition& nbrDecomposition =
925 regionMeshes_[ncmwFvp.nbrRegionName()]();
927 const label nbrNcmwPatchi =
928 nbrDecomposition.completeMesh()
929 .boundary()[ncmwFvp.nbrPatchName()]
933 forAll(procMeshes(), proci)
935 nonConformalProcFaceAddressingBf[proci][ncmwPatchi].resize
937 procMeshes()[proci].polyFacesBf()[ncmwPatchi].size()
943 auto calcProcOffsets = []
945 const domainDecomposition& meshes,
946 const label ncmwPatchi
951 forAll(meshes.procMeshes(), proci)
954 nonConformalMappedPolyFacesFvsPatchLabelField
957 const NcmpfFvsplf& polyFacesPf =
958 refCast<const NcmpfFvsplf>
959 (meshes.procMeshes()[proci].polyFacesBf()[ncmwPatchi]);
961 result[proci] = polyFacesPf.procOffsets();
962 result[proci].append(polyFacesPf.size());
968 calcProcOffsets(*
this, ncmwPatchi);
970 calcProcOffsets(nbrDecomposition, nbrNcmwPatchi);
973 label ncmwPatchFacei = 0;
984 forAll(procNcmwPatchFaceis, proci)
986 forAll(procNcmwPatchFaceis[proci], nbrProci)
988 const labelPair procNbrProcStar(proci, nbrProci);
990 const label procNcmwPatchFacei =
991 procNcmwPatchFaceis[proci][nbrProci];
993 procOffsets[proci][nbrProci + 1]
994 - procOffsets[proci][nbrProci];
996 if (procNcmwPatchFacei >= size)
continue;
998 const label procFacei =
999 procMeshes_[proci].polyFacesBf()
1001 [procNcmwPatchFacei + procOffsets[proci][nbrProci]];
1002 const label nbrProcFacei =
1003 nbrDecomposition.procMeshes()[nbrProci].polyFacesBf()
1005 [procNcmwPatchFacei + nbrProcOffsets[nbrProci][proci]];
1009 procFaceAddressing_[proci][procFacei] - 1,
1011 .procFaceAddressing_[nbrProci][nbrProcFacei] - 1
1017 ? faceNbrFace > faceNbrFaceStar
1021 procNbrProc = procNbrProcStar;
1022 faceNbrFace = faceNbrFaceStar;
1033 const label proci = procNbrProc.first();
1034 const label nbrProci = procNbrProc.second();
1036 nonConformalProcFaceAddressingBf
1040 procOffsets[proci][nbrProci]
1041 + procNcmwPatchFaceis[proci][nbrProci]
1042 ] = ncmwPatchFacei + 1;
1045 procNcmwPatchFaceis[proci][nbrProci] ++;
1051 void Foam::domainDecomposition::reconstructNonConformalErrorAddressing
1053 const label ncePatchi,
1054 List<List<DynamicList<label>>>& nonConformalProcFaceAddressingBf
1058 label ncePatchFacei = 0;
1059 labelList procNcePatchFaceis(nProcs(), 0);
1068 forAll(procNcePatchFaceis, procStari)
1071 procMeshes_[procStari].polyFacesBf()[ncePatchi].size();
1073 if (procNcePatchFaceis[procStari] >= size)
continue;
1075 const label procFacei =
1076 procMeshes_[procStari].polyFacesBf()
1077 [ncePatchi][procNcePatchFaceis[procStari]];
1079 const label faceStari =
1080 procFaceAddressing_[procStari][procFacei] - 1;
1082 if (facei > faceStari)
1095 nonConformalProcFaceAddressingBf[proci][ncePatchi]
1096 .append(ncePatchFacei + 1);
1099 procNcePatchFaceis[proci] ++;
1106 Foam::domainDecomposition::nonConformalProcFaceAddressingBf()
const
1112 List<List<DynamicList<label>>> result(nProcs());
1115 result[proci].resize
1117 procMeshes_[proci].
boundary().size()
1121 if (completeConformal() && procsConformal())
1125 else if (!completeConformal())
1127 const List<labelPairLabelTable> nonConformalCyclicProcCyclics =
1128 this->nonConformalCyclicProcCyclics();
1130 PtrList<labelListList> nonConformalMappedWallProcOffsets =
1131 this->nonConformalMappedWallProcOffsets(
true);
1136 const fvPatch& fvp = completeMesh().boundary()[ncPatchi];
1138 if (isA<nonConformalCyclicFvPatch>(fvp))
1140 decomposeNonConformalCyclicAddressing
1143 nonConformalCyclicProcCyclics,
1148 if (isA<nonConformalMappedWallFvPatch>(fvp))
1150 decomposeNonConformalMappedWallAddressing
1153 nonConformalMappedWallProcOffsets,
1158 if (isA<nonConformalErrorFvPatch>(fvp))
1160 decomposeNonConformalErrorAddressing(ncPatchi, result);
1166 const List<labelPairLabelTable> nonConformalCyclicProcCyclics =
1167 this->nonConformalCyclicProcCyclics();
1172 const fvPatch& fvp = completeMesh().boundary()[ncPatchi];
1174 if (isA<nonConformalCyclicFvPatch>(fvp))
1176 if (sortReconstructNonConformalCyclicAddressing_)
1178 sortReconstructNonConformalCyclicAddressing
1181 nonConformalCyclicProcCyclics,
1187 reconstructNonConformalCyclicAddressing
1190 nonConformalCyclicProcCyclics,
1196 if (isA<nonConformalMappedWallFvPatch>(fvp))
1198 reconstructNonConformalMappedWallAddressing(ncPatchi, result);
1201 if (isA<nonConformalErrorFvPatch>(fvp))
1203 reconstructNonConformalErrorAddressing(ncPatchi, result);
1212 void Foam::domainDecomposition::unconformComplete()
1217 completeMesh().polyFacesBf()
1222 forAll(procMeshes_, proci)
1224 const fvMesh& procMesh = procMeshes_[proci];
1227 procFaceAddressingBf()[proci];
1229 forAll(procMesh.boundary(), procNcPatchi)
1231 const fvPatch& fvp = procMesh.boundary()[procNcPatchi];
1233 if (!isA<nonConformalFvPatch>(fvp))
continue;
1235 const label completeNcPatchi =
1236 isA<processorCyclicFvPatch>(fvp)
1237 ? refCast<const processorCyclicFvPatch>(fvp)
1244 max(
mag(faceAddressingBf[procNcPatchi])),
1245 polyFacesBf[completeNcPatchi].size()
1248 polyFacesBf[completeNcPatchi].resize(size, -1);
1249 polyFacesBf[completeNcPatchi].labelField::rmap
1255 procFaceAddressing_[proci],
1256 procMesh.polyFacesBf()[procNcPatchi]
1259 mag(faceAddressingBf[procNcPatchi]) - 1
1264 Sf.boundaryFieldRef()[completeNcPatchi].resize(size,
Zero);
1265 Cf.boundaryFieldRef()[completeNcPatchi].resize(size,
Zero);
1269 completeMesh_->unconform
1274 NullObjectRef<surfaceScalarField>(),
1278 completeMesh_->setPolyFacesBfInstance(procMeshes_[0].polyFacesBfInstance());
1288 void Foam::domainDecomposition::unconformProcs()
1290 const labelList completeFaceAddressing =
1291 this->completeFaceAddressing();
1293 const PtrList<labelListList> nonConformalMappedWallProcOffsets =
1294 this->nonConformalMappedWallProcOffsets(
false);
1296 forAll(procMeshes_, proci)
1298 fvMesh& procMesh = procMeshes_[proci];
1301 procFaceAddressingBf()[proci];
1306 procMesh.polyFacesBf()
1311 forAll(procMesh.boundary(), procNcPatchi)
1313 const fvPatch& fvp = procMesh.boundary()[procNcPatchi];
1315 if (!isA<nonConformalFvPatch>(fvp))
continue;
1317 const label completeNcPatchi =
1318 isA<processorCyclicFvPatch>(fvp)
1319 ? refCast<const processorCyclicFvPatch>(fvp)
1323 polyFacesBf[procNcPatchi] =
1326 completeFaceAddressing,
1329 completeMesh().polyFacesBf()[completeNcPatchi],
1330 mag(faceAddressingBf[procNcPatchi]) - 1
1334 if (isA<nonConformalMappedWallFvPatch>(fvp))
1337 nonConformalMappedPolyFacesFvsPatchLabelField
1340 refCast<NcmpfFvsplf>(polyFacesBf[procNcPatchi]).procOffsets() =
1341 nonConformalMappedWallProcOffsets[procNcPatchi][proci];
1344 const label size = polyFacesBf[procNcPatchi].size();
1348 Sf.boundaryFieldRef()[procNcPatchi].resize(size,
Zero);
1349 Cf.boundaryFieldRef()[procNcPatchi].resize(size,
Zero);
1357 NullObjectRef<surfaceScalarField>(),
1361 procMesh.setPolyFacesBfInstance(completeMesh().polyFacesBfInstance());
1372 void Foam::domainDecomposition::unconform()
1374 if (completeConformal() && procsConformal())
1378 else if (!completeConformal() && procsConformal())
1382 else if (completeConformal() && !procsConformal())
1384 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, GeoMesh, PrimitiveField > Boundary
Type of the boundary field.
static const GeometricField< Type, GeoMesh, PrimitiveField > & 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, 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.
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
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 mag(LagrangianPatchField< scalar > &f, const LagrangianPatchField< Type > &f1)
void reverse(UList< T > &, const label n)
List< labelList > labelListList
A List of labelList.
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)