MEDequivLire.c
Aller à la documentation de ce fichier.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 #include <med.h>
00020 #include <med_config.h>
00021 #include <med_outils.h>
00022 
00023 #include <string.h>
00024 #include <stdlib.h>
00025 
00026 extern int mode_interlace; 
00027 
00028 med_err 
00029 MEDequivLire(med_idt fid, char *maa, char *eq, med_int *corr, med_int n,
00030             med_entite_maillage type_ent,med_geometrie_element typ_geo)
00031 {
00032   med_idt eqid, datagroup;
00033   med_err ret;
00034   char chemin[MED_TAILLE_MAA+MED_TAILLE_EQS+2*MED_TAILLE_NOM+1]; 
00035   char nomdatagroup[MED_TAILLE_NOM+1];
00036   char tmp[MED_TAILLE_NOM_ENTITE+1];
00037   med_entite_maillage _type_ent=type_ent;
00038 
00039   if ( type_ent == MED_NOEUD_MAILLE ) _type_ent=MED_NOEUD ;
00040 
00041   if (typ_geo == MED_TETRA4 || typ_geo == MED_TETRA10 ||
00042       typ_geo == MED_HEXA8  || typ_geo == MED_HEXA20  ||
00043       typ_geo == MED_PENTA6 || typ_geo == MED_PENTA15 ||
00044       typ_geo == MED_PYRA5  || typ_geo == MED_PYRA13)
00045     return -1;
00046 
00047   
00048 
00049 
00050   _MEDmodeErreurVerrouiller();
00051 if (MEDcheckVersion(fid) < 0) return -1;
00052 
00053 
00054   
00055 
00056 
00057   strcpy(chemin,MED_MAA);
00058   strcat(chemin,maa);
00059   strcat(chemin,MED_EQS);
00060   strcat(chemin,eq);
00061   if ((eqid = _MEDdatagroupOuvrir(fid,chemin)) < 0)
00062     return -1;
00063 
00064   
00065 
00066 
00067   if ((ret = _MEDnomEntite(nomdatagroup,_type_ent)) < 0)
00068     return -1;
00069   if ((_type_ent != MED_NOEUD))
00070     {
00071       if ((ret = _MEDnomGeometrie30(tmp,typ_geo)) < 0)
00072         return -1;
00073       strcat(nomdatagroup,".");
00074       strcat(nomdatagroup,tmp);
00075     }
00076   if ((datagroup = _MEDdatagroupOuvrir(eqid,nomdatagroup)) < 0)
00077     return -1;
00078 #if defined(HAVE_F77INT64)
00079   if ((ret =  _MEDdatasetNumLire(datagroup,MED_NOM_COR,MED_INT64,
00080                                  MED_NO_INTERLACE,1,MED_ALL,
00081                                  MED_NOPF,MED_NO_PFLMOD,MED_PFL_NON_COMPACT,0,MED_NOPG,0,
00082                                  (unsigned char *) corr)) < 0)
00083     return -1;
00084 #else
00085   if ((ret =  _MEDdatasetNumLire(datagroup,MED_NOM_COR,MED_INT32,
00086                                  MED_NO_INTERLACE,1,MED_ALL,
00087                                  MED_NOPF,MED_NO_PFLMOD,MED_PFL_NON_COMPACT,0,MED_NOPG,0,
00088                                  (unsigned char *) corr)) < 0)
00089     return -1;
00090 #endif
00091 
00092   
00093 
00094 
00095   if ((ret = _MEDdatagroupFermer(datagroup)) < 0)
00096     return -1;
00097   if ((ret = _MEDdatagroupFermer(eqid)) < 0)
00098     return -1;
00099 
00100   return 0;  
00101 }
00102 
00103 
00104 
00105