Back to index

salome-med  6.5.0
MEDGeometrieElement.cxx
Go to the documentation of this file.
00001 /*************************************************************************
00002 * COPYRIGHT (C) 1999 - 2002  EDF R&D
00003 * THIS LIBRARY IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
00004 * IT UNDER THE TERMS OF THE GNU LESSER GENERAL PUBLIC LICENSE 
00005 * AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION; 
00006 * EITHER VERSION 2.1 OF THE LICENSE, OR (AT YOUR OPTION) ANY LATER VERSION.
00007 *  
00008 * THIS LIBRARY IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT
00009 * WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF
00010 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU
00011 * LESSER GENERAL PUBLIC LICENSE FOR MORE DETAILS.
00012 *
00013 * YOU SHOULD HAVE RECEIVED A COPY OF THE GNU LESSER GENERAL PUBLIC LICENSE
00014 * ALONG WITH THIS LIBRARY; IF NOT, WRITE TO THE FREE SOFTWARE FOUNDATION,
00015 * INC., 59 TEMPLE PLACE, SUITE 330, BOSTON, MA 02111-1307 USA
00016 *
00017 *************************************************************************/
00018 
00019 #include "med.hxx"
00020 #include "med_outils.hxx"
00021 
00022 namespace med_2_1{
00023 
00024 med_err 
00025 _MEDGeometrieElement(med_geometrie_element typ_geo[],med_entite_maillage typ_ent)
00026 {
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 
00040   switch(typ_ent)
00041     {
00042     case MED_MAILLE :
00043       for (i=0;i<MED_NBR_GEOMETRIE_MAILLE;i++)
00044         typ_geo[i] = typ_mai[i];
00045       break;
00046 
00047     case MED_FACE :
00048       for (i=0;i<MED_NBR_GEOMETRIE_FACE;i++)
00049         typ_geo[i] = typ_fac[i];
00050       break;
00051       
00052     case MED_ARETE :
00053       for (i=0;i<MED_NBR_GEOMETRIE_ARETE;i++)
00054         typ_geo[i] = typ_are[i];
00055       break;
00056 
00057     default :
00058       return -1;
00059     }
00060   return 0;
00061 }
00062 
00063 }