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