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

Généré le Mon May 16 17:10:22 2011 pour MED fichier par  doxygen 1.6.1