_MEDequivalenceCorrespondenceSize30.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 
00020 #include <med.h>
00021 #include <med_config.h>
00022 #include <med_outils.h>
00023 #include <string.h>
00024 #include <stdlib.h>
00025 
00026 void
00027 _MEDequivalenceCorrespondenceSize30(int dummy, ...) {
00028 
00029 
00030   med_err  _ret=-1;
00031   med_idt  _eqid=0,_datagroup1=0,_dataset=0;
00032   char     _path[MED_TAILLE_EQS+2*MED_NAME_SIZE+2+2*MED_MAX_PARA+1+2*MED_TAILLE_NOM_ENTITE+2]=MED_EQS;
00033   char     _datagroupname1[2*MED_TAILLE_NOM_ENTITE+2]="";
00034   char     _cstpname[2*MED_MAX_PARA+1]="";
00035   med_size          _nequivarray=0;
00036   med_sorting_type  _sortingtype=0;
00037   med_int           _intentitype;
00038   med_int           _intgeotype;
00039   char              _geotypename [MED_TAILLE_NOM_ENTITE+1]="";
00040 
00041 
00042   MED_VARGS_DECL(const, med_idt              , , fid       );
00043   MED_VARGS_DECL(const, char * , const         , meshname  );
00044   MED_VARGS_DECL(const, char * , const         , equivname );
00045   MED_VARGS_DECL(const, med_int              , , numdt     );
00046   MED_VARGS_DECL(const, med_int              , , numit     );
00047   MED_VARGS_DECL(const, med_entity_type      , , entitype  );
00048   MED_VARGS_DECL(const, med_geometry_type    , , geotype   );
00049   MED_VARGS_DECL(, med_int *, const            , nentity   );
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         , meshname  );
00057   MED_VARGS_DEF(const, char * , const         , equivname );
00058   MED_VARGS_DEF(const, med_int              , , numdt     );
00059   MED_VARGS_DEF(const, med_int              , , numit     );
00060   MED_VARGS_DEF(const, med_entity_type      , , entitype  );
00061   MED_VARGS_DEF(const, med_geometry_type    , , geotype   );
00062   MED_VARGS_DEF(, med_int *, const            , nentity   );
00063   MED_VARGS_DEF(, med_err *                  ,, fret          );
00064 
00065   /*
00066    * On inhibe le gestionnaire d'erreur
00067    */
00068 
00069   _MEDmodeErreurVerrouiller();
00070 
00071 
00072   if ( MEDmeshSortingTypeRd(fid,meshname,&_sortingtype) < 0 ) {
00073     MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API," MEDmeshSortingTypeRd");
00074     SSCRUTE(meshname);ISCRUTE_int(_sortingtype);goto ERROR;
00075   }
00076   
00077   strcat( _path, meshname);
00078   strcat( _path, "/");
00079   strcat( _path, equivname);
00080   strcat( _path, "/");
00081   _MEDgetComputationStepName(_sortingtype,numdt,numit,&_path[strlen(_path)]);
00082   strcat( _path, "/");
00083 
00084   /*
00085    *  Construction du nom de  datagroup <entitype>[.<geotype>]
00086    */
00087   if (_MEDgetEntityTypeName(&_path[strlen(_path)],entitype) < 0) {
00088     MED_ERR_(_ret,MED_ERR_INVALID,MED_ERR_ENTITY,MED_ERR_VALUE_MSG);
00089     ISCRUTE_int(entitype);SSCRUTE(equivname);goto ERROR;
00090   }
00091   if ( entitype != MED_NODE ) {
00092     if ( _MEDgetInternalGeometryTypeName(_geotypename,geotype) < 0) {
00093       MED_ERR_(_ret,MED_ERR_INVALID,MED_ERR_GEOMETRIC,MED_ERR_VALUE_MSG);
00094       ISCRUTE_int(geotype);SSCRUTE(equivname);goto ERROR;
00095     }
00096       strcat(_path,".");
00097       strcat(_path,_geotypename);
00098   }
00099 
00100   if ( (_datagroup1 = _MEDdatagroupOuvrir(fid,_path)) < 0 ) {
00101     *nentity=0;
00102     goto SORTIE;
00103   }
00104 
00105   if ((_dataset = _MEDdatasetOuvrir(_datagroup1,MED_NOM_COR)) < 0) {
00106     MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATASET,MED_NOM_COR);
00107     SSCRUTE(_path);
00108     goto ERROR;
00109   }
00110 
00111   if ( _MEDattrEntierLire(_dataset,MED_NOM_NBR,nentity) < 0) {
00112     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_EQUIVALENCE_MSG);
00113     SSCRUTE(_path);SSCRUTE(MED_NOM_NBR);ISCRUTE(*nentity);
00114     goto ERROR;
00115   }
00116 
00117  SORTIE:
00118   _ret = 0;
00119  ERROR:
00120 
00121   if (_dataset>0)     if (_MEDdatasetFermer(_dataset) < 0) {
00122     MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATASET,MED_NOM_COR);
00123     ISCRUTE_id(_dataset);
00124   }
00125 
00126   if (_datagroup1>0)     if (_MEDdatagroupFermer(_datagroup1) < 0) {
00127     MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_path);
00128     ISCRUTE_id(_datagroup1);
00129   }
00130 
00131 
00132   va_end(params);
00133   *fret = _ret;
00134   return;
00135 }

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