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

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