2.3.6/test29.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 : test29.c
00020  *
00021  * - Description : ecriture d'un joint 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 
00043   char maa[MED_TAILLE_NOM+1]= "maa1";
00044   char jnt[MED_TAILLE_NOM+1] = "joint";
00045   char des_jnt[MED_TAILLE_DESC+1] = "joint avec le sous-domaine 2";
00046   char maa_distant[MED_TAILLE_NOM+1]= "maa1";
00047   med_int dom_dist = 2;
00048 
00049   med_int mdim = 3;
00050   med_int ncor = 3;
00051   med_int cor[6] = {1,2,3,4,5,6};
00052   med_int cor2[6] = {10,20,30,40,50,60};
00053 
00054   /* Creation du fichier "test29.med" */
00055   if ((fid = MEDouvrir("test29.med",MODE_ACCES)) < 0) {
00056     MESSAGE("Erreur a la creation du fichier test29.med");
00057     return -1;
00058   }
00059   
00060   /* Creation du maillage */
00061   if (MEDmaaCr(fid,maa,3,MED_NON_STRUCTURE,
00062                    "Un maillage pour test29") < 0) {
00063     MESSAGE("Erreur a la creation du maillage");
00064     return -1;
00065   }
00066   
00067   /* Creation du joint */
00068   if (MEDjointCr(fid,maa,jnt,des_jnt,dom_dist,maa_distant) < 0) {
00069     MESSAGE("Erreur a la creation du joint");
00070     return -1;
00071   }
00072 
00073   /* Ecriture de la correspondance Noeud, Noeud */
00074   if (MEDjointEcr(fid,maa,jnt,cor,ncor,
00075                       MED_NOEUD,0,MED_NOEUD,0) < 0) {
00076     MESSAGE("Erreur a l'ecriture du tableau des correspondances (noeud,noeud)");
00077     return -1;
00078   }
00079                         
00080 
00081   /* Ecriture de la correspondance Noeud Maille */
00082   if (MEDjointEcr(fid,maa,jnt,cor2,ncor,
00083                       MED_NOEUD,0,MED_MAILLE,MED_TRIA3) < 0) {
00084     MESSAGE("Erreur a l'ecriture du tableau des correspondances (noeud,maille TRIA3)");
00085     return -1;
00086   }
00087 
00088   /* Fermeture du fichier */
00089   if (MEDfermer(fid) < 0) {
00090     MESSAGE("Erreur a la fermeture du fichier");
00091     return -1;
00092   }
00093 
00094   return 0;
00095 }
00096 
00097 
00098 
00099 

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