Commit b2ba9708 authored by Christophe Geuzaine's avatar Christophe Geuzaine

don't crash if ghost element does not exist

parent 1c9461f1
......@@ -1053,6 +1053,10 @@ static bool readMSH4GhostElements(GModel *const model, FILE* fp,
}
MElement *elm = model->getMeshElementByTag(numElm);
if(!elm){
Msg::Error("No element with tag %d", numElm);
continue;
}
for(unsigned int j = 0; j < numGhost; j++){
int ghostPartition = 0;
......@@ -1081,7 +1085,7 @@ static bool readMSH4GhostElements(GModel *const model, FILE* fp,
}
}
std::vector<GEntity*> ghostEntities(model->getNumPartitions(), 0);
std::vector<GEntity*> ghostEntities(model->getNumPartitions() + 1, 0);
std::vector<GEntity*> entities;
model->getEntities(entities);
for(unsigned int i = 0; i < entities.size(); 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