MEDmeshPolygon2Wr.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 
00045 med_err
00046 MEDmeshPolygon2Wr(const med_idt               fid,
00047                  const char*  const          meshname,
00048                  const med_int               numdt,
00049                  const med_int               numit,
00050                  const med_float             dt,
00051                  const med_entity_type       entitype,
00052                  const med_geometry_type     polytype,
00053                  const med_connectivity_mode cmode,
00054                  const med_int               indexsize,
00055                  const med_int * const       polyindex,
00056                  const med_int * const       connectivity )
00057 {
00058   med_access_mode _MED_ACCESS_MODE;
00059   med_idt         _meshid=0;
00060   med_err         _ret         = -1;
00061   med_data_type   _datatype    = MED_UNDEF_DATATYPE;
00062   med_int         _multi       = 1;
00063   /*
00064    * On inhibe le gestionnaire d'erreur HDF 5
00065    */
00066   _MEDmodeErreurVerrouiller();
00067  if (_MEDcheckVersion30(fid) < 0) goto ERROR;
00068 
00069   if ( (_MED_ACCESS_MODE = _MEDmodeAcces(fid) ) == MED_ACC_UNDEF ) {
00070     MED_ERR_(_ret,MED_ERR_UNRECOGNIZED,MED_ERR_ACCESSMODE,MED_ERR_FILE_MSG);
00071     goto ERROR;
00072   }
00073 
00074   if ( _MED_ACCESS_MODE == MED_ACC_RDONLY) {
00075     MED_ERR_(_ret,MED_ERR_INVALID,MED_ERR_ACCESSMODE,MED_ERR_FILE_MSG);
00076     ISCRUTE_int(_MED_ACCESS_MODE);
00077     goto ERROR;
00078   }
00079 
00080 
00081   /* Tester le type d'entité ?
00082    * MAILLE Ok
00083    * FACE   OK
00084    * ARETE  ?
00085    * NOEUD  KO
00086    * NOEUD_MAILLE  ?
00087    */
00088 
00089 /*   ISCRUTE(indexsize); */
00090 /*   ISCRUTE(polyindex[indexsize-1] - polyindex[0]); */
00091 
00092   switch(polytype)
00093     {
00094     case MED_POLYGON:
00095       break;
00096     case MED_POLYGON2:
00097       /*_multi est devenu inutile.*/
00098       _multi=1;
00099       break;
00100     default:
00101       MED_ERR_(_ret,MED_ERR_RANGE,MED_ERR_GEOMETRIC,MED_ERR_VALUE_MSG);
00102       ISCRUTE_int(polytype);
00103       goto ERROR;
00104     }
00105 
00106   if (_MEDmeshAdvancedWr(fid,
00107                          meshname,
00108                          MED_CONNECTIVITY,
00109                          MED_NO_NAME,
00110                          MED_INTERNAL_UNDEF,
00111                          numdt,
00112                          numit,
00113                          dt,
00114                          entitype,
00115                          polytype,
00116                          cmode,
00117                          MED_UNDEF_PFLMODE,
00118                          MED_NO_PROFILE,
00119                          MED_FULL_INTERLACE,
00120                          MED_ALL_CONSTITUENT,
00121                          NULL,
00122                          _multi*(polyindex[indexsize-1] - polyindex[0]),
00123                          connectivity) < 0 ) {
00124     MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"_MEDmeshAdvancedWr (MED_CONNECTIVITY) ");
00125     goto ERROR;
00126   }
00127 
00128   if (_MEDmeshAdvancedWr(fid,
00129                          meshname,
00130                          MED_INDEX_NODE,
00131                          MED_NO_NAME,
00132                          MED_INTERNAL_UNDEF,
00133                          numdt,
00134                          numit,
00135                          dt,
00136                          entitype,
00137                          polytype,
00138                          cmode,
00139                          MED_UNDEF_PFLMODE,
00140                          MED_SAME_PROFILE_INTERNAL,
00141                          MED_FULL_INTERLACE,
00142                          MED_ALL_CONSTITUENT,
00143                          NULL,
00144                          indexsize,
00145                          polyindex) < 0 ) {
00146     MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"_MEDmeshAdvancedWr (MED_INDEX_NODES) ");
00147     goto ERROR;
00148   }
00149 
00150   _ret = 0;
00151 
00152  ERROR:
00153 
00154   return _ret;
00155 
00156 }

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