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 #include <string.h>
00023
00024 void
00025 _MEDfield23ComputingStepMeshInfo30(int dummy,...)
00026 {
00027
00028
00029 med_err _ret=-1;
00030 med_idt _gid=0,_datagroup1=0,_meshgid=0,_linkgid=0;
00031 int _num;
00032 char _datagroupname1[2*MED_MAX_PARA+1]="";
00033 char _path [(MED_TAILLE_CHA+MED_NAME_SIZE+1)+2*MED_MAX_PARA+1]=MED_CHA;
00034 char _meshpath [MED_TAILLE_MAA+MED_NAME_SIZE+1]=MED_MAA;
00035 char _linkpath [MED_TAILLE_LIENS+MED_NAME_SIZE+1]=MED_LIENS;
00036 char _cstpname[2*MED_MAX_PARA+1]="";
00037
00038
00039 MED_VARGS_DECL(const, med_idt , , fid );
00040 MED_VARGS_DECL(const, char * , const , fieldname );
00041 MED_VARGS_DECL(const, int , , csit );
00042 MED_VARGS_DECL(, med_int *, const , numdt );
00043 MED_VARGS_DECL(, med_int *, const , numit );
00044 MED_VARGS_DECL(, med_float *, const , dt );
00045 MED_VARGS_DECL(, med_int *, const , nmesh );
00046 MED_VARGS_DECL(, char *, const , meshname );
00047 MED_VARGS_DECL(, med_bool *, const , localmesh );
00048 MED_VARGS_DECL(, med_int *, const , meshnumdt );
00049 MED_VARGS_DECL(, med_int *, const , meshnumit );
00050 MED_VARGS_DECL(, med_err * ,, fret );
00051
00052 va_list params;
00053 va_start(params,dummy);
00054
00055 MED_VARGS_DEF(const, med_idt , , fid );
00056 MED_VARGS_DEF(const, char * , const , fieldname );
00057 MED_VARGS_DEF(const, int , , csit );
00058 MED_VARGS_DEF(, med_int *, const , numdt );
00059 MED_VARGS_DEF(, med_int *, const , numit );
00060 MED_VARGS_DEF(, med_float *, const , dt );
00061 MED_VARGS_DEF(, med_int *, const , nmesh );
00062 MED_VARGS_DEF(, char *, const , meshname );
00063 MED_VARGS_DEF(, med_bool *, const , localmesh );
00064 MED_VARGS_DEF(, med_int *, const , meshnumdt );
00065 MED_VARGS_DEF(, med_int *, const , meshnumit );
00066 MED_VARGS_DEF(, med_err * ,, fret );
00067
00068 _num=csit-1;
00069
00070
00071
00072
00073 _MEDmodeErreurVerrouiller();
00074
00075
00076
00077
00078 strcat(_path,fieldname);
00079
00080
00081 if ( _MEDattributeStringRdByName(fid,_path,MED_NOM_MAI,MED_NAME_SIZE,meshname) < 0) {
00082 MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_FIELD_MSG);
00083 SSCRUTE(_path);SSCRUTE(MED_NOM_MAI);SSCRUTE(meshname);
00084 goto ERROR;
00085 }
00086
00087
00088
00089
00090 if ( _MEDobjectGetName(fid, _path ,_num, _cstpname) < 0 ) {
00091 MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,_path);ISCRUTE_int(_num);
00092 goto ERROR;
00093 }
00094
00095 strcat(_path,"/");
00096 strcat(_path,_cstpname);
00097
00098 if ((_gid = _MEDdatagroupOuvrir(fid,_path)) < 0) {
00099 MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,_path);
00100 goto ERROR;
00101 }
00102
00103
00104
00105
00106
00107 if (_MEDattrEntierLire(_gid,MED_NOM_NDT,(med_int*) numdt) < 0) {
00108 MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_NDT);
00109 SSCRUTE(_path);ISCRUTE(*numdt);goto ERROR;
00110 }
00111
00112 if (_MEDattrFloatLire(_gid,MED_NOM_PDT,(med_float*) dt) < 0) {
00113 MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_PDT);
00114 SSCRUTE(_path);RSCRUTE(*dt);goto ERROR;
00115 }
00116
00117 if (_MEDattrEntierLire(_gid,MED_NOM_NOR,(med_int*) numit) < 0) {
00118 MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_NOR);
00119 SSCRUTE(_path);ISCRUTE(*numit);goto ERROR;
00120 }
00121
00122 if (_MEDattrEntierLire(_gid,MED_NOM_RDT,(med_int*) meshnumdt) < 0) {
00123 MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_RDT);
00124 SSCRUTE(_path);ISCRUTE(*meshnumdt);goto ERROR;
00125 }
00126
00127 if (_MEDattrEntierLire(_gid,MED_NOM_ROR,(med_int*) meshnumit) < 0) {
00128 MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_ROR);
00129 SSCRUTE(_path);ISCRUTE(*meshnumit);goto ERROR;
00130 }
00131
00132
00133
00134 strcat(_meshpath,meshname);
00135
00136
00137 if ( (_meshgid = _MEDdatagroupOuvrir(fid,_meshpath)) < 0) {
00138
00139
00140 strcat(_linkpath,meshname);
00141 if ((_linkgid = _MEDdatagroupOuvrir(fid,_linkpath)) < 0) {
00142
00143
00144
00145 *localmesh = MED_FALSE;
00146 }
00147 *localmesh = MED_FALSE;
00148 } else
00149 *localmesh = MED_TRUE;
00150
00151 *nmesh = 1;
00152
00153 _ret = 0;
00154
00155 ERROR:
00156
00157
00158 if (_gid>0) if (_MEDdatagroupFermer(_gid) < 0) {
00159 MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_path);
00160 ISCRUTE_id(_gid);
00161 }
00162 if (_meshgid>0) if (_MEDdatagroupFermer(_meshgid) < 0) {
00163 MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_meshpath);
00164 ISCRUTE_id(_meshgid);
00165 }
00166
00167 if (_linkgid>0) if (_MEDdatagroupFermer(_linkgid) < 0) {
00168 MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_linkpath);
00169 ISCRUTE_id(_linkgid);
00170 }
00171
00172 va_end(params);
00173 *fret = _ret;
00174 return;
00175 }