Commit 64847b28 authored by Chris Cantwell's avatar Chris Cantwell

Merge branch 'fix/mesh-partition' into 'master'

Fix mesh partitioning

This MR fixes an issue when partitioning the mesh with a large number of processors. When removing boundary conditions and regions that do not appear on a given partition, the current logic is to remove the XML tag from the parent, and then request the sibling element of the tag. This, potentially, is the wrong order since the tag has already been removed from its parent. For certain choices of very large number of processes was causing a segmentation fault, which this MR fixes.

See merge request !480
parents 952804d8 07a0458e
......@@ -1184,9 +1184,12 @@ namespace Nektar
}
}
int p = atoi(vItem->Attribute("ID"));
if (vListStr.length() == 0)
{
vBndRegions->RemoveChild(vItem);
TiXmlElement* tmp = vItem;
vItem = vItem->NextSiblingElement();
vBndRegions->RemoveChild(tmp);
}
else
{
......@@ -1197,12 +1200,12 @@ namespace Nektar
vNewElement->LinkEndChild(vList);
vNewBndRegions->LinkEndChild(vNewElement);
vBndRegionIdList.insert(p);
vItem = vItem->NextSiblingElement();
}
// Store original order of boundary region.
m_bndRegOrder[p] = vSeq;
vItem = vItem->NextSiblingElement();
}
vConditions->ReplaceChild(vBndRegions, *vNewBndRegions);
}
......@@ -1216,12 +1219,14 @@ namespace Nektar
if ((x = vBndRegionIdList.find(atoi(vItem->Attribute("REF")))) != vBndRegionIdList.end())
{
vItem->SetAttribute("REF", *x);
vItem = vItem->NextSiblingElement();
}
else
{
vBndConditions->RemoveChild(vItem);
TiXmlElement* tmp = vItem;
vItem = vItem->NextSiblingElement();
vBndConditions->RemoveChild(tmp);
}
vItem = vItem->NextSiblingElement();
}
}
pNektar->LinkEndChild(vConditions);
......
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