# MEDnoeudsLire.c

Aller à la documentation de ce fichier.

    00001 /*  This file is part of MED.
    00002  *
    00003  *  COPYRIGHT (C) 1999 - 2012  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 MEDnoeudsLire(med_idt fid,char *maa,med_int mdim, med_float *coord,
    00024               med_mode_switch mode_coo,
    00025               med_repere *repere,char *nomcoo, char *unicoo,char *nom,
    00026               med_booleen *inom,med_int *num,med_booleen *inum,med_int *fam,
    00027               med_int nnoeuds)
    00028 {
    00029   med_int i;
    00030
    00031   /*
    00032    * Lecture des coordonnees des noeuds (presence obligatoire => on renvoie -1 en cas d'echec)
    00033    */
    00034   if (MEDcoordLire(fid,maa,mdim,coord,mode_coo,MED_ALL,0,MED_NOPF,repere,nomcoo,unicoo) < 0)
    00035     return -1;
    00036
    00037   /*
    00038    * Lecture des noms des noeuds (presence facultative)
    00039    */
    00040   if (MEDnomLire(fid,maa,nom,nnoeuds,MED_NOEUD,MED_POINT1) < 0)
    00041     *inom = MED_FAUX;
    00042   else
    00043     *inom = MED_VRAI;
    00044
    00045   /*
    00046    * Lecture des numeros (presence facultative)
    00047    */
    00048   if (MEDnumLire(fid,maa,num,nnoeuds,MED_NOEUD,MED_POINT1) < 0)
    00049     *inum = MED_FAUX;
    00050   else
    00051     *inum = MED_VRAI;
    00052
    00053   /*
    00054    * Lecture des numeros de familles :
    00055    * - si pas de numeros de familles, cela siginifie qu'ils
    00056    *   tous egaux a 0 (convention définie à partir de MED V2.2)
    00057    */
    00058   if (MEDfamLire(fid,maa,fam,nnoeuds,MED_NOEUD,MED_POINT1) < 0)
    00059     for (i=0;i<nnoeuds;i++)
    00060       *(fam+i) = 0;
    00061
    00062   /*
    00063    * Tout s'est bien passe
    00064    */
    00065   return 0;
    00066 }