diff --git a/Geo/GModel.cpp b/Geo/GModel.cpp index 8d7615a0efbf729da6fda6e1f80425d08ba10a32..5cbea99e0980de3dab217765eeb9160425e57db6 100644 --- a/Geo/GModel.cpp +++ b/Geo/GModel.cpp @@ -1818,8 +1818,16 @@ GModel *GModel::buildCutGModel(gLevelset *ls, bool cutElem, bool saveTri) cutGM->_associateEntityWithMeshVertices(); cutGM->_storeVerticesInEntities(vertexMap); - for(int i = 0; i < 4; i++) + for(int i = 0; i < 4; i++){ cutGM->_storePhysicalTagsInEntities(i, physicals[i]); + std::map<int, std::map<int, std::string> >::iterator it = physicals[i].begin(); + for(; it != physicals[i].end(); it++){ + std::map<int, std::string>::iterator it2 = it->second.begin(); + for(; it2 != it->second.end(); it2++) + if(it2->second != "") + cutGM->setPhysicalName(it2->second, i, it2->first); + } + } Msg::Info("Mesh cutting complete (%g s)", Cpu() - t1); return cutGM; diff --git a/Geo/GModelIO_Mesh.cpp b/Geo/GModelIO_Mesh.cpp index 997c8cf560a072e08ebe14215e89d992f5b5bd41..8ff7dc399288f3e56562864fad0d0de49180ba5b 100644 --- a/Geo/GModelIO_Mesh.cpp +++ b/Geo/GModelIO_Mesh.cpp @@ -54,11 +54,8 @@ void GModel::_storePhysicalTagsInEntities(int dim, std::map<int, std::string>::const_iterator it2 = it->second.begin(); for(; it2 != it->second.end(); ++it2){ if(std::find(ge->physicals.begin(), ge->physicals.end(), it2->first) == - ge->physicals.end()){ + ge->physicals.end()) ge->physicals.push_back(it2->first); - if(it2->second != "") - setPhysicalName(it2->second, dim, it2->first); - } } } }