# MEDmeshPolyhedronRd.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
    00044 med_err
    00045 MEDmeshPolyhedronRd(const med_idt               fid,
    00046                     const char*  const          meshname,
    00047                     const med_int               numdt,
    00048                     const med_int               numit,
    00049                     const med_entity_type       entitype,
    00050                     const med_connectivity_mode cmode,
    00051                     med_int * const             faceindex,
    00052                     med_int * const             nodeindex,
    00053                     med_int * const             connectivity )
    00054 {
    00055
    00056   med_access_mode _MED_ACCESS_MODE;
    00057   med_idt         _meshid=0;
    00058   med_err         _ret         = -1;
    00059   med_data_type   _datatype    = MED_UNDEF_DATATYPE;
    00060   med_entity_type _entitytype=entitype;
    00061
    00062   /*
    00063    * On inhibe le gestionnaire d'erreur HDF 5
    00064    */
    00065   _MEDmodeErreurVerrouiller();
    00066
    00067   if ( (_MED_ACCESS_MODE = _MEDmodeAcces(fid) ) == MED_ACC_UNDEF ) {
    00068     MED_ERR_(_ret,MED_ERR_UNRECOGNIZED,MED_ERR_ACCESSMODE,MED_ERR_FILE_MSG);
    00069     goto ERROR;
    00070   }
    00071
    00072   /* Tester le type d'entité ?
    00073    * MAILLE Ok
    00074    * FACE   OK
    00075    * ARETE  ?
    00076    * NOEUD  KO
    00077    * NOEUD_MAILLE  ?
    00078    */
    00079   if (entitype == MED_NODE_ELEMENT ) _entitytype=MED_NODE ;
    00080
    00081   if (_MEDmeshAdvancedRd(fid,
    00082                          meshname,
    00083                          MED_CONNECTIVITY,
    00084                          MED_NO_NAME,
    00085                          MED_INTERNAL_UNDEF,
    00086                          numdt,
    00087                          numit,
    00088                          _entitytype,
    00089                          MED_POLYHEDRON,
    00090                          cmode,
    00091                          MED_UNDEF_PFLMODE,
    00092                          MED_NO_PROFILE,
    00093                          MED_FULL_INTERLACE,
    00094                          MED_ALL_CONSTITUENT,
    00095                          NULL,
    00096                          (unsigned char * const) connectivity) < 0 ) {
    00097     MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"_MEDmeshAdvancedRd (MED_CONNECTIVITY) ");
    00098     goto ERROR;
    00099   }
    00100
    00101   if (_MEDmeshAdvancedRd(fid,
    00102                          meshname,
    00103                          MED_INDEX_NODE,
    00104                          MED_NO_NAME,
    00105                          MED_INTERNAL_UNDEF,
    00106                          numdt,
    00107                          numit,
    00108                          _entitytype,
    00109                          MED_POLYHEDRON,
    00110                          cmode,
    00111                          MED_UNDEF_PFLMODE,
    00112                          MED_NO_PROFILE,
    00113                          MED_FULL_INTERLACE,
    00114                          MED_ALL_CONSTITUENT,
    00115                          NULL,
    00116                          (unsigned char * const) nodeindex) < 0 ) {
    00117     MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"_MEDmeshAdvancedRd (MED_INDEX_NODE) ");
    00118     goto ERROR;
    00119   }
    00120
    00121   if (_MEDmeshAdvancedRd(fid,
    00122                          meshname,
    00123                          MED_INDEX_FACE,
    00124                          MED_NO_NAME,
    00125                          MED_INTERNAL_UNDEF,
    00126                          numdt,
    00127                          numit,
    00128                          _entitytype,
    00129                          MED_POLYHEDRON,
    00130                          cmode,
    00131                          MED_UNDEF_PFLMODE,
    00132                          MED_NO_PROFILE,
    00133                          MED_FULL_INTERLACE,
    00134                          MED_ALL_CONSTITUENT,
    00135                          NULL,
    00136                          (unsigned char * const) faceindex) < 0 ) {
    00137     MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"_MEDmeshAdvancedRd (MED_INDEX_NODE) ");
    00138     goto ERROR;
    00139   }
    00140
    00141   _ret = 0;
    00142
    00143  ERROR:
    00144
    00145   return _ret;
    00146 }