Back to index

salome-med  6.5.0
MEDparametresGeometrie.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 /*
00023  * - Nom de la fonction : _MEDparametresGeometrie
00024  * - Description : fournit les parametres geometriques des differents
00025  *                 entites et elements MED
00026  * - Parametres :
00027  *     - typ_ent (IN)  : type d'entite de l'element
00028  *     - type_geo (IN) : le type geometrique de l'element
00029  *     - dim (OUT)     : dimension de l'element
00030  *     - nnoe (OUT)    : nombre de noeuds composant l'element (connectivite 
00031  *                       nodale)
00032  *     - ndes (OUT)    : nombre de composants dans l'elements (connectivite
00033  *                       descendante)
00034  * - Resultat : 0 en cas de succes, -1 sinon
00035  */
00036 
00037 namespace med_2_1{
00038 
00039 med_err 
00040 _MEDparametresGeometrie(med_entite_maillage type_ent,
00041                         med_geometrie_element type_geo, int *dim, 
00042                         int *nnoe,int *ndes)
00043 {
00044   *nnoe = type_geo % 100;
00045   *dim = type_geo / 100;
00046 
00047   switch(type_ent)
00048     {
00049     case MED_MAILLE :
00050       switch (type_geo)
00051         {
00052         case MED_POINT1 :
00053           *ndes = 0;
00054           break;
00055           
00056         case MED_SEG2 :
00057           *ndes = 2;
00058           break;
00059           
00060         case MED_SEG3 :
00061           *ndes = 3;
00062           break;
00063           
00064         case MED_TRIA3 :
00065           *ndes = 3;
00066           break;
00067           
00068         case MED_TRIA6 :
00069           *ndes = 3;
00070           break;
00071           
00072         case MED_QUAD4 :
00073           *ndes = 4;
00074           break;
00075           
00076         case MED_QUAD8 :
00077           *ndes = 4;
00078           break;
00079           
00080         case MED_TETRA4 :
00081           *ndes = 4;
00082           break;
00083           
00084         case MED_TETRA10 :
00085           *ndes = 4;
00086           break;
00087           
00088         case MED_HEXA8 :
00089           *ndes = 6;
00090           break;
00091           
00092         case MED_HEXA20 :
00093           *ndes = 6;
00094           break;
00095           
00096         case MED_PENTA6 :
00097           *ndes = 5;
00098           break;
00099           
00100         case MED_PENTA15 :
00101           *ndes = 5;
00102           break;
00103           
00104         case MED_PYRA5 :
00105           *ndes = 5;
00106           break;
00107           
00108         case MED_PYRA13 :
00109           *ndes = 5;
00110           break;
00111           
00112         default :
00113           return -1;
00114         }
00115       break;
00116       
00117     case MED_FACE :
00118       switch(type_geo)
00119         {
00120         case MED_TRIA3 :
00121           *ndes = 3;
00122           break;
00123           
00124         case MED_TRIA6 :
00125           *ndes = 3;
00126           break;
00127           
00128         case MED_QUAD4 :
00129           *ndes = 4;
00130           break;
00131           
00132         case MED_QUAD8 :
00133           *ndes = 4;
00134           break;
00135           
00136         default :
00137           return -1;
00138         }
00139       break;
00140       
00141     case MED_ARETE :
00142       switch(type_geo)
00143         {
00144         case MED_SEG2 :
00145           *ndes = 2;
00146           break;
00147           
00148         case MED_SEG3 :
00149           *ndes = 3;
00150           break;
00151           
00152         default :
00153           return -1;
00154         }
00155       break;
00156       
00157     default :
00158       return -1;
00159     }
00160   
00161   return 0;
00162 }
00163 
00164 }