mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: AMI - only run parallel distributed if AMI is distributed
This commit is contained in:
@ -119,6 +119,37 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::checkPatches
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class SourcePatch, class TargetPatch>
|
||||||
|
bool Foam::AMIInterpolation<SourcePatch, TargetPatch>::distributed
|
||||||
|
(
|
||||||
|
const primitivePatch& srcPatch,
|
||||||
|
const primitivePatch& tgtPatch
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (Pstream::parRun())
|
||||||
|
{
|
||||||
|
List<label> facesPresentOnProc(Pstream::nProcs(), 0);
|
||||||
|
if ((srcPatch.size() > 0) || (tgtPatch.size() > 0))
|
||||||
|
{
|
||||||
|
facesPresentOnProc[Pstream::myProcNo()] = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
facesPresentOnProc[Pstream::myProcNo()] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Pstream::gatherList(facesPresentOnProc);
|
||||||
|
Pstream::scatterList(facesPresentOnProc);
|
||||||
|
if (sum(facesPresentOnProc) > 1)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class SourcePatch, class TargetPatch>
|
template<class SourcePatch, class TargetPatch>
|
||||||
Foam::label
|
Foam::label
|
||||||
Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcOverlappingProcs
|
Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcOverlappingProcs
|
||||||
@ -1160,7 +1191,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::update
|
|||||||
{
|
{
|
||||||
static label patchI = 0;
|
static label patchI = 0;
|
||||||
|
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun() && distributed(srcPatch, tgtPatch))
|
||||||
{
|
{
|
||||||
// convert local addressing to global addressing
|
// convert local addressing to global addressing
|
||||||
globalIndex globalSrcFaces(srcPatch.size());
|
globalIndex globalSrcFaces(srcPatch.size());
|
||||||
|
|||||||
@ -167,6 +167,13 @@ class AMIInterpolation
|
|||||||
|
|
||||||
// Parallel functionality
|
// Parallel functionality
|
||||||
|
|
||||||
|
//- Return true if faces are spread over multiple domains
|
||||||
|
bool distributed
|
||||||
|
(
|
||||||
|
const primitivePatch& srcPatch,
|
||||||
|
const primitivePatch& tgtPatch
|
||||||
|
);
|
||||||
|
|
||||||
label calcOverlappingProcs
|
label calcOverlappingProcs
|
||||||
(
|
(
|
||||||
const List<treeBoundBoxList>& procBb,
|
const List<treeBoundBoxList>& procBb,
|
||||||
|
|||||||
Reference in New Issue
Block a user