Commit 8d9180ab authored by Backofen, Rainer's avatar Backofen, Rainer

corrected test for empty mesh if boxpartitioning is used

parent 9174207d
......@@ -162,13 +162,29 @@ namespace AMDiS { namespace Parallel {
recvElements.clear();
sendElements.clear();
int createEmptyPartition =
(mesh->getMacroElements().size() == nExportEls && nImportEls == 0);
// Check if new partitioning would lead to a empty partition
int createEmptyPartition;
if (!boxPartitioning) {
createEmptyPartition=
(mesh->getMacroElements().size() == nExportEls && nImportEls == 0);
}else{
int realNrOfExpEl=0;
for (int i = 0; i < nExportEls; i++) {
int sendElIndex = export_global_ids[i];
realNrOfExpEl+=boxSplitting[sendElIndex].size();
}
createEmptyPartition=
(mesh->getMacroElements().size() == realNrOfExpEl && nImportEls == 0);
}
mpi::globalMax(createEmptyPartition);
if (createEmptyPartition > 0)
err = ZOLTAN_FATAL;
// if a valid partition was produced, collect all elements to be send or received
// in a list
if (err == ZOLTAN_OK && changes != 0) {
if (nImportEls > 0) {
for (int i = 0; i < nImportEls; i++) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment