domainDecompositon: Fix to the ordering of non-conformal mapped walls
This commit is contained in:
@ -159,31 +159,40 @@ void checkCompleteMeshOrdering
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Mapped patches
|
// Mapped patches
|
||||||
if
|
if (isA<nonConformalMappedWallFvPatch>(fvp))
|
||||||
(
|
|
||||||
isA<nonConformalMappedWallFvPatch>(fvp)
|
|
||||||
&& refCast<const nonConformalMappedWallFvPatch>(fvp).owner()
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
|
const label ncmwPatchi = patchi;
|
||||||
|
|
||||||
const nonConformalMappedWallFvPatch& ncmwFvp =
|
const nonConformalMappedWallFvPatch& ncmwFvp =
|
||||||
refCast<const nonConformalMappedWallFvPatch>(fvp);
|
refCast<const nonConformalMappedWallFvPatch>(fvp);
|
||||||
|
|
||||||
|
const fvsPatchLabelField& polyFacesPf =
|
||||||
|
completeMesh.polyFacesBf()[ncmwPatchi];
|
||||||
|
|
||||||
const domainDecomposition& nbrDecomposition =
|
const domainDecomposition& nbrDecomposition =
|
||||||
regionMeshes[ncmwFvp.nbrRegionName()]();
|
regionMeshes[ncmwFvp.nbrRegionName()]();
|
||||||
|
|
||||||
const fvMesh& nbrCompleteMesh = nbrDecomposition.completeMesh();
|
const fvMesh& nbrCompleteMesh = nbrDecomposition.completeMesh();
|
||||||
|
|
||||||
const label ncmwPatchi = patchi;
|
if (nbrCompleteMesh.conformal()) continue;
|
||||||
|
|
||||||
const label nbrNcmwPatchi =
|
const label nbrNcmwPatchi =
|
||||||
nbrCompleteMesh.boundary()[ncmwFvp.nbrPatchName()].index();
|
nbrCompleteMesh.boundary()[ncmwFvp.nbrPatchName()].index();
|
||||||
|
|
||||||
|
const nonConformalMappedWallFvPatch& nbrNcmwFvp =
|
||||||
|
refCast<const nonConformalMappedWallFvPatch>
|
||||||
|
(nbrCompleteMesh.boundary()[nbrNcmwPatchi]);
|
||||||
|
|
||||||
|
const fvsPatchLabelField& nbrPolyFacesPf =
|
||||||
|
nbrCompleteMesh.polyFacesBf()[nbrNcmwPatchi];
|
||||||
|
|
||||||
checkNonConformalCoupledPatchOrdering
|
checkNonConformalCoupledPatchOrdering
|
||||||
(
|
(
|
||||||
{-labelMax, labelMax},
|
{-labelMax, labelMax},
|
||||||
completeMesh.boundary()[ncmwPatchi],
|
ncmwFvp.owner() ? ncmwFvp : nbrNcmwFvp,
|
||||||
nbrCompleteMesh.boundary()[nbrNcmwPatchi],
|
ncmwFvp.owner() ? nbrNcmwFvp : ncmwFvp,
|
||||||
completeMesh.polyFacesBf()[ncmwPatchi],
|
ncmwFvp.owner() ? polyFacesPf : nbrPolyFacesPf,
|
||||||
nbrCompleteMesh.polyFacesBf()[ncmwPatchi]
|
ncmwFvp.owner() ? nbrPolyFacesPf : polyFacesPf
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -294,11 +303,7 @@ void checkProcMeshesOrdering
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Mapped patches
|
// Mapped patches
|
||||||
if
|
if (isA<nonConformalMappedWallFvPatch>(fvp))
|
||||||
(
|
|
||||||
isA<nonConformalMappedWallFvPatch>(fvp)
|
|
||||||
&& refCast<const nonConformalMappedWallFvPatch>(fvp).owner()
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
const label ncmwPatchi = patchi;
|
const label ncmwPatchi = patchi;
|
||||||
|
|
||||||
@ -334,23 +339,30 @@ void checkProcMeshesOrdering
|
|||||||
refCast<const NcmpfFvsplf>
|
refCast<const NcmpfFvsplf>
|
||||||
(nbrProcMesh.polyFacesBf()[nbrNcmwPatchi]);
|
(nbrProcMesh.polyFacesBf()[nbrNcmwPatchi]);
|
||||||
|
|
||||||
|
const SubList<label> subPolyFacesPf
|
||||||
|
(
|
||||||
|
procMeshes[proci].polyFacesBf()[ncmwPatchi],
|
||||||
|
polyFacesPf.procSizes()[nbrProci],
|
||||||
|
polyFacesPf.procOffsets()[nbrProci]
|
||||||
|
);
|
||||||
|
|
||||||
|
const SubList<label> nbrSubPolyFacesPf
|
||||||
|
(
|
||||||
|
nbrProcMesh.polyFacesBf()[nbrNcmwPatchi],
|
||||||
|
nbrPolyFacesPf.procSizes()[proci],
|
||||||
|
nbrPolyFacesPf.procOffsets()[proci]
|
||||||
|
);
|
||||||
|
|
||||||
checkNonConformalCoupledPatchOrdering
|
checkNonConformalCoupledPatchOrdering
|
||||||
(
|
(
|
||||||
{proci, nbrProci},
|
{
|
||||||
ncmwFvp,
|
ncmwFvp.owner() ? proci : nbrProci,
|
||||||
nbrNcmwFvp,
|
ncmwFvp.owner() ? nbrProci : proci
|
||||||
SubList<label>
|
},
|
||||||
(
|
ncmwFvp.owner() ? ncmwFvp : nbrNcmwFvp,
|
||||||
procMeshes[proci].polyFacesBf()[ncmwPatchi],
|
ncmwFvp.owner() ? nbrNcmwFvp : ncmwFvp,
|
||||||
polyFacesPf.procSizes()[nbrProci],
|
ncmwFvp.owner() ? subPolyFacesPf : nbrSubPolyFacesPf,
|
||||||
polyFacesPf.procOffsets()[nbrProci]
|
ncmwFvp.owner() ? nbrSubPolyFacesPf : subPolyFacesPf
|
||||||
),
|
|
||||||
SubList<label>
|
|
||||||
(
|
|
||||||
nbrProcMesh.polyFacesBf()[nbrNcmwPatchi],
|
|
||||||
nbrPolyFacesPf.procSizes()[proci],
|
|
||||||
nbrPolyFacesPf.procOffsets()[proci]
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -682,6 +694,7 @@ void Foam::domainDecomposition::reconstructNonConformalCyclicAddressing
|
|||||||
|
|
||||||
const label nbrNccPatchi = nccFvp.nbrPatchIndex();
|
const label nbrNccPatchi = nccFvp.nbrPatchIndex();
|
||||||
|
|
||||||
|
// Initialise counters
|
||||||
label nccPatchFacei = 0;
|
label nccPatchFacei = 0;
|
||||||
labelPairLabelTable procNccPatchFaceis;
|
labelPairLabelTable procNccPatchFaceis;
|
||||||
forAllConstIter
|
forAllConstIter
|
||||||
@ -694,6 +707,9 @@ void Foam::domainDecomposition::reconstructNonConformalCyclicAddressing
|
|||||||
procNccPatchFaceis.insert(iter.key(), 0);
|
procNccPatchFaceis.insert(iter.key(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Create each complete face in turn. For each complete face, loop all the
|
||||||
|
// processor interfaces and find the "next" face; i.e., that with the
|
||||||
|
// smallest owner-neighbour face indices.
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
labelPair procNbrProc(labelMax, labelMax);
|
labelPair procNbrProc(labelMax, labelMax);
|
||||||
@ -913,6 +929,17 @@ void Foam::domainDecomposition::reconstructNonConformalMappedWallAddressing
|
|||||||
.boundary()[ncmwFvp.nbrPatchName()]
|
.boundary()[ncmwFvp.nbrPatchName()]
|
||||||
.index();
|
.index();
|
||||||
|
|
||||||
|
// Allocate space for the addressing
|
||||||
|
forAll(procMeshes(), proci)
|
||||||
|
{
|
||||||
|
nonConformalProcFaceAddressingBf[proci][ncmwPatchi].resize
|
||||||
|
(
|
||||||
|
procMeshes()[proci].polyFacesBf()[ncmwPatchi].size()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the processor offsets from the non-conformal mapped wall patches,
|
||||||
|
// and append an additional final value for the total size
|
||||||
auto calcProcOffsets = []
|
auto calcProcOffsets = []
|
||||||
(
|
(
|
||||||
const domainDecomposition& meshes,
|
const domainDecomposition& meshes,
|
||||||
@ -942,9 +969,13 @@ void Foam::domainDecomposition::reconstructNonConformalMappedWallAddressing
|
|||||||
const labelListList nbrProcOffsets =
|
const labelListList nbrProcOffsets =
|
||||||
calcProcOffsets(nbrDecomposition, nbrNcmwPatchi);
|
calcProcOffsets(nbrDecomposition, nbrNcmwPatchi);
|
||||||
|
|
||||||
|
// Initialise counters
|
||||||
label ncmwPatchFacei = 0;
|
label ncmwPatchFacei = 0;
|
||||||
labelListList procNcmwPatchFaceis(nProcs(), labelList(nProcs(), 0));
|
labelListList procNcmwPatchFaceis(nProcs(), labelList(nProcs(), 0));
|
||||||
|
|
||||||
|
// Create each complete face in turn. For each complete face, loop all the
|
||||||
|
// processor interfaces and find the "next" face; i.e., that with the
|
||||||
|
// smallest owner-neighbour face indices.
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
labelPair procNbrProc(labelMax, labelMax);
|
labelPair procNbrProc(labelMax, labelMax);
|
||||||
@ -1002,8 +1033,13 @@ void Foam::domainDecomposition::reconstructNonConformalMappedWallAddressing
|
|||||||
const label proci = procNbrProc.first();
|
const label proci = procNbrProc.first();
|
||||||
const label nbrProci = procNbrProc.second();
|
const label nbrProci = procNbrProc.second();
|
||||||
|
|
||||||
nonConformalProcFaceAddressingBf[proci][ncmwPatchi]
|
nonConformalProcFaceAddressingBf
|
||||||
.append(ncmwPatchFacei + 1);
|
[proci]
|
||||||
|
[ncmwPatchi]
|
||||||
|
[
|
||||||
|
procOffsets[proci][nbrProci]
|
||||||
|
+ procNcmwPatchFaceis[proci][nbrProci]
|
||||||
|
] = ncmwPatchFacei + 1;
|
||||||
|
|
||||||
ncmwPatchFacei ++;
|
ncmwPatchFacei ++;
|
||||||
procNcmwPatchFaceis[proci][nbrProci] ++;
|
procNcmwPatchFaceis[proci][nbrProci] ++;
|
||||||
@ -1018,9 +1054,13 @@ void Foam::domainDecomposition::reconstructNonConformalErrorAddressing
|
|||||||
List<List<DynamicList<label>>>& nonConformalProcFaceAddressingBf
|
List<List<DynamicList<label>>>& nonConformalProcFaceAddressingBf
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
// Initialise counters
|
||||||
label ncePatchFacei = 0;
|
label ncePatchFacei = 0;
|
||||||
labelList procNcePatchFaceis(nProcs(), 0);
|
labelList procNcePatchFaceis(nProcs(), 0);
|
||||||
|
|
||||||
|
// Create each complete face in turn. For each complete face, loop all the
|
||||||
|
// processor patches and find the "next" face; i.e., that with the smallest
|
||||||
|
// face index.
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
label facei = labelMax, proci = labelMax;
|
label facei = labelMax, proci = labelMax;
|
||||||
@ -1237,6 +1277,7 @@ void Foam::domainDecomposition::unconformComplete()
|
|||||||
|
|
||||||
completeMesh_->setPolyFacesBfInstance(procMeshes_[0].polyFacesBfInstance());
|
completeMesh_->setPolyFacesBfInstance(procMeshes_[0].polyFacesBfInstance());
|
||||||
|
|
||||||
|
// Check ordering
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
checkCompleteMeshOrdering(completeMesh(), regionMeshes_);
|
checkCompleteMeshOrdering(completeMesh(), regionMeshes_);
|
||||||
|
|||||||
Reference in New Issue
Block a user