mirror of
https://github.com/PhasicFlow/phasicFlow.git
synced 2025-07-08 03:07:03 +00:00
bug fix for empty domains in partitioning (tested)
This commit is contained in:
@ -60,16 +60,26 @@ bool pFlow::MPISimulationDomain::createBoundaryDicts()
|
|||||||
"in dictionary "<< boundaries.globalName()<<endl;
|
"in dictionary "<< boundaries.globalName()<<endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if( initialThisDomainActive() )
|
||||||
if( neighbors[i] == -1 )
|
|
||||||
{
|
{
|
||||||
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
|
else
|
||||||
{
|
{
|
||||||
bDict.add("mirrorProcessorNo", neighbors[i]);
|
bDict.add("mirrorProcessorNo", processors::globalRank());
|
||||||
bDict.addOrReplace("type", "processor");
|
bDict.addOrReplace("type", "none");
|
||||||
|
warningInFunction<<"None: replace the method initialThisDomainActive()"<<endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -229,7 +239,12 @@ pFlow::uint32 pFlow::MPISimulationDomain::initialNumberInThis() const
|
|||||||
{
|
{
|
||||||
uint32 numImport = domainPartition_->numberImportThisProc();
|
uint32 numImport = domainPartition_->numberImportThisProc();
|
||||||
uint32 numExport = domainPartition_->numberExportThisProc();
|
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
|
bool pFlow::MPISimulationDomain::initialTransferBlockData
|
||||||
|
@ -71,10 +71,13 @@ public:
|
|||||||
/// @return
|
/// @return
|
||||||
bool initialUpdateDomains(span<realx3> pointPos)override;
|
bool initialUpdateDomains(span<realx3> pointPos)override;
|
||||||
|
|
||||||
|
|
||||||
/// @brief
|
/// @brief
|
||||||
/// @return
|
/// @return
|
||||||
uint32 initialNumberInThis()const override;
|
uint32 initialNumberInThis()const override;
|
||||||
|
|
||||||
|
bool initialThisDomainActive()const override;
|
||||||
|
|
||||||
bool initialTransferBlockData(
|
bool initialTransferBlockData(
|
||||||
span<char> src,
|
span<char> src,
|
||||||
span<char> dst,
|
span<char> dst,
|
||||||
|
@ -97,6 +97,12 @@ bool pFlow::rcb1DPartitioning::partition(pointCollection &points)
|
|||||||
|
|
||||||
localBox_ = globalBox_;
|
localBox_ = globalBox_;
|
||||||
|
|
||||||
|
if(equal(x0, x1))
|
||||||
|
{
|
||||||
|
x0 = x0 - 0.00001;
|
||||||
|
x1 = x1 + 0.00001;
|
||||||
|
}
|
||||||
|
|
||||||
switch (direction_)
|
switch (direction_)
|
||||||
{
|
{
|
||||||
case Direction::X :
|
case Direction::X :
|
||||||
|
@ -61,8 +61,7 @@ public:
|
|||||||
const box& globalBox);
|
const box& globalBox);
|
||||||
|
|
||||||
|
|
||||||
virtual
|
~rcb1DPartitioning() override=default;
|
||||||
~rcb1DPartitioning()=default;
|
|
||||||
|
|
||||||
span<int32> exportList(int procNo)const override
|
span<int32> exportList(int procNo)const override
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user