From c525f899ec4f6fe5fe0f4ccb8036517bf3a7649c Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Mon, 21 May 2012 15:04:03 +0000
Subject: [PATCH] allow MED files with no family table

---
 Geo/GModelIO_MED.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/Geo/GModelIO_MED.cpp b/Geo/GModelIO_MED.cpp
index f42868f46e..34d313ee39 100644
--- a/Geo/GModelIO_MED.cpp
+++ b/Geo/GModelIO_MED.cpp
@@ -349,15 +349,14 @@ int GModel::readMED(const std::string &name, int meshIndex)
       Msg::Error("Could not read MED elements");
       return 0;
     }
-    std::vector<med_int> fam(numEle);
+    std::vector<med_int> fam(numEle, 0);
 #if (MED_MAJOR_NUM == 3)
     if(MEDmeshEntityFamilyNumberRd(fid, meshName, MED_NO_DT, MED_NO_IT, MED_CELL,
                                    type, &fam[0]) < 0){
 #else
     if(MEDfamLire(fid, meshName, &fam[0], numEle, MED_MAILLE, type) < 0){
 #endif
-      Msg::Error("Could not read MED families");
-      return 0;
+      Msg::Info("No family number for elements: using 0 as default family number");
     }
     std::vector<med_int> eleTags(numEle);
 #if (MED_MAJOR_NUM == 3)
-- 
GitLab