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 _MEDsubdomainJointInfo30(int dummy, ...) {
00027
00028
00029 med_idt _jntid=0;
00030 med_err _ret=-1,_err=-1;
00031 char _path[MED_TAILLE_JNT+2*MED_NAME_SIZE+2]=MED_JNT;
00032 char _cstpname[2*MED_MAX_PARA+1]="";
00033 int _num;
00034 int _pathreflen=0;
00035 med_size _nstep=0,_nocstpncorrespondence=0;
00036
00037
00038 MED_VARGS_DECL(const, med_idt , , fid );
00039 MED_VARGS_DECL(const, char * , const , localmeshname );
00040 MED_VARGS_DECL(const, int , , jointit );
00041 MED_VARGS_DECL(, char *, const , jointname );
00042 MED_VARGS_DECL(, char *, const , description );
00043 MED_VARGS_DECL(, med_int *, const , domainnumber );
00044 MED_VARGS_DECL(, char *, const , remotemeshname );
00045 MED_VARGS_DECL(, med_int *, const , nstep );
00046 MED_VARGS_DECL(, med_int *, const , nocstpncorrespondence );
00047 MED_VARGS_DECL(, med_err * ,, fret );
00048
00049 va_list params;
00050 va_start(params,dummy);
00051
00052 MED_VARGS_DEF(const, med_idt , , fid );
00053 MED_VARGS_DEF(const, char * , const , localmeshname );
00054 MED_VARGS_DEF(const, int , , jointit );
00055 MED_VARGS_DEF(, char *, const , jointname );
00056 MED_VARGS_DEF(, char *, const , description );
00057 MED_VARGS_DEF(, med_int *, const , domainnumber );
00058 MED_VARGS_DEF(, char *, const , remotemeshname );
00059 MED_VARGS_DEF(, med_int *, const , nstep );
00060 MED_VARGS_DEF(, med_int *, const , nocstpncorrespondence );
00061 MED_VARGS_DEF(, med_err * ,, fret );
00062
00063 _num=jointit-1;
00064
00065
00066
00067
00068 _MEDmodeErreurVerrouiller();
00069
00070
00071
00072
00073 strcat(_path,localmeshname);
00074 _pathreflen=strlen(_path);
00075 if ( _MEDobjectGetName(fid, _path ,_num, jointname) < 0 ) {
00076 MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,_path);ISCRUTE_int(jointit);
00077 SSCRUTE(_path);
00078 goto ERROR;
00079 }
00080
00081 _path[_pathreflen]='/';
00082 strncpy(&_path[_pathreflen+1],jointname,MED_NAME_SIZE+1);
00083 if ((_jntid = _MEDdatagroupOuvrir(fid,_path)) < 0) {
00084 MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,MED_ERR_SUBDOMAINJOINT_MSG);
00085 SSCRUTE(_path);
00086 goto ERROR;
00087 }
00088
00089
00090
00091
00092
00093 if ( _MEDattrStringLire(_jntid,MED_NOM_DES,MED_COMMENT_SIZE,description) < 0) {
00094 MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_SUBDOMAINJOINT_MSG);
00095 SSCRUTE(jointname);SSCRUTE(_path);SSCRUTE(MED_NOM_DES);
00096 goto ERROR;
00097 }
00098
00099
00100
00101
00102 if ((_ret = _MEDattrStringLire(_jntid,MED_NOM_MAI,MED_NAME_SIZE,
00103 remotemeshname)) < 0) {
00104 MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_SUBDOMAINJOINT_MSG);
00105 SSCRUTE(jointname);SSCRUTE(_path);SSCRUTE(MED_NOM_MAI);SSCRUTE(remotemeshname);
00106 goto ERROR;
00107 }
00108
00109
00110
00111
00112 if ((_ret = _MEDattrEntierLire(_jntid, MED_NOM_DOM, domainnumber)) < 0) {
00113 MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_SUBDOMAINJOINT_MSG);
00114 SSCRUTE(jointname);SSCRUTE(_path);SSCRUTE(MED_NOM_DOM);ISCRUTE(*domainnumber);
00115 goto ERROR;
00116 }
00117
00118
00119
00120
00121 if ((_err=_MEDnObjects(_jntid,".",&_nstep)) <0)
00122 if ( _err == (MED_ERR_COUNT + MED_ERR_DATAGROUP) ) {
00123 MED_ERR_(_ret,MED_ERR_COUNT,MED_ERR_DATAGROUP,_path);
00124 goto ERROR;
00125 }
00126 *nstep = (med_int) _nstep;
00127
00128
00129
00130
00131
00132
00133 _MEDgetComputationStepName(MED_SORT_DTIT,MED_NO_DT,MED_NO_IT,_cstpname);
00134
00135 if ((_err=_MEDnObjects(_jntid, _cstpname, &_nocstpncorrespondence)) < 0 )
00136 if ( _err == (MED_ERR_COUNT + MED_ERR_DATAGROUP) ) {
00137 MED_ERR_(_ret,MED_ERR_COUNT,MED_ERR_DATAGROUP,_cstpname);
00138 goto ERROR;
00139 }
00140
00141 *nocstpncorrespondence = (med_int) _nocstpncorrespondence;
00142
00143
00144 _ret = 0;
00145
00146 ERROR:
00147
00148
00149 if (_jntid>0) if (_MEDdatagroupFermer(_jntid) < 0) {
00150 MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,&_path[_pathreflen]);
00151 ISCRUTE_id(_jntid);
00152 }
00153
00154 va_end(params);
00155 *fret = _ret;
00156 return;
00157 }
00158
00159