_MEDsubdomainJointInfo30.c

Aller à la documentation de ce fichier.
00001 /*  This file is part of MED.
00002  *
00003  *  COPYRIGHT (C) 1999 - 2011  EDF R&D, CEA/DEN
00004  *  MED is free software: you can redistribute it and/or modify
00005  *  it under the terms of the GNU Lesser General Public License as published by
00006  *  the Free Software Foundation, either version 3 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  MED is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU Lesser General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU Lesser General Public License
00015  *  along with MED.  If not, see <http://www.gnu.org/licenses/>.
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    * On inhibe le gestionnaire d'erreur HDF 5
00067    */
00068   _MEDmodeErreurVerrouiller();
00069 
00070   /*
00071    * On recupere le nom de l'subdomainJoint
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    * L'attribut DES
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    * L'attribut "MAI"
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    * L'attribut "DOM"
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    * Nombre d'étapes de calcul
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    * Nombre de correspondence pour <MED_NO_DT,MED_NO_IT>
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 

Généré le Mon Nov 7 16:21:23 2011 pour MED fichier par  doxygen 1.6.1