_MEDequivalenceCorrespondenceSizeInfo30.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 _MEDequivalenceCorrespondenceSizeInfo30( 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         meshname = va_arg(params,const char * const          );
00033   const char * const         equivname= va_arg(params,const char * const          );
00034   const med_int              numdt    = va_arg(params,const med_int               );
00035   const med_int              numit    = va_arg(params,const med_int               );
00036   const int                  corit    = va_arg(params,const int                   );
00037   med_entity_type * const    entitype = va_arg(params,med_entity_type * const     );
00038   med_geometry_type* const   geotype  = va_arg(params,med_geometry_type* const    );
00039   med_int * const            nentity  = va_arg(params,med_int * const             );
00040   med_err *                  fret     = va_arg(params,med_err *                   );
00041 
00042 
00043   med_err  _ret=-1;
00044   med_idt  _eqid=0,_datagroup1=0,_dataset=0;
00045   int      _num = corit -1;
00046   char     _path[MED_TAILLE_EQS+2*MED_NAME_SIZE+2+2*MED_MAX_PARA+1+2*MED_TAILLE_NOM_ENTITE+2]=MED_EQS;
00047   char     _datagroupname1[2*MED_TAILLE_NOM_ENTITE+2]="";
00048   char     _cstpname[2*MED_MAX_PARA+1]="";
00049   med_size _nequivarray=0;
00050   med_sorting_type  _sortingtype=0;
00051   med_int   _intentitytype;
00052   med_int   _intgeotype;
00053 
00054   /*
00055    * On inhibe le gestionnaire d'erreur
00056    */
00057 
00058   _MEDmodeErreurVerrouiller();
00059 
00060 
00061   if ( MEDmeshSortingTypeRd(fid,meshname,&_sortingtype) < 0 ) {
00062     MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API," MEDmeshSortingTypeRd");
00063     SSCRUTE(meshname);ISCRUTE_int(_sortingtype);goto ERROR;
00064   }
00065 
00066 
00067   strcat( _path, meshname);
00068   strcat( _path, "/");
00069   strcat( _path, equivname);
00070   strcat( _path, "/");
00071   _MEDgetComputationStepName(_sortingtype,numdt,numit,&_path[strlen(_path)]);
00072   strcat( _path, "/");
00073 
00074   /*
00075    * On recupere le nom de <entitype>[.<geotype>]
00076    */
00077   if ( _MEDobjectGetName(fid, _path ,_num, &_path[strlen(_path)]) < 0 ) {
00078     MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,_path);ISCRUTE_int(corit);
00079     goto ERROR;
00080   }
00081 
00082   if ( (_datagroup1 = _MEDdatagroupOuvrir(fid,_path)) < 0 ) {
00083     MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,_path);
00084     goto ERROR;
00085   }
00086 
00087   /*lecture typent et geotype */
00088   if (_MEDattrEntierLire(_datagroup1,MED_NOM_ENT,&_intentitytype) < 0) {
00089     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_ENT);
00090     ISCRUTE(_intentitytype);goto ERROR;
00091   }
00092   *entitype = (med_entity_type) _intentitytype;
00093 
00094   if (_MEDattrEntierLire(_datagroup1,MED_NOM_GEO,&_intgeotype) < 0) {
00095     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_GEO);
00096     ISCRUTE(_intgeotype);goto ERROR;
00097   }
00098   *geotype = (med_geometry_type) _intgeotype;
00099 
00100   if ((_dataset = _MEDdatasetOuvrir(_datagroup1,MED_NOM_COR)) < 0) {
00101     MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATASET,MED_NOM_COR);
00102     SSCRUTE(_path);
00103     goto ERROR;
00104   }
00105 
00106   if ( _MEDattrEntierLire(_dataset,MED_NOM_NBR,nentity) < 0) {
00107     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_EQUIVALENCE_MSG);
00108     SSCRUTE(_path);SSCRUTE(MED_NOM_NBR);ISCRUTE(*nentity);
00109     goto ERROR;
00110   }
00111 
00112   _ret = 0;
00113  ERROR:
00114 
00115   if (_dataset>0)     if (_MEDdatasetFermer(_dataset) < 0) {
00116     MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATASET,MED_NOM_COR);
00117     ISCRUTE_id(_dataset);
00118   }
00119 
00120   if (_datagroup1>0)     if (_MEDdatagroupFermer(_datagroup1) < 0) {
00121     MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_path);
00122     ISCRUTE_id(_datagroup1);
00123   }
00124 
00125 
00126   va_end(params);
00127   *fret = _ret;
00128 
00129   return;
00130 }

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