_MEDmeshAdvancedRd30.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 #include <stdlib.h>
00024 
00025 void _MEDmeshAdvancedRd30(int dummy, ...)
00026 {
00027   va_list params;
00028   va_start(params,dummy);
00029 
00030   const med_idt               fid         = va_arg(params, const med_idt               );
00031   const char*  const          meshname    = va_arg(params, const char*  const          );
00032   const med_data_type         meddatatype = va_arg(params, const med_data_type         );
00033   const char*  const          datasetname = va_arg(params, const char*  const          );
00034   const med_internal_type     datatype    = va_arg(params, const med_internal_type     );
00035   const med_int               numdt       = va_arg(params, const med_int               );
00036   const med_int               numit       = va_arg(params, const med_int               );
00037   const med_entity_type       entitytype  = va_arg(params, const med_entity_type       );
00038   const med_geometry_type     geotype     = va_arg(params, const med_geometry_type     );
00039   const med_connectivity_mode cmode       = va_arg(params, const med_connectivity_mode );
00040   const med_storage_mode      storagemode = va_arg(params, const med_storage_mode      );
00041   const char * const          profilename = va_arg(params, const char * const          );
00042   const med_switch_mode       switchmode  = va_arg(params, const med_switch_mode       );
00043   const med_int               dimselect   = va_arg(params, const med_int               );
00044   const med_filter * const    filter      = va_arg(params, const med_filter * const    );
00045   unsigned char* const        value       = va_arg(params,       unsigned char* const  );
00046   med_err *                   fret        = va_arg(params,        med_err *);
00047 
00048   med_access_mode       _MED_ACCESS_MODE;
00049   med_err               _ret=-1;
00050   med_idt               _meshid=0, _elemid=0;
00051   med_idt               _datagroup=0,_fdatagroup=0,_dataset=0;
00052   med_idt               _datagroup1=0,_datagroup2=0,_datagroup3=0,_datagroup4=0;
00053   char                  _meshpath         [MED_TAILLE_SUP_MAA+MED_NAME_SIZE+1]="";
00054   char                  _strpath          [MED_TAILLE_STRCT+MED_NAME_SIZE+1]=MED_STRCT;
00055   char                  _datagroupname1   [2*MED_MAX_PARA+1]="";
00056   char                  _datagroupname2   [MED_TAILLE_NOM_ENTITE+1]="";
00057   char                  _datagroupname3   [MED_TAILLE_NOM_ENTITE+1]="";
00058   char                  _datagroupname4   [MED_NAME_SIZE+1]="";
00059   char                  _profilename      [MED_NAME_SIZE+1]="";
00060   char                  _geotypename      [MED_TAILLE_NOM_ENTITE+1]="";
00061 /*   char                  *_datasetname=NULL; */
00062   char                  _datasetname[MED_TAILLE_NOM_ENTITE+1]="";
00063   char                  _MED_NOM_COO[]=MED_NOM_COO, _MED_NOM_NOD[]=MED_NOM_NOD,_MED_NOM_DES[]=MED_NOM_DES;
00064   med_bool              _filterparameterexist=MED_FALSE;
00065 /*   int                   _entitydim=0,_entitynnodes=0,_entityndes=0; */
00066   med_filter *          _filter           = NULL;
00067   med_filter            _tmpfilter        = MED_FILTER_INIT;
00068   med_filter            _paramfilter      = MED_FILTER_INIT;
00069   med_int               _nbofconstituentpervalue=0,_spacedim=0;
00070   med_sorting_type      _sortingtype=0;
00071   med_int               _intsortingtype=0;
00072   med_int               _false=0,_true=1,_true_or_false=_false;
00073 /*   med_int               _profilearraysize=0; */
00074   char                  _MED_NO_PROFILE_INTERNAL[]=MED_NO_PROFILE_INTERNAL;
00075   char *                _tmpprofilename=_MED_NO_PROFILE_INTERNAL;
00076   med_internal_type     _datatype=datatype;
00077   med_int               _nbofvalueperentity=0;
00078   med_int               _intmeshtype=0;
00079   med_geometry_type     _sgeotype      = MED_NONE;
00080   med_int               _medintsgeotype= 0;
00081   med_bool              _chgt=MED_FALSE,_trsf=MED_FALSE;
00082   med_bool              _isasupportmesh=MED_FALSE;
00083   char                  _supportmeshname[MED_NAME_SIZE+1]="";
00084   med_bool              _datasetexist=MED_FALSE,_isasoftlink=MED_FALSE;
00085 
00086 
00087   if (filter) {
00088     _filter=(med_filter*)(filter); _filterparameterexist=MED_TRUE;
00089   }
00090   else {
00091     _filter=&_tmpfilter;
00092 /*     (*_filter).nbofentity              = nbofentity; */
00093     (*_filter).nbofvaluesperentity     = 1;
00094 /*   (*_filter).nbofconstituentpervalue = nbofconstituentpervalue; */
00095     (*_filter).constituentselect       = dimselect;
00096     (*_filter).switchmode              = switchmode;
00097     (*_filter).storagemode             = storagemode;
00098     strcpy((*_filter).profilename,profilename);
00099 /*   (*_filter).profilearraysize        = profilearraysize; */
00100   }
00101 
00102   /*
00103    * On inhibe le gestionnaire d'erreur HDF 5
00104    */
00105   _MEDmodeErreurVerrouiller();
00106 
00107   if ( (_MED_ACCESS_MODE = _MEDmodeAcces(fid) ) == MED_ACC_UNDEF ) {
00108     MED_ERR_(_ret,MED_ERR_UNRECOGNIZED,MED_ERR_ACCESSMODE,MED_ERR_FILE_MSG);
00109     goto ERROR;
00110   }
00111 
00112   /*
00113    * Si le DataGroup MED_MAA n'existe pas => erreur
00114    */
00115   NOFINALBLANK(meshname,ERROR);
00116 
00117 
00118   if ((_meshid=_MEDmeshDatagroupOpen(fid,meshname,_meshpath,&_isasupportmesh)) < 0) {
00119     MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,MED_ERR_MESH_MSG);
00120     SSCRUTE(_meshpath); goto ERROR;
00121   }
00122 
00123   /* Lecture de l'attribut MED_NOM_ESP  */
00124   if (_MEDattrEntierLire(_meshid,MED_NOM_ESP,&_spacedim) < 0) {
00125     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_MESH_MSG);
00126     SSCRUTE(meshname);SSCRUTE(MED_NOM_ESP);goto ERROR;
00127   }
00128 
00129   /* Lecture de l'attribut MED_NOM_TYP  */
00130   if (_MEDattrEntierLire(_meshid,MED_NOM_TYP,&_intmeshtype) < 0) {
00131     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_MESH_MSG);
00132     SSCRUTE(meshname);SSCRUTE(MED_NOM_TYP);ISCRUTE(_intmeshtype);goto ERROR;
00133   }
00134 
00135 
00136   /*DEBUT  TODO : Externaliser ce traitement lié  aux éléments de structures */
00137   if ( entitytype == MED_STRUCT_ELEMENT ) {
00138     if ( MEDstructElementName(fid, geotype,_geotypename) < 0 ) {
00139       MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"MEDstructElementName");
00140       ISCRUTE_int(geotype);goto ERROR;
00141     }
00142 
00143     if (meddatatype != MED_VARIABLE_ATTRIBUTE) {
00144       strcat(_strpath,_geotypename);
00145 
00146       /*
00147        * Si le DataGroup /STRUCT/<elementname> n'existe pas => erreur
00148        */
00149       if ((_elemid = _MEDdatagroupOpen(fid,_strpath)) < 0)  {
00150         MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,_strpath);
00151         goto ERROR;
00152       }
00153 
00154        /*
00155        * Lecture de l'attribut MED_NOM_NOM (nom du maillage support)
00156        */
00157       /* Chercher plutôt ds le maillage support et supprimer les attributs NBM et NBN */
00158       if ( _MEDattrStringLire(_elemid,MED_NOM_NOM,MED_NAME_SIZE,_supportmeshname) < 0) {
00159         MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,_strpath);
00160         SSCRUTE(MED_NOM_NOM);SSCRUTE(_supportmeshname);
00161         goto ERROR;
00162       }
00163 
00164       /*
00165        * Lecture de l'attribut MED_NOM_GEO (type géométrique des mailles support)
00166        */
00167       if ( _MEDattrEntierLire(_elemid,MED_NOM_GEO,&_medintsgeotype) < 0 ) {
00168         MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,_strpath);
00169         SSCRUTE(MED_NOM_GEO);ISCRUTE(_medintsgeotype);
00170         goto ERROR;
00171       }
00172       _sgeotype = _medintsgeotype;
00173 
00174       if (strlen(_supportmeshname) )
00175         if ( (_nbofvalueperentity = MEDmeshnEntity(fid,_supportmeshname,MED_NO_DT,MED_NO_IT,
00176                                                    MED_CELL,_sgeotype,MED_CONNECTIVITY,MED_NODAL,
00177                                                    &_chgt,&_trsf) )  < 0) {
00178           MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"MEDmeshnEntity");
00179           ISCRUTE(_nbofvalueperentity);goto ERROR;
00180         }
00181 
00182       if (!_nbofvalueperentity) _nbofvalueperentity=1;
00183 
00184      /*
00185        * REM : Les routines ayant besoin du nombre de noeuds sont implémentées
00186        spécifiquement.
00187       */
00188 
00189       if (!_nbofconstituentpervalue) _nbofconstituentpervalue=1;
00190 
00191     }
00192   }
00193 
00194   if (meddatatype == MED_VARIABLE_ATTRIBUTE) {
00195     if ( MEDstructElementVarAttInfoByName(fid,
00196                                           _geotypename,
00197                                           datasetname,
00198                                           (med_attribute_type* const) &_datatype,
00199                                           &_nbofconstituentpervalue
00200                                           ) < 0) {
00201       MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"MEDstructElementVarAttInfoByName");
00202       ISCRUTE_int(geotype);SSCRUTE(datasetname);
00203       ISCRUTE_int(_datatype);ISCRUTE(_nbofconstituentpervalue);goto ERROR;
00204     }
00205     _nbofvalueperentity=1;
00206   }
00207 
00208   /* FIN TODO*/
00209 
00210   /* Si un nom de dataset est précisé, il est prioritaire sur la detection automatique en
00211      fonction des paramètres meddatatype et cmode */
00212   if ( !strlen(datasetname) ) {
00213     if ( _MEDgetDatasetName( _datasetname, meddatatype, cmode ) < 0 ) {
00214       MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"_MEDgetDatasetname");
00215       ISCRUTE_int(meddatatype);ISCRUTE_int(cmode);SSCRUTE( _datasetname);goto ERROR;
00216     }
00217   } else
00218     strncpy(_datasetname,datasetname,MED_TAILLE_NOM_ENTITE+1);
00219 
00220 
00221   /* Si un type de dataset est précisé, il est prioritaire sur la détection automatique en
00222      fonction des paramètres meddatatype et cmode */
00223   /* TODO : renommer datatype en idatatype (internal) */
00224   if ( _datatype == MED_INTERNAL_UNDEF)
00225     if ( _MEDgetDatatype( &_datatype, meddatatype, cmode ) < 0 ) {
00226       MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"_MEDgetDatatype");
00227       ISCRUTE_int(meddatatype);ISCRUTE_int(cmode);ISCRUTE_int(_datatype);goto ERROR;
00228     }
00229 
00230   /* Vérification :
00231      Le type de données MED traitées sont-elles compatibles avec le type de maillage ?
00232   */
00233   /* REM : Si datasetname ou datatype ne sont pas précisés, meddatatype doit l'être */
00234   if ( meddatatype != MED_UNDEF_DATATYPE )
00235     if ( _MEDmeshtypeCompatibility(meddatatype, _intmeshtype) < 0) {
00236       MED_ERR_(_ret,MED_ERR_RANGE,MED_ERR_MEDDATATYPE,MED_ERR_VALUE_MSG);
00237       ISCRUTE_int(meddatatype);ISCRUTE(_intmeshtype);goto ERROR;
00238     }
00239 
00240   if ( ! (_nbofvalueperentity && _nbofconstituentpervalue) )
00241     if ( _MEDgetDatasetParameter( meddatatype, _spacedim, entitytype, geotype, cmode,
00242                                   &_nbofvalueperentity,&_nbofconstituentpervalue) < 0 ) {
00243       MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"_MEDgetDatasetParameter");
00244       ISCRUTE_int(meddatatype);ISCRUTE_int(cmode);ISCRUTE(_nbofvalueperentity);
00245       ISCRUTE(_nbofconstituentpervalue);goto ERROR;
00246     }
00247 
00248   if (_filterparameterexist) {
00249     if ((*_filter).nbofconstituentpervalue != _nbofconstituentpervalue ) {
00250       MED_ERR_(_ret,MED_ERR_NOTEQUAL,MED_ERR_ATTRIBUTE,MED_ERR_VALUE_MSG);
00251       ISCRUTE((*_filter).nbofconstituentpervalue); ISCRUTE(_nbofconstituentpervalue );
00252       goto ERROR;
00253     }
00254     if ((*_filter).nbofvaluesperentity != _nbofvalueperentity ) {
00255       MED_ERR_(_ret,MED_ERR_NOTEQUAL,MED_ERR_ATTRIBUTE,MED_ERR_VALUE_MSG);
00256       ISCRUTE((*_filter).nbofvaluesperentity); ISCRUTE(_nbofvalueperentity );
00257       goto ERROR;
00258     }
00259   } else {
00260     (*_filter).nbofconstituentpervalue = _nbofconstituentpervalue;
00261     (*_filter).nbofvaluesperentity     = _nbofvalueperentity;
00262   }
00263 
00264   /*
00265    * Ouverture du datagroup de niveau 2 <numdt>.<numit>
00266    */
00267   if ( _MEDattrEntierLire(_meshid,MED_NOM_SRT,&_intsortingtype) < 0) {
00268     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_MESH_MSG);
00269     SSCRUTE(meshname);SSCRUTE(MED_NOM_SRT);ISCRUTE(_intsortingtype);goto ERROR;
00270   }
00271   _sortingtype = (med_sorting_type) (_intsortingtype);
00272 
00273   _MEDgetComputationStepName(_sortingtype,numdt,numit,_datagroupname1);
00274   if ( (_datagroup1 = _MEDdatagroupOuvrir(_meshid,_datagroupname1)) < 0 ) {
00275     MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,MED_ERR_MESH_MSG);
00276     SSCRUTE(meshname);ISCRUTE(numit);ISCRUTE(numdt);
00277     SSCRUTE(_datagroupname1);ISCRUTE_id(_datagroup1);goto ERROR;
00278   }
00279 
00280 
00281 
00282   /*
00283    *  Ouverture du datagroup de niveau 3 <entitytype>
00284    */
00285   if (_MEDgetEntityTypeName(_datagroupname2,entitytype) < 0) {
00286     MED_ERR_(_ret,MED_ERR_INVALID,MED_ERR_ENTITY,MED_ERR_VALUE_MSG);
00287     ISCRUTE_int(entitytype);SSCRUTE(meshname);ISCRUTE(numit);ISCRUTE(numdt);goto ERROR;
00288   }
00289 
00290   if ((_datagroup2 = _MEDdatagroupOuvrir(_datagroup1,_datagroupname2)) < 0) {
00291     MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,MED_ERR_MESH_MSG);
00292     SSCRUTE(meshname);ISCRUTE(numit);ISCRUTE(numdt);SSCRUTE(_datagroupname2);
00293     goto ERROR;
00294   }
00295 
00296 
00297 
00298   /*
00299    *  Ouverture du datagroup de niveau 4 [.<geotype>]
00300    */
00301 
00302   if ( entitytype != MED_NODE ) {
00303 
00304     if (strlen(_geotypename))
00305       strncpy(_datagroupname3,_geotypename,MED_NAME_SIZE+1);
00306     else
00307       if ( _MEDgetGeometryTypeName(_datagroupname3,geotype) < 0) {
00308         MED_ERR_(_ret,MED_ERR_INVALID,MED_ERR_GEOMETRIC,MED_ERR_VALUE_MSG);
00309         ISCRUTE_int(geotype);SSCRUTE(meshname);ISCRUTE(numit);ISCRUTE(numdt);
00310         SSCRUTE(_datagroupname2);goto ERROR;
00311       }
00312 
00313     if ((_datagroup3 = _MEDdatagroupOuvrir(_datagroup2,_datagroupname3)) < 0) {
00314           MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,MED_ERR_MESH_MSG);
00315           SSCRUTE(meshname);ISCRUTE(numit);ISCRUTE(numdt);
00316           SSCRUTE(_datagroupname2);SSCRUTE(_datagroupname3);goto ERROR;
00317     }
00318   }
00319 
00320 
00321   if (_datagroup3) _datagroup=_datagroup3; else _datagroup=_datagroup2;
00322 
00323   /*
00324    *  Ouverture du datagroup de niveau 5 [VARATR]
00325    */
00326   /*Problème d'activation du profil */
00327   if ( (meddatatype == MED_VARIABLE_ATTRIBUTE) || (meddatatype == MED_COORDINATE_TRSF) ) {
00328     /* TODO : Pour simplifier et systématiser la procédure il faut
00329        créer une routine spécifique qui donne le nom du datagroup  supplémentaire optionnel.
00330        Si le retour est "" ne pas créer le datagroup. */
00331     if (meddatatype == MED_VARIABLE_ATTRIBUTE)
00332       strcpy(_datagroupname4,MED_VARATR_NOM);
00333     else
00334       strcpy(_datagroupname4,MED_COOTRF_NOM);
00335 
00336     if ((_datagroup4 = _MEDdatagroupOuvrir(_datagroup,_datagroupname4)) < 0) {
00337       MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,MED_ERR_MESH_MSG);
00338       SSCRUTE(meshname);ISCRUTE(numit);ISCRUTE(numdt);SSCRUTE(_datagroupname2);
00339       SSCRUTE(_datagroupname3);SSCRUTE(_datagroupname4);SSCRUTE(MED_VARATR_NOM);goto ERROR;
00340     }
00341   }
00342 
00343   if (_datagroup4) _fdatagroup=_datagroup4; else _fdatagroup=_datagroup;
00344 
00345   /*
00346    * Attribut PFL (nombre de noeuds ou d'elements)
00347    */
00348   if ( _MEDattrStringLire(_datagroup,MED_NOM_PFL,MED_NAME_SIZE,_profilename) < 0) {
00349     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_MESH_MSG);
00350     SSCRUTE(meshname);ISCRUTE(numit);ISCRUTE(numdt);SSCRUTE(_datagroupname2);
00351     SSCRUTE(_datagroupname3); SSCRUTE(MED_NOM_PFL);SSCRUTE(_profilename);goto ERROR;
00352   }
00353 
00354   /*
00355    * Coh�rence de l'attribut PFL (nombre de noeuds ou d'elements)
00356    */
00357   if ( strlen((*_filter).profilename)  )   /* != MED_NOPFL*/
00358     _tmpprofilename=(*_filter).profilename;
00359 
00360   if ( strcmp(_tmpprofilename,_profilename) ) {
00361     MED_ERR_(_ret,MED_ERR_NOTEQUAL,MED_ERR_ATTRIBUTE,MED_ERR_PROFILE_MSG);
00362     SSCRUTE(_tmpprofilename);SSCRUTE((*_filter).profilename);
00363     SSCRUTE(meshname);ISCRUTE(numit);ISCRUTE(numdt);SSCRUTE(_datagroupname2);
00364     SSCRUTE(_datagroupname3);goto ERROR;
00365   }
00366 
00367 /*INUTILE : le param�tre est positionn� dans  MEDfilterEntityCr */
00368 /*   if (!_filterparameterexist) (*_filter).profilearraysize =  _profilearraysize; */
00369 
00370 
00371   /*
00372    * Attribut NBR (nombre de noeuds ou d'elements)
00373    */
00374 
00375   if (_MEDdatasetExist(_fdatagroup,_datasetname,&_datasetexist,&_isasoftlink) < 0) {
00376     MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"_MEDdatasetExist");
00377     SSCRUTE(meshname);ISCRUTE(numit);ISCRUTE(numdt);SSCRUTE(_datagroupname2);
00378     SSCRUTE(_datagroupname3);SSCRUTE(_datasetname);SSCRUTE(_profilename);
00379     goto ERROR;
00380   }
00381 
00382   /*INHIBITION DU MESSAGE POUR COMPATIBILITE COMPORTEMENT 2.3.6*/
00383   if ( !_datasetexist) {
00384     _ret = MED_ERR_DOESNTEXIST;
00385     goto ERROR;
00386   }
00387 
00388   if ((_dataset = _MEDdatasetOuvrir(_fdatagroup,_datasetname)) < 0) {
00389     MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATASET,_datasetname);
00390     SSCRUTE(meshname);ISCRUTE(numit);ISCRUTE(numdt);
00391     SSCRUTE(_datagroupname2);SSCRUTE(_datagroupname3);
00392     goto ERROR;
00393   }
00394 
00395   if ( _MEDattrEntierLire(_dataset,MED_NOM_NBR,&((*_filter).nbofentity)) < 0) {
00396     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_MESH_MSG);
00397     SSCRUTE(meshname);ISCRUTE(numit);ISCRUTE(numdt);SSCRUTE(_datagroupname2);SSCRUTE(_datagroupname3);
00398     SSCRUTE(MED_NOM_NBR);ISCRUTE((*_filter).nbofentity);goto ERROR;
00399   }
00400 
00401 
00402   if (!_filterparameterexist) {
00403 
00404 #if _DEBUG_
00405     ISCRUTE((*_filter).nbofentity              );
00406     ISCRUTE((*_filter).nbofvaluesperentity     );
00407     ISCRUTE((*_filter).nbofconstituentpervalue );
00408     ISCRUTE((*_filter).constituentselect       );
00409     ISCRUTE_int((*_filter).switchmode              );
00410     ISCRUTE((*_filter).filterarraysize         );
00411     ISCRUTE((*_filter).profilearraysize        );
00412     ISCRUTE_int((*_filter).storagemode             );
00413     SSCRUTE((*_filter).profilename             );
00414 #endif
00415 
00416     if ( MEDfilterEntityCr(fid, (*_filter).nbofentity,         (*_filter).nbofvaluesperentity,
00417                            (*_filter).nbofconstituentpervalue, (*_filter).constituentselect,
00418                            (*_filter).switchmode,              (*_filter).storagemode,
00419                            (*_filter).profilename, MED_UNDEF_SIZE, NULL, &_paramfilter) < 0 ) {
00420       MED_ERR_(_ret,MED_ERR_CREATE,MED_ERR_FILTER,MED_ERR_INTERNAL_MSG);
00421       goto ERROR;
00422     }
00423     _filter = &_paramfilter;
00424   }
00425 #if _DEBUG_
00426   ISCRUTE((*_filter).nbofentity              );
00427   ISCRUTE((*_filter).nbofvaluesperentity     );
00428   ISCRUTE((*_filter).nbofconstituentpervalue );
00429   ISCRUTE((*_filter).constituentselect       );
00430   ISCRUTE_int((*_filter).switchmode              );
00431   ISCRUTE((*_filter).filterarraysize         );
00432   ISCRUTE((*_filter).profilearraysize        );
00433   ISCRUTE_int((*_filter).storagemode             );
00434   SSCRUTE((*_filter).profilename             );
00435   ISCRUTE_int(_datatype);
00436 #endif
00437 
00438   /*Il n'y a pas de connectivité à écrire pour les particules */
00439   if (!( ( meddatatype == MED_CONNECTIVITY   )  &&
00440          (!strcmp(_geotypename,"MED_PARTICLE"))
00441          ) )
00442     if ( _MEDdatasetRd(_fdatagroup,_datasetname,_datatype,_filter,value) < 0) {
00443       MED_ERR_(_ret,MED_ERR_READ,MED_ERR_DATASET,datasetname);
00444       SSCRUTE(meshname);ISCRUTE(numit);ISCRUTE(numdt);SSCRUTE(_datagroupname2);
00445       SSCRUTE(_datagroupname3);SSCRUTE(_profilename);
00446       goto ERROR;
00447     }
00448 
00449   _ret = 0;
00450 
00451  ERROR:
00452 
00453   if (!_filterparameterexist) {
00454     if ( MEDfilterClose(_filter) < 0 ) {
00455       MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_FILTER,MED_ERR_MESH_MSG);
00456     SSCRUTE(meshname);ISCRUTE(numit);ISCRUTE(numdt);SSCRUTE(_datagroupname2);SSCRUTE(_datagroupname3);
00457     SSCRUTE(_profilename);goto ERROR;
00458     }
00459   }
00460 
00461   if (_dataset>0)     if (_MEDdatasetFermer(_dataset) < 0) {
00462     MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATASET,MED_NOM_COO);
00463     ISCRUTE_id(_dataset);
00464   }
00465 
00466   if (_datagroup4>0)     if (_MEDdatagroupFermer(_datagroup4) < 0) {
00467     MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,MED_VARATR_NOM);
00468     ISCRUTE_id(_datagroup4);
00469   }
00470 
00471   if (_datagroup3>0)     if (_MEDdatagroupFermer(_datagroup3) < 0) {
00472     MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_datagroupname3);
00473     ISCRUTE_id(_datagroup3);
00474   }
00475 
00476   if (_datagroup2>0)     if (_MEDdatagroupFermer(_datagroup2) < 0) {
00477     MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_datagroupname2);
00478     ISCRUTE_id(_datagroup2);
00479   }
00480 
00481   if (_datagroup1>0)     if (_MEDdatagroupFermer(_datagroup1) < 0) {
00482     MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_datagroupname1);
00483     ISCRUTE_id(_datagroup1);
00484   }
00485 
00486   if (_meshid>0)            if (_MEDdatagroupFermer(_meshid) < 0) {
00487     MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_meshpath);
00488     ISCRUTE_id(_meshid);
00489   }
00490 
00491 
00492   va_end(params);
00493   *fret = _ret;
00494 
00495   return;
00496 }
00497 

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