MEDelementsLire.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 
00022 med_err
00023 MEDelementsLire(med_idt fid,char *maa,med_int mdim,med_int *connectivite,med_mode_switch mode_switch,
00024                char *nom,med_booleen *inom,med_int *num,med_booleen *inum,
00025                med_int *fam,med_int nele,med_entite_maillage type_ent, 
00026                med_geometrie_element typ_geo,med_connectivite typ_conn)
00027 {
00028   med_int i;
00029   med_entite_maillage _type_ent=type_ent;
00030 
00031   if ( type_ent == MED_NOEUD_MAILLE ) _type_ent=MED_NOEUD ;
00032 
00033   /* 
00034    * Lecture de la connectivite :
00035    * - On renvoie -1 en cas d'échec
00036    */
00037   if (MEDconnLire(fid,maa,mdim,connectivite,mode_switch,0,MED_NOPF,
00038                          _type_ent,typ_geo,typ_conn) < 0)
00039     return -1;
00040 
00041   /* 
00042    * Lecture des noms (presence optionnelle dans un maillage MED)
00043    */
00044   if (MEDnomLire(fid,maa,nom,nele,_type_ent,typ_geo) < 0)
00045     *inom = MED_FAUX;
00046   else
00047     *inom = MED_VRAI;
00048 
00049   /* 
00050    * Lecture des numeros (presence optionnelle dans un maillage MED)
00051    */
00052   if (MEDnumLire(fid,maa,num,nele,_type_ent,typ_geo) < 0)
00053     *inum = MED_FAUX;
00054   else
00055     *inum = MED_VRAI;
00056 
00057   /* Lecture des numeros de familles :
00058    *  - si pas de numeros de familles, cela siginifie qu'ils 
00059    *    tous egaux a 0
00060    */
00061   if (MEDfamLire(fid,maa,fam,nele,_type_ent,typ_geo) < 0)
00062     for (i=0;i<nele;i++)
00063       *(fam+i) = 0;
00064   
00065   /*
00066    * Tout s'est bien passé
00067    */
00068   return 0;
00069 }

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