MEDmeshPolygonRd.c

Aller à la documentation de ce fichier.
00001 /*  This file is part of MED.
00002  *
00003  *  COPYRIGHT (C) 1999 - 2015  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 
00043 med_err
00044 MEDmeshPolygonRd(const med_idt               fid,
00045                  const char*  const          meshname,
00046                  const med_int               numdt,
00047                  const med_int               numit,
00048                  const med_entity_type       entitype,
00049                  const med_connectivity_mode cmode,
00050                  med_int * const             polyindex,
00051                  med_int * const             connectivity )
00052 {
00053   med_access_mode _MED_ACCESS_MODE;
00054   med_idt         _meshid=0;
00055   med_err         _ret         = -1;
00056   med_data_type   _datatype    = MED_UNDEF_DATATYPE;
00057   med_entity_type _entitytype=entitype;
00058 
00059   /*
00060    * On inhibe le gestionnaire d'erreur HDF 5
00061    */
00062   _MEDmodeErreurVerrouiller();
00063 
00064   if ( (_MED_ACCESS_MODE = _MEDmodeAcces(fid) ) == MED_ACC_UNDEF ) {
00065     MED_ERR_(_ret,MED_ERR_UNRECOGNIZED,MED_ERR_ACCESSMODE,MED_ERR_FILE_MSG);
00066     goto ERROR;
00067   }
00068 
00069   /* Tester le type d'entité ?
00070    * MAILLE Ok
00071    * FACE   OK
00072    * ARETE  ?
00073    * NOEUD  KO
00074    * NOEUD_MAILLE  ?
00075    */
00076   if (entitype == MED_NODE_ELEMENT ) _entitytype=MED_NODE ;
00077 
00078   if (_MEDmeshAdvancedRd(fid,
00079                          meshname,
00080                          MED_CONNECTIVITY,
00081                          MED_NO_NAME,
00082                          MED_INTERNAL_UNDEF,
00083                          numdt,
00084                          numit,
00085                          _entitytype,
00086                          MED_POLYGON,
00087                          cmode,
00088                          MED_UNDEF_PFLMODE,
00089                          MED_NO_PROFILE,
00090                          MED_FULL_INTERLACE,
00091                          MED_ALL_CONSTITUENT,
00092                          NULL,
00093                          (unsigned char * const)connectivity) < 0 ) {
00094     MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"_MEDmeshAdvancedRd (MED_CONNECTIVITY) ");
00095     goto ERROR;
00096   }
00097 
00098   if (_MEDmeshAdvancedRd(fid,
00099                          meshname,
00100                          MED_INDEX_NODE,
00101                          MED_NO_NAME,
00102                          MED_INTERNAL_UNDEF,
00103                          numdt,
00104                          numit,
00105                          _entitytype,
00106                          MED_POLYGON,
00107                          cmode,
00108                          MED_UNDEF_PFLMODE,
00109                          MED_NO_PROFILE,
00110                          MED_FULL_INTERLACE,
00111                          MED_ALL_CONSTITUENT,
00112                          NULL,
00113                          (unsigned char * const)polyindex) < 0 ) {
00114     MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"_MEDmeshAdvancedRd (MED_INDEX_NODE) ");
00115     goto ERROR;
00116   }
00117 
00118   _ret = 0;
00119 
00120  ERROR:
00121 
00122   return _ret;
00123 
00124 }

Généré le Thu Oct 8 14:26:16 2015 pour MED fichier par  doxygen 1.6.1