Skip to content
Snippets Groups Projects
Commit 38c9938d authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

trying to allow non-negative family numbers (apparently created by FLUX med export)

parent d829793d
Branches
Tags
No related merge requests found
......@@ -374,7 +374,7 @@ int GModel::readMED(const std::string &name, int meshIndex)
for(int k = 0; k < numNodPerEle; k++)
v[k] = verts[conn[numNodPerEle * j + med2mshNodeIndex(type, k)] - 1];
MElement *e = factory.create(mshType, v, eleTags.empty() ? 0 : eleTags[j]);
if(e) elements[-fam[j]].push_back(e);
if(e) elements[std::abs(fam[j])].push_back(e);
}
_storeElementsInEntities(elements);
}
......@@ -431,12 +431,12 @@ int GModel::readMED(const std::string &name, int meshIndex)
#endif
// family tags are unique (for all dimensions)
GEntity *ge;
if((ge = getRegionByTag(-familyNum))){}
else if((ge = getFaceByTag(-familyNum))){}
else if((ge = getEdgeByTag(-familyNum))){}
else ge = getVertexByTag(-familyNum);
if((ge = getRegionByTag(std::abs(familyNum)))){}
else if((ge = getFaceByTag(std::abs(familyNum)))){}
else if((ge = getEdgeByTag(std::abs(familyNum)))){}
else ge = getVertexByTag(std::abs(familyNum));
if(ge){
elementaryNames[std::pair<int, int>(ge->dim(), -familyNum)] = familyName;
elementaryNames[std::pair<int, int>(ge->dim(), std::abs(familyNum))] = familyName;
if(numGroups > 0){
for(int j = 0; j < numGroups; j++){
char tmp[MED_TAILLE_LNOM + 1];
......@@ -558,8 +558,9 @@ int GModel::writeMED(const std::string &name, bool saveAll, double scalingFactor
#endif
Msg::Error("Could not create MED family 0");
// create one family per elementary entity, with one group per
// physical entity and no attributes
// create one family per elementary entity, with one group per physical
// entity and no attributes; we use negative family numbers, as intructed by
// Code_Aster devs.
for(unsigned int i = 0; i < entities.size(); i++){
if(saveAll || entities[i]->physicals.size()){
int num = - ((int)families.size() + 1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment