- std::set<std::string> ListeGroupes;
- int MedIdt = MEDouvrir(const_cast<char *>(aFile),MED_LECTURE);
- if ( MedIdt < 0 ) { return ListeGroupes; };
-
- char maa[MED_TAILLE_NOM+1];
- char desc[MED_TAILLE_DESC+1];
- char nomfam[MED_TAILLE_NOM+1];
- med_int numfam;
-
- med_int mdim;
- med_maillage type;
- med_int numMaillage=1;
- if ( MEDmaaInfo(MedIdt,numMaillage,maa,&mdim,&type,desc) < 0 ) { return ListeGroupes; };
- med_int nfam, ngro, natt;
- if ((nfam = MEDnFam(MedIdt,maa)) < 0) { return ListeGroupes; };
- for (int i=0;i<nfam;i++)
- {
- if ((ngro = MEDnGroupe(MedIdt,maa,i+1)) < 0)
+ std::set<std::string> ListeGroupes;
+ med_err erreur = 0 ;
+ med_idt medIdt ;
+ while ( erreur == 0 )
+ {
+ // Ouverture du fichier
+ medIdt = MEDfileOpen(aFile,MED_ACC_RDONLY);
+ if ( medIdt < 0 )
+ {
+ erreur = 1 ;
+ break ;
+ }
+ // Caracteristiques du maillage
+ char meshname[MED_NAME_SIZE+1];
+ med_int spacedim,meshdim;
+ med_mesh_type meshtype;
+ char descriptionription[MED_COMMENT_SIZE+1];
+ char dtunit[MED_SNAME_SIZE+1];
+ med_sorting_type sortingtype;
+ med_int nstep;
+ med_axis_type axistype;
+ int naxis = MEDmeshnAxis(medIdt,1);
+ char *axisname=new char[naxis*MED_SNAME_SIZE+1];
+ char *axisunit=new char[naxis*MED_SNAME_SIZE+1];
+ erreur = MEDmeshInfo(medIdt,
+ 1,
+ meshname,
+ &spacedim,
+ &meshdim,
+ &meshtype,
+ descriptionription,
+ dtunit,
+ &sortingtype,
+ &nstep,
+ &axistype,
+ axisname,
+ axisunit);
+ delete[] axisname ;
+ delete[] axisunit ;
+ if ( erreur < 0 ) { break ; }
+ // Nombre de familles
+ med_int nfam ;
+ nfam = MEDnFamily(medIdt,meshname) ;
+ if ( nfam < 0 )
+ {
+ erreur = 2 ;
+ break ;
+ }
+ // Lecture des caracteristiques des familles
+ for (int i=0;i<nfam;i++)
+ {
+// Lecture du nombre de groupes
+ med_int ngro = MEDnFamilyGroup(medIdt,meshname,i+1);
+ if ( ngro < 0 )