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 void
00027 _MEDlocalizationInfoByName236(int dummy, ...) {
00028
00029
00030 med_idt _lzid=0;
00031 med_err _ret=-1;
00032 char _path[MED_TAILLE_GAUSS+MED_NAME_SIZE+1]=MED_GAUSS;
00033 med_int _intgeotype = -1;
00034
00035
00036 MED_VARGS_DECL(const, med_idt , , fid );
00037 MED_VARGS_DECL(const, char * , const , localizationname );
00038 MED_VARGS_DECL(, med_geometry_type *, const , geotype );
00039 MED_VARGS_DECL(, med_int *, const , spacedimension );
00040 MED_VARGS_DECL(, med_int *, const , nbofipoint );
00041 MED_VARGS_DECL(, char *, const , geointerpname );
00042 MED_VARGS_DECL(, char *, const , sectionmeshname );
00043 MED_VARGS_DECL(, med_int *, const , nsectionmeshcell );
00044 MED_VARGS_DECL(, med_geometry_type *, const , sectiongeotype );
00045 MED_VARGS_DECL(, med_err * ,, fret );
00046
00047 va_list params;
00048 va_start(params,dummy);
00049
00050 MED_VARGS_DEF(const, med_idt , , fid );
00051 MED_VARGS_DEF(const, char * , const , localizationname );
00052 MED_VARGS_DEF(, med_geometry_type *, const , geotype );
00053 MED_VARGS_DEF(, med_int *, const , spacedimension );
00054 MED_VARGS_DEF(, med_int *, const , nbofipoint );
00055 MED_VARGS_DEF(, char *, const , geointerpname );
00056 MED_VARGS_DEF(, char *, const , sectionmeshname );
00057 MED_VARGS_DEF(, med_int *, const , nsectionmeshcell );
00058 MED_VARGS_DEF(, med_geometry_type *, const , sectiongeotype );
00059 MED_VARGS_DEF(, med_err * ,, fret );
00060
00061
00062
00063
00064 _MEDmodeErreurVerrouiller();
00065
00066
00067
00068
00069
00070 strcat(_path,localizationname);
00071 if ((_lzid = _MEDdatagroupOuvrir(fid,_path)) < 0) {
00072 MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,MED_ERR_LOCALIZATION_MSG);
00073 SSCRUTE(_path);
00074 goto ERROR;
00075 }
00076
00077
00078
00079
00080 if (_MEDattrEntierLire(_lzid,MED_NOM_NBR,nbofipoint) < 0) {
00081 MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_LOCALIZATION_MSG);
00082 SSCRUTE(_path);SSCRUTE(MED_NOM_NBR);ISCRUTE(*nbofipoint);
00083 goto ERROR;
00084 }
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096 if (_MEDattrEntierLire(_lzid,MED_NOM_GEO,&_intgeotype) < 0) {
00097 MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_LOCALIZATION_MSG);
00098 SSCRUTE(localizationname);SSCRUTE(MED_NOM_GEO);ISCRUTE(_intgeotype);
00099 goto ERROR;
00100 };
00101 *geotype = (med_geometry_type) _intgeotype;
00102
00103 *spacedimension = (_intgeotype/100);
00104
00105 sectionmeshname[0]='\0';
00106 geointerpname[0]='\0';
00107 *nsectionmeshcell=0;
00108 *sectiongeotype=MED_UNDEF_GEOTYPE;
00109
00110 _ret = 0;
00111 ERROR:
00112
00113 if ( _lzid > 0 ) if ( _MEDdatagroupFermer(_lzid) < 0) {
00114 MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,MED_GAUSS);
00115 ISCRUTE_id(_lzid);
00116 }
00117
00118 va_end(params);
00119 *fret = _ret;
00120 return;
00121 }