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

revert Frederic's patch: we should do this outside of the IO routine (to keep it clean)

parent b3072922
No related branches found
No related tags found
No related merge requests found
...@@ -361,7 +361,6 @@ int GModel::readMSH(const std::string &name) ...@@ -361,7 +361,6 @@ int GModel::readMSH(const std::string &name)
if(sscanf(str, "%d", &numElements) != 1){ fclose(fp); return 0; } if(sscanf(str, "%d", &numElements) != 1){ fclose(fp); return 0; }
Msg::Info("%d elements", numElements); Msg::Info("%d elements", numElements);
Msg::ResetProgressMeter(); Msg::ResetProgressMeter();
_elementMapCache.clear();
for(int i = 0; i < numElements; i++) { for(int i = 0; i < numElements; i++) {
int num, type, entity, numData; int num, type, entity, numData;
if(!binary){ if(!binary){
...@@ -396,20 +395,6 @@ int GModel::readMSH(const std::string &name) ...@@ -396,20 +395,6 @@ int GModel::readMSH(const std::string &name)
if(swap) SwapBytes((char*)&data[0], sizeof(int), numData); if(swap) SwapBytes((char*)&data[0], sizeof(int), numData);
} }
} }
if(type==MSH_PNT_SUB || type==MSH_LIN_SUB ||
type==MSH_TRI_SUB || type==MSH_TET_SUB){
if (_elementMapCache.size()==0){
for(int j=0; j<11; j++){
std::map<int, std::vector<MElement*> >::const_iterator it;
for (it = elements[j].begin(); it != elements[j].end(); ++it){
for(int k=0; k<it->second.size(); k++){
MElement* e = it->second[k];
_elementMapCache[e->getNum()] = e;
}
}
}
}
}
MElementFactory f; MElementFactory f;
MElement *element = f.create(num, type, data, this); MElement *element = f.create(num, type, data, this);
if(!element){ fclose(fp); return 0; } if(!element){ fclose(fp); return 0; }
...@@ -426,8 +411,6 @@ int GModel::readMSH(const std::string &name) ...@@ -426,8 +411,6 @@ int GModel::readMSH(const std::string &name)
case TYPE_POLYG: elements[9][entity].push_back(element); break; case TYPE_POLYG: elements[9][entity].push_back(element); break;
case TYPE_POLYH: elements[10][entity].push_back(element); break; case TYPE_POLYH: elements[10][entity].push_back(element); break;
} }
if (_elementMapCache.size())
_elementMapCache[num] = element;
if(numElements > 100000) if(numElements > 100000)
Msg::ProgressMeter(i + 1, numElements, true, "Reading elements"); Msg::ProgressMeter(i + 1, numElements, true, "Reading elements");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment