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 #include <stdlib.h>
00024
00025 void _MEDmeshComputationStepInfo30(int dummy, ...) {
00026
00027 va_list params;
00028 va_start(params,dummy);
00029
00030 const med_idt fid = va_arg(params,const med_idt );
00031 const char * const meshname = va_arg(params,const char * const );
00032 const int csit = va_arg(params,const int );
00033 med_int * const numdt = va_arg(params,med_int * const );
00034 med_int * const numit = va_arg(params,med_int * const );
00035 med_float * const dt = va_arg(params,med_float * const );
00036
00037 med_bool musthave1cs = va_arg(params,med_bool );
00038 med_err * fret = va_arg(params,med_err *);
00039
00040
00041 med_err _ret=-1;
00042 med_idt _meshid=0,_datagroup1=0;
00043 int _num = csit - 1;
00044 char _cstppath[MED_TAILLE_MAA+MED_NAME_SIZE+1+2*MED_MAX_PARA+1+1]=MED_MAA;
00045 char _cstpname[2*MED_MAX_PARA+1]="";
00046
00047
00048
00049
00050 _MEDmodeErreurVerrouiller();
00051
00052 strcat( _cstppath, meshname);
00053 strcat( _cstppath, "/");
00054 if ((_meshid = _MEDdatagroupOuvrir(fid,_cstppath)) < 0) {
00055 MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,_cstppath);
00056 ISCRUTE_id(_meshid);goto ERROR;
00057 }
00058
00059
00060
00061
00062 if ( _MEDobjectGetName(fid, _cstppath ,_num, &_cstppath[strlen(_cstppath)]) < 0 ) {
00063 MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,_cstppath);ISCRUTE_int(csit);
00064 goto ERROR;
00065 }
00066
00067 if ( (_datagroup1 = _MEDdatagroupOuvrir(_meshid,_cstppath)) < 0 ) {
00068 MED_ERR_(_ret,MED_ERR_DOESNTEXIST,MED_ERR_COMPUTINGSTEP,_cstppath);
00069 SSCRUTE(meshname);goto ERROR;
00070 }
00071
00072
00073 if ( _MEDattrEntierLire(_datagroup1,MED_NOM_NDT,numdt) < 0) {
00074 MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_MESH_MSG);
00075 SSCRUTE(meshname);SSCRUTE(_cstppath);SSCRUTE(MED_NOM_NDT);
00076 ISCRUTE(*numdt);goto ERROR;
00077 }
00078
00079
00080
00081 if ( _MEDattrFloatLire(_datagroup1,MED_NOM_PDT,dt) < 0) {
00082 MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_MESH_MSG);
00083 SSCRUTE(meshname);SSCRUTE(_cstppath);SSCRUTE(MED_NOM_PDT);
00084 RSCRUTE(*dt);goto ERROR;
00085 }
00086
00087
00088 if ( _MEDattrEntierLire(_datagroup1,MED_NOM_NOR,numit) < 0) {
00089 MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_MESH_MSG);
00090 SSCRUTE(meshname);SSCRUTE(_cstppath);SSCRUTE(MED_NOM_NOR);
00091 ISCRUTE(*numit); goto ERROR;
00092 }
00093
00094 _ret = 0;
00095 ERROR:
00096
00097 if (_meshid>0) if (_MEDdatagroupFermer(_meshid) < 0) {
00098 MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,meshname);
00099 ISCRUTE_id(_meshid);
00100 }
00101
00102 if (_datagroup1>0) if (_MEDdatagroupFermer(_datagroup1) < 0) {
00103 MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_cstppath);
00104 ISCRUTE_id(_datagroup1);
00105 }
00106
00107 va_end(params);
00108 *fret = _ret;
00109 return;
00110 }