From 6f568b7d73668b0d944fc6e8f889db836ac942c2 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Fri, 7 Sep 2012 11:23:05 +0000 Subject: [PATCH] fix bug in MED mesh export (ticket #172) --- Geo/GModelIO_MED.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Geo/GModelIO_MED.cpp b/Geo/GModelIO_MED.cpp index 34d313ee39..82cc29ab00 100644 --- a/Geo/GModelIO_MED.cpp +++ b/Geo/GModelIO_MED.cpp @@ -467,7 +467,6 @@ static void fillElementsMED(med_int family, std::vector<T*> &elements, std::vector<med_int> &conn, std::vector<med_int> &fam, med_geometrie_element &type) { - type = MED_NONE; if(elements.empty()) return; type = msh2medElementType(elements[0]->getTypeForMSH()); if(type == MED_NONE){ @@ -626,8 +625,8 @@ int GModel::writeMED(const std::string &name, bool saveAll, double scalingFactor // write the elements { - med_geometrie_element typ = MED_NONE; { // points + med_geometrie_element typ = MED_NONE; std::vector<med_int> conn, fam; for(viter it = firstVertex(); it != lastVertex(); it++) if(saveAll || (*it)->physicals.size()) @@ -635,6 +634,7 @@ int GModel::writeMED(const std::string &name, bool saveAll, double scalingFactor writeElementsMED(fid, meshName, conn, fam, typ); } { // lines + med_geometrie_element typ = MED_NONE; std::vector<med_int> conn, fam; for(eiter it = firstEdge(); it != lastEdge(); it++) if(saveAll || (*it)->physicals.size()) @@ -642,6 +642,7 @@ int GModel::writeMED(const std::string &name, bool saveAll, double scalingFactor writeElementsMED(fid, meshName, conn, fam, typ); } { // triangles + med_geometrie_element typ = MED_NONE; std::vector<med_int> conn, fam; for(fiter it = firstFace(); it != lastFace(); it++) if(saveAll || (*it)->physicals.size()) @@ -649,6 +650,7 @@ int GModel::writeMED(const std::string &name, bool saveAll, double scalingFactor writeElementsMED(fid, meshName, conn, fam, typ); } { // quads + med_geometrie_element typ = MED_NONE; std::vector<med_int> conn, fam; for(fiter it = firstFace(); it != lastFace(); it++) if(saveAll || (*it)->physicals.size()) @@ -656,6 +658,7 @@ int GModel::writeMED(const std::string &name, bool saveAll, double scalingFactor writeElementsMED(fid, meshName, conn, fam, typ); } { // tets + med_geometrie_element typ = MED_NONE; std::vector<med_int> conn, fam; for(riter it = firstRegion(); it != lastRegion(); it++) if(saveAll || (*it)->physicals.size()) @@ -663,6 +666,7 @@ int GModel::writeMED(const std::string &name, bool saveAll, double scalingFactor writeElementsMED(fid, meshName, conn, fam, typ); } { // hexas + med_geometrie_element typ = MED_NONE; std::vector<med_int> conn, fam; for(riter it = firstRegion(); it != lastRegion(); it++) if(saveAll || (*it)->physicals.size()) @@ -670,6 +674,7 @@ int GModel::writeMED(const std::string &name, bool saveAll, double scalingFactor writeElementsMED(fid, meshName, conn, fam, typ); } { // prisms + med_geometrie_element typ = MED_NONE; std::vector<med_int> conn, fam; for(riter it = firstRegion(); it != lastRegion(); it++) if(saveAll || (*it)->physicals.size()) @@ -677,6 +682,7 @@ int GModel::writeMED(const std::string &name, bool saveAll, double scalingFactor writeElementsMED(fid, meshName, conn, fam, typ); } { // pyramids + med_geometrie_element typ = MED_NONE; std::vector<med_int> conn, fam; for(riter it = firstRegion(); it != lastRegion(); it++) if(saveAll || (*it)->physicals.size()) -- GitLab