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

fix bug in MED mesh export (ticket #172)

parent 202d5ecd
No related branches found
No related tags found
No related merge requests found
...@@ -467,7 +467,6 @@ static void fillElementsMED(med_int family, std::vector<T*> &elements, ...@@ -467,7 +467,6 @@ static void fillElementsMED(med_int family, std::vector<T*> &elements,
std::vector<med_int> &conn, std::vector<med_int> &fam, std::vector<med_int> &conn, std::vector<med_int> &fam,
med_geometrie_element &type) med_geometrie_element &type)
{ {
type = MED_NONE;
if(elements.empty()) return; if(elements.empty()) return;
type = msh2medElementType(elements[0]->getTypeForMSH()); type = msh2medElementType(elements[0]->getTypeForMSH());
if(type == MED_NONE){ if(type == MED_NONE){
...@@ -626,8 +625,8 @@ int GModel::writeMED(const std::string &name, bool saveAll, double scalingFactor ...@@ -626,8 +625,8 @@ int GModel::writeMED(const std::string &name, bool saveAll, double scalingFactor
// write the elements // write the elements
{ {
med_geometrie_element typ = MED_NONE;
{ // points { // points
med_geometrie_element typ = MED_NONE;
std::vector<med_int> conn, fam; std::vector<med_int> conn, fam;
for(viter it = firstVertex(); it != lastVertex(); it++) for(viter it = firstVertex(); it != lastVertex(); it++)
if(saveAll || (*it)->physicals.size()) if(saveAll || (*it)->physicals.size())
...@@ -635,6 +634,7 @@ int GModel::writeMED(const std::string &name, bool saveAll, double scalingFactor ...@@ -635,6 +634,7 @@ int GModel::writeMED(const std::string &name, bool saveAll, double scalingFactor
writeElementsMED(fid, meshName, conn, fam, typ); writeElementsMED(fid, meshName, conn, fam, typ);
} }
{ // lines { // lines
med_geometrie_element typ = MED_NONE;
std::vector<med_int> conn, fam; std::vector<med_int> conn, fam;
for(eiter it = firstEdge(); it != lastEdge(); it++) for(eiter it = firstEdge(); it != lastEdge(); it++)
if(saveAll || (*it)->physicals.size()) if(saveAll || (*it)->physicals.size())
...@@ -642,6 +642,7 @@ int GModel::writeMED(const std::string &name, bool saveAll, double scalingFactor ...@@ -642,6 +642,7 @@ int GModel::writeMED(const std::string &name, bool saveAll, double scalingFactor
writeElementsMED(fid, meshName, conn, fam, typ); writeElementsMED(fid, meshName, conn, fam, typ);
} }
{ // triangles { // triangles
med_geometrie_element typ = MED_NONE;
std::vector<med_int> conn, fam; std::vector<med_int> conn, fam;
for(fiter it = firstFace(); it != lastFace(); it++) for(fiter it = firstFace(); it != lastFace(); it++)
if(saveAll || (*it)->physicals.size()) if(saveAll || (*it)->physicals.size())
...@@ -649,6 +650,7 @@ int GModel::writeMED(const std::string &name, bool saveAll, double scalingFactor ...@@ -649,6 +650,7 @@ int GModel::writeMED(const std::string &name, bool saveAll, double scalingFactor
writeElementsMED(fid, meshName, conn, fam, typ); writeElementsMED(fid, meshName, conn, fam, typ);
} }
{ // quads { // quads
med_geometrie_element typ = MED_NONE;
std::vector<med_int> conn, fam; std::vector<med_int> conn, fam;
for(fiter it = firstFace(); it != lastFace(); it++) for(fiter it = firstFace(); it != lastFace(); it++)
if(saveAll || (*it)->physicals.size()) if(saveAll || (*it)->physicals.size())
...@@ -656,6 +658,7 @@ int GModel::writeMED(const std::string &name, bool saveAll, double scalingFactor ...@@ -656,6 +658,7 @@ int GModel::writeMED(const std::string &name, bool saveAll, double scalingFactor
writeElementsMED(fid, meshName, conn, fam, typ); writeElementsMED(fid, meshName, conn, fam, typ);
} }
{ // tets { // tets
med_geometrie_element typ = MED_NONE;
std::vector<med_int> conn, fam; std::vector<med_int> conn, fam;
for(riter it = firstRegion(); it != lastRegion(); it++) for(riter it = firstRegion(); it != lastRegion(); it++)
if(saveAll || (*it)->physicals.size()) if(saveAll || (*it)->physicals.size())
...@@ -663,6 +666,7 @@ int GModel::writeMED(const std::string &name, bool saveAll, double scalingFactor ...@@ -663,6 +666,7 @@ int GModel::writeMED(const std::string &name, bool saveAll, double scalingFactor
writeElementsMED(fid, meshName, conn, fam, typ); writeElementsMED(fid, meshName, conn, fam, typ);
} }
{ // hexas { // hexas
med_geometrie_element typ = MED_NONE;
std::vector<med_int> conn, fam; std::vector<med_int> conn, fam;
for(riter it = firstRegion(); it != lastRegion(); it++) for(riter it = firstRegion(); it != lastRegion(); it++)
if(saveAll || (*it)->physicals.size()) if(saveAll || (*it)->physicals.size())
...@@ -670,6 +674,7 @@ int GModel::writeMED(const std::string &name, bool saveAll, double scalingFactor ...@@ -670,6 +674,7 @@ int GModel::writeMED(const std::string &name, bool saveAll, double scalingFactor
writeElementsMED(fid, meshName, conn, fam, typ); writeElementsMED(fid, meshName, conn, fam, typ);
} }
{ // prisms { // prisms
med_geometrie_element typ = MED_NONE;
std::vector<med_int> conn, fam; std::vector<med_int> conn, fam;
for(riter it = firstRegion(); it != lastRegion(); it++) for(riter it = firstRegion(); it != lastRegion(); it++)
if(saveAll || (*it)->physicals.size()) if(saveAll || (*it)->physicals.size())
...@@ -677,6 +682,7 @@ int GModel::writeMED(const std::string &name, bool saveAll, double scalingFactor ...@@ -677,6 +682,7 @@ int GModel::writeMED(const std::string &name, bool saveAll, double scalingFactor
writeElementsMED(fid, meshName, conn, fam, typ); writeElementsMED(fid, meshName, conn, fam, typ);
} }
{ // pyramids { // pyramids
med_geometrie_element typ = MED_NONE;
std::vector<med_int> conn, fam; std::vector<med_int> conn, fam;
for(riter it = firstRegion(); it != lastRegion(); it++) for(riter it = firstRegion(); it != lastRegion(); it++)
if(saveAll || (*it)->physicals.size()) if(saveAll || (*it)->physicals.size())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment