# MEDnEntites.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_int
    00023 MEDnEntites(med_idt fid,char *maa,med_entite_maillage type_ent,
    00024             med_connectivite typ_con)
    00025 {
    00026   med_int total = 0;
    00027   int i;
    00028   med_geometrie_element typ_mai[MED_NBR_GEOMETRIE_MAILLE] = {MED_POINT1,MED_SEG2,
    00029                                                     MED_SEG3,MED_TRIA3,
    00030                                                     MED_TRIA6,MED_QUAD4,
    00031                                                     MED_QUAD8,MED_TETRA4,
    00032                                                     MED_TETRA10,MED_HEXA8,
    00033                                                     MED_HEXA20,MED_PENTA6,
    00034                                                     MED_PENTA15,MED_PYRA5,
    00035                                                     MED_PYRA13};
    00036   med_geometrie_element typ_fac[MED_NBR_GEOMETRIE_FACE] = {MED_TRIA3,MED_TRIA6,
    00037                                                     MED_QUAD4,MED_QUAD8};
    00038   med_geometrie_element typ_are[MED_NBR_GEOMETRIE_ARETE] = {MED_SEG2,MED_SEG3};
    00039   med_entite_maillage _type_ent=type_ent;
    00040
    00041   if ( type_ent == MED_NOEUD_MAILLE ) _type_ent=MED_NOEUD ;
    00042
    00043   switch (_type_ent)
    00044   {
    00045      case MED_MAILLE :
    00046         for (i=0;i<MED_NBR_GEOMETRIE_MAILLE;i++)
    00047           total += MEDnEntMaa(fid,maa,MED_CONN,MED_MAILLE,typ_mai[i],typ_con);
    00048         break;
    00049
    00050      case MED_FACE :
    00051         for (i=0;i<MED_NBR_GEOMETRIE_FACE;i++)
    00052           total += MEDnEntMaa(fid,maa,MED_CONN,MED_FACE,typ_fac[i],typ_con);
    00053         break;
    00054
    00055      case MED_ARETE :
    00056         for (i=0;i<MED_NBR_GEOMETRIE_ARETE;i++)
    00057           total += MEDnEntMaa(fid,maa,MED_CONN,MED_ARETE,typ_are[i],typ_con);
    00058         break;
    00059
    00060      case MED_NOEUD :
    00061         total = MEDnEntMaa(fid,maa,MED_COOR,MED_NOEUD,0,0);
    00062         break;
    00063
    00064      default :
    00065         total = -1;
    00066   }
    00067
    00068   return total;
    00069 }