MED fichier
f/2.3.6/test19.f
1 C* This file is part of MED.
2 C*
3 C* COPYRIGHT (C) 1999 - 2017 EDF R&D, CEA/DEN
4 C* MED is free software: you can redistribute it and/or modify
5 C* it under the terms of the GNU Lesser General Public License as published by
6 C* the Free Software Foundation, either version 3 of the License, or
7 C* (at your option) any later version.
8 C*
9 C* MED is distributed in the hope that it will be useful,
10 C* but WITHOUT ANY WARRANTY; without even the implied warranty of
11 C* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 C* GNU Lesser General Public License for more details.
13 C*
14 C* You should have received a copy of the GNU Lesser General Public License
15 C* along with MED. If not, see <http://www.gnu.org/licenses/>.
16 C*
17 
18 C******************************************************************************
19 C * - Nom du fichier : test19.f
20 C *
21 C * - Description : conversion groupes => familles
22 C *
23 C *****************************************************************************
24  program test19
25 C
26  implicit none
27  include 'med.hf'
28 C
29 C
30  integer cret
31  integer fid
32  character *32 maa
33  parameter(maa = "maillage_test19")
34  character*200 des
35  parameter(des = "un maillage pour test19")
36  integer mdim
37  parameter(mdim = 2)
38 C Donnees de tests pour MEDgro2FamCr()
39 C Les noeuds/mailles sont numerotes de 1 a 5 et les
40 C groupes de 1 a 3.
41 C Au depart, on a :
42 C - G1 : 1,2
43 C - G2 : 3,4,6
44 C - G3 : 1,4
45 C Au retour, on foit avoir 4 familles de noeuds + 4 familles de mailles
46 C + la famille 0 dans le fichier :
47 C - F0 : 5 - groupes : aucun groupe par defaut (convention habituelle).
48 C - F1 : 1 - groupes : G1,G3
49 C - F2 : 2 - groupes : G1
50 C - F3 : 3,6 - groupes : G2
51 C - F4 : 4 - groupes : G2,G3
52 C
53  integer ngroup
54  parameter(ngroup = 3)
55  integer nent
56  parameter(nent = 6)
57  character*80 nomgro(ngroup)
58  integer ent(7)
59  integer ind(ngroup+1)
60  integer ngeo
61  parameter(ngeo = 3)
62  integer geo(ngeo)
63  integer indgeo(ngeo+1)
64  character*200 attdes,gro
65  integer attval,attide
66  integer typgeo
67  integer indtmp
68 C
69  data nomgro / "GROUPE1","GROUPE2","GROUPE3" /
70  data ent / 1,2, 3,4,6, 1,4 /
71  data ind / 1, 3, 6, 8 /
72  data geo / med_seg2, med_tria3, med_tetra4 /
73  data indgeo / 1,4,6,7 /
74 C
75 C ** Creation du fichier test19.med
76  call efouvr(fid,'test19.med',med_lecture_ecriture, cret)
77  print *,cret
78  if (cret .ne. 0 ) then
79  print *,'Erreur creation du fichier'
80  call efexit(-1)
81  endif
82  print *,'Creation du fichier test19.med'
83 C
84 C ** Creation du maillage
85  call efmaac(fid,maa,mdim,med_non_structure,des,cret)
86  print *,cret
87  if (cret .ne. 0 ) then
88  print *,'Erreur creation du maillage'
89  call efexit(-1)
90  endif
91  print *,'Creation du maillage'
92 C
93 C ** Creation de la famille 0
94  call effamc(fid,maa,'FAMILLE_0',0,attide,attval,attdes,0,gro,0,
95  & cret)
96  print *,cret
97  if (cret .ne. 0 ) then
98  print *,'Erreur creation de la famille 0'
99  call efexit(-1)
100  endif
101  print *,'Creation de la famille 0'
102 C
103 C ** Creation des familles de noeuds
104  call efg2fc(fid,maa,nomgro,ind,ngroup,ent,nent,med_noeud,
105  & typgeo,indtmp,0,cret)
106  print *,cret
107  if (cret .ne. 0 ) then
108  print *,'Erreur creation des familles de noeud'
109  call efexit(-1)
110  endif
111  print *,'Creation des familles de noeuds dans test19.med'
112 C
113 C ** Creation des familles de mailles
114  call efg2fc(fid,maa,nomgro,ind,ngroup,ent,nent,med_maille,
115  & geo,indgeo,ngeo,cret)
116  print *,cret
117  if (cret .ne. 0 ) then
118  print *,'Erreur creation des familles de maille'
119  call efexit(-1)
120  endif
121  print *,'Creation des familles de mailles dans test19.med'
122 C
123 C ** Fermeture du fichier
124  call efferm (fid,cret)
125  print *,cret
126  if (cret .ne. 0 ) then
127  print *,'Erreur fermeture du fichier'
128  call efexit(-1)
129  endif
130  print *,'Fermeture du fichier'
131 C
132  end