2.3.6/test12.c

Aller à la documentation de ce fichier.
00001 /*  This file is part of MED.
00002  *
00003  *  COPYRIGHT (C) 1999 - 2015  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  * - Nom du fichier : test12.c
00020  *
00021  * - Description : ecriture d'une equivalence dans un maillage MED 
00022  *
00023  *****************************************************************************/
00024 
00025 #include <med.h>
00026 #define MESGERR 1
00027 #include <med_utils.h>
00028 
00029 #ifdef DEF_LECT_ECR
00030 #define MODE_ACCES MED_LECTURE_ECRITURE
00031 #elif DEF_LECT_AJOUT
00032 #define MODE_ACCES MED_LECTURE_AJOUT
00033 #else
00034 #define MODE_ACCES MED_CREATION
00035 #endif
00036 
00037 int main (int argc, char **argv)
00038 
00039 
00040 {
00041   med_idt fid;
00042   char maa[MED_TAILLE_NOM+1]= "maa1";
00043   char equ[MED_TAILLE_NOM+1] = "equivalence";
00044   char des[MED_TAILLE_DESC+1] = "equivalence sur les mailles MED_TRIA3";
00045   med_int mdim = 3;
00046   med_int ncor = 3;
00047   med_int cor[6] = {1,2,3,4,5,6};
00048 
00049   /* Creation du fichier "test12.med" */
00050   if ((fid = MEDouvrir("test12.med",MODE_ACCES)) < 0) {
00051     MESSAGE("Erreur a la creation du fichier test12.med");
00052     return -1;
00053   }
00054   
00055   /* Creation du maillage */
00056   if (MEDmaaCr(fid,maa,3,MED_NON_STRUCTURE,
00057                    "Un maillage pour test12") < 0) {
00058     MESSAGE("Erreur a la creation du maillage");
00059     return -1;
00060   }
00061   
00062   /* Creation de l'equivalence */
00063   if (MEDequivCr(fid,maa,equ,des) < 0) {
00064     MESSAGE("Erreur a la creation de l'equivalence");
00065     return -1;
00066   }
00067 
00068   /* Ecriture des sur les mailles MED_TRIA3 */
00069   if (MEDequivEcr(fid,maa,equ,cor,ncor,MED_MAILLE,MED_TRIA3) < 0) {
00070     MESSAGE("Erreur a l'ecriture du tableau des correspondances");
00071     return -1;
00072   }
00073 
00074   /* Fermeture du fichier */
00075   if (MEDfermer(fid) < 0) {
00076     MESSAGE("Erreur a la fermeture du fichier");
00077     return -1;
00078   }
00079 
00080   return 0;
00081 }
00082 
00083 
00084 
00085 

Généré le Thu Oct 8 14:26:17 2015 pour MED fichier par  doxygen 1.6.1