_MEDfieldComputingStepMeshInfo236.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 #include <string.h>
00023 
00024 #include <2.3.6/med23v30.h>
00025 #include <2.3.6/med23v30_proto.h>
00026 #include "2.3.6/med23v30_misc.h"
00027 
00028 void
00029 _MEDfieldComputingStepMeshInfo236(int dummy,...)
00030 
00031 {
00032 
00033   va_list params;
00034   va_start(params,dummy);
00035 
00036   const med_idt       fid       = va_arg(params,const med_idt       );
00037   const char * const  fieldname = va_arg(params,const char * const  );
00038   const int           csit      = va_arg(params,const int           );
00039   med_int * const     numdt     = va_arg(params,med_int * const     );
00040   med_int * const     numit     = va_arg(params,med_int * const     );
00041   med_float * const   dt        = va_arg(params,med_float * const   );
00042   med_int * const     meshnumdt = va_arg(params,med_int * const     );
00043   med_int * const     meshnumit = va_arg(params,med_int * const     );
00044   med_err *           fret      = va_arg(params,        med_err*    );
00045 
00046 
00047   med_err   _ret=-1,_err=0;
00048   med_size  _num=csit-1;
00049 
00050   med_idt   _datagroup1=0;
00051   char      _datagroupname1[2*MED_MAX_PARA+1]         ="";
00052   char      _ent_geo       [2*MED_TAILLE_NOM_ENTITE+2]="";
00053   char      _path          [(MED_TAILLE_CHA+MED_TAILLE_NOM+1)+
00054                             (2*MED_TAILLE_NOM_ENTITE+1)+1+(2*MED_MAX_PARA)+1]=MED_CHA;
00055   med_size _ncpst=0;
00056   med_bool _checkmultiplemesh=MED_TRUE, _multiplemesh       =MED_FALSE;
00057   med_bool _checkmeshname    =MED_TRUE,  _samedefaultmeshname=MED_FALSE;
00058 
00059   /*
00060    * On inhibe le gestionnaire d'erreur HDF 5
00061    */
00062   _MEDmodeErreurVerrouiller();
00063 
00064   /*
00065    * On construit le nom du datagroup
00066    */
00067   strcat(_path,fieldname);
00068 
00069 /*   if ( _MEDfieldComputingStepCheck236(fid,  fieldname, */
00070 /*                                    &_ncpst, */
00071 /*                                    _checkmultiplemesh, &_multiplemesh, */
00072 /*                                    _checkmeshname,     &_samedefaultmeshname) < 0) { */
00073 /*     MED_ERR_(_ret,MED_ERR_INVALID,MED_ERR_FIELD,fieldname); */
00074 /*     goto ERROR; */
00075 /*   } */
00076 
00077 
00078   if ( _MEDobjectGetName(fid, _path ,0, _ent_geo) < 0 ) {
00079     MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,_path);
00080     SSCRUTE(_path); SSCRUTE(_ent_geo); goto ERROR;
00081   }
00082 
00083   strcat(_path,"/");
00084   strcat(_path,_ent_geo);
00085 
00086   if ( _MEDobjectGetName(fid, _path ,_num, _datagroupname1) < 0 ) {
00087     MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,_path);
00088     SSCRUTE(_path); SSCRUTE(_ent_geo); goto ERROR;
00089   }
00090 
00091   strcat(_path,"/");
00092   strcat(_path,_datagroupname1);
00093 
00094   if ((_datagroup1 = _MEDdatagroupOuvrir(fid,_path)) < 0) {
00095     MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,_path);
00096     goto ERROR;
00097   }
00098 
00099 
00100   /*
00101    * Lecture des attributs
00102    */
00103 
00104   if (_MEDattrEntierLire(_datagroup1,MED_NOM_NDT,(med_int*) numdt) < 0) {
00105     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_NDT);
00106     SSCRUTE(_path);ISCRUTE(*numdt);goto ERROR;
00107   }
00108 
00109   if (_MEDattrFloatLire(_datagroup1,MED_NOM_PDT,(med_float*) dt) < 0) {
00110     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_PDT);
00111     SSCRUTE(_path);RSCRUTE(*dt);goto ERROR;
00112   }
00113 
00114   if (_MEDattrEntierLire(_datagroup1,MED_NOM_NOR,(med_int*) numit) < 0) {
00115     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_NOR);
00116     SSCRUTE(_path);ISCRUTE(*numit);goto ERROR;
00117   }
00118 
00119   *meshnumdt = MED_NOPDT;
00120   *meshnumit = MED_NONOR;
00121 
00122   _ret = 0;
00123 
00124  ERROR:
00125 
00126 
00127 
00128   if (_datagroup1>0)            if (_MEDdatagroupFermer(_datagroup1) < 0) {
00129     MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_path);
00130     ISCRUTE_id(_datagroup1);
00131   }
00132 
00133   va_end(params);
00134   *fret = _ret;
00135   return;
00136 
00137 }

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