Back to index

salome-med  6.5.0
MEDnPasdetemps.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 
00020 #include "med.hxx"
00021 #include "med_outils.hxx"
00022 
00023 #include <string.h>
00024 #include <stdlib.h>
00025 
00026 /*
00027  * Nombre de Couple (PDT,NOR) pour le champ <cha>
00028  */
00029 
00030 namespace med_2_1{
00031 
00032 med_int 
00033 MEDnPasdetemps(med_idt fid,char *cha,med_entite_maillage type_ent, 
00034                med_geometrie_element type_geo)
00035 
00036 {
00037   med_err ret;
00038   int n1;
00039   char nomdatagroup1[MED_TAILLE_NOM+1];
00040   char tmp1         [MED_TAILLE_NOM_ENTITE+1];
00041   char chemin       [MED_TAILLE_CHA+(MED_TAILLE_NOM+1)+MED_TAILLE_NOM+1];
00042 
00043   /*
00044    * On inhibe le gestionnaire d'erreur HDF 5
00045    */
00046   _MEDmodeErreurVerrouiller();
00047   
00048   /* 
00049    * Creation du chemin d'accès aux différents (PDT,NOR) pour les différents <type_ent>[.<type_geo>]
00050    */
00051   strcpy(chemin,MED_CHA);
00052   strcat(chemin,cha);
00053   strcat(chemin,"/");
00054  
00055   if ((ret = _MEDnomEntite(nomdatagroup1,type_ent)) < 0)
00056     return -1;
00057   if ((type_ent != MED_NOEUD))
00058     {
00059       if ((ret = _MEDnomGeometrie(tmp1,type_geo)) < 0)
00060         return -1;
00061       strcat(nomdatagroup1,".");
00062       strcat(nomdatagroup1,tmp1);
00063     }
00064   strcat(chemin,nomdatagroup1);
00065 
00066   n1 =0;
00067   _MEDnObjets(fid,chemin,&n1);
00068       
00069   return (med_int) n1;
00070 
00071 }
00072 
00073 }