bug fix for empty domains in partitioning (tested)
This commit is contained in:
parent
41187b0e03
commit
656e03de36
|
@ -60,16 +60,26 @@ bool pFlow::MPISimulationDomain::createBoundaryDicts()
|
|||
"in dictionary "<< boundaries.globalName()<<endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
if( neighbors[i] == -1 )
|
||||
if( initialThisDomainActive() )
|
||||
{
|
||||
bDict.add("mirrorProcessorNo", processors::globalRank());
|
||||
if( neighbors[i] == -1 )
|
||||
{
|
||||
bDict.add("mirrorProcessorNo", processors::globalRank());
|
||||
}
|
||||
else
|
||||
{
|
||||
bDict.add("mirrorProcessorNo", neighbors[i]);
|
||||
bDict.addOrReplace("type", "processor");
|
||||
}
|
||||
warningInFunction<<"replace the method initialThisDomainActive()"<<endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
bDict.add("mirrorProcessorNo", neighbors[i]);
|
||||
bDict.addOrReplace("type", "processor");
|
||||
bDict.add("mirrorProcessorNo", processors::globalRank());
|
||||
bDict.addOrReplace("type", "none");
|
||||
warningInFunction<<"None: replace the method initialThisDomainActive()"<<endl;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -229,7 +239,12 @@ pFlow::uint32 pFlow::MPISimulationDomain::initialNumberInThis() const
|
|||
{
|
||||
uint32 numImport = domainPartition_->numberImportThisProc();
|
||||
uint32 numExport = domainPartition_->numberExportThisProc();
|
||||
return initialNumPoints_+ numImport - numExport;;
|
||||
return max(initialNumPoints_+ numImport - numExport, 0u);
|
||||
}
|
||||
|
||||
bool pFlow::MPISimulationDomain::initialThisDomainActive() const
|
||||
{
|
||||
return initialNumberInThis()>0;
|
||||
}
|
||||
|
||||
bool pFlow::MPISimulationDomain::initialTransferBlockData
|
||||
|
|
|
@ -70,11 +70,14 @@ public:
|
|||
/// @param pointPos
|
||||
/// @return
|
||||
bool initialUpdateDomains(span<realx3> pointPos)override;
|
||||
|
||||
|
||||
/// @brief
|
||||
/// @return
|
||||
uint32 initialNumberInThis()const override;
|
||||
|
||||
bool initialThisDomainActive()const override;
|
||||
|
||||
bool initialTransferBlockData(
|
||||
span<char> src,
|
||||
span<char> dst,
|
||||
|
|
|
@ -97,6 +97,12 @@ bool pFlow::rcb1DPartitioning::partition(pointCollection &points)
|
|||
|
||||
localBox_ = globalBox_;
|
||||
|
||||
if(equal(x0, x1))
|
||||
{
|
||||
x0 = x0 - 0.00001;
|
||||
x1 = x1 + 0.00001;
|
||||
}
|
||||
|
||||
switch (direction_)
|
||||
{
|
||||
case Direction::X :
|
||||
|
|
|
@ -60,9 +60,8 @@ public:
|
|||
const dictionary& dict,
|
||||
const box& globalBox);
|
||||
|
||||
|
||||
virtual
|
||||
~rcb1DPartitioning()=default;
|
||||
|
||||
~rcb1DPartitioning() override=default;
|
||||
|
||||
span<int32> exportList(int procNo)const override
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue