implicit none
include 'med.hf'
integer*8 fid
integer cret,mdim, sdim
parameter(mdim = 3, sdim = 3)
character*64 maa
integer n
parameter(n=2)
integer np,nf
parameter(nf=9,np=3)
integer indexp(np),indexf(nf)
integer conn(24)
integer np2,nf2
parameter(nf2=8,np2=3)
integer indexp2(np2),indexf2(nf2)
integer conn2(nf2)
character*16 nom(n)
integer num(n),fam(n)
character*16 nomcoo(3)
character*16 unicoo(3)
data indexp / 1,5,9 /
data indexf / 1,4,7,10,13,16,19,22,25 /
data conn / 1,2,3,4,5,6,7,8,9,10,11,12,13,14,
& 15,16,17,18,19,20,21,22,23,24 /
data indexp2 / 1,5,9 /
data indexf2 / med_tria3,med_tria3,med_tria3,med_tria3,
& med_tria3,med_tria3,med_tria3,med_tria3 /
data conn2 / 1,2,3,4,5,6,7,8 /
data nom / "poly1", "poly2"/
data num / 1,2 /, fam / 0,-1 /
data maa /"maa1"/
data nomcoo /"x","y","z"/, unicoo /"cm","cm","cm"/
call mfiope(fid,
'test25.med',med_acc_rdwr, cret)
print *,cret
if (cret .ne. 0 ) then
print *,'Erreur creation du fichier'
call efexit(-1)
endif
print *,'Creation du fichier test25.med'
call mmhcre(fid,maa,mdim,sdim,
& med_unstructured_mesh,'un maillage pour test 25',
& "",med_sort_dtit,med_cartesian,nomcoo,unicoo,cret)
if (cret .ne. 0 ) then
print *,'Erreur creation du maillage'
call efexit(-1)
endif
print *,cret
print *,'Creation du maillage'
call mmhphw(fid,maa,med_no_dt,med_no_it,med_undef_dt,med_cell,
& med_nodal,np,indexp,nf,indexf,conn,cret)
print *,cret
if (cret .ne. 0 ) then
print *,'Erreur ecriture connectivite des polyedres'
call efexit(-1)
endif
print *,'Ecriture des connectivites des mailles
& de type MED_POLYEDRE'
print *,'Description nodale'
call mmhphw(fid,maa,med_no_dt,med_no_it,med_undef_dt,med_cell,
& med_descending,np2,indexp2,nf2,indexf2,conn2,cret)
print *,cret
if (cret .ne. 0 ) then
print *,'Erreur ecriture connectivite des polyedres'
call efexit(-1)
endif
print *,'Ecriture des connectivites des mailles
& de type MED_POLYEDRE'
print *,'Description descendante'
call mmheaw(fid,maa,med_no_dt,med_no_it,med_cell,
& med_polyhedron,n,nom,cret)
print *,cret
if (cret .ne. 0 ) then
print *,'Erreur ecriture noms des polyedres'
call efexit(-1)
endif
print *,'Ecriture des noms des polyedress'
call mmhenw(fid,maa,med_no_dt,med_no_it,med_cell,
& med_polyhedron,n,num,cret)
print *,cret
if (cret .ne. 0 ) then
print *,'Erreur ecriture numeros des polyedres'
call efexit(-1)
endif
print *,'Ecriture des numeros des polyedres'
call mmhfnw(fid,maa,med_no_dt,med_no_it,med_cell,
& med_polyhedron,n,fam,cret)
print *,cret
if (cret .ne. 0 ) then
print *,'Erreur ecriture numeros de familles polyedres'
call efexit(-1)
endif
print *,'Ecriture des numeros de familles des polyedres'
print *,cret
if (cret .ne. 0 ) then
print *,'Erreur fermeture du fichier'
call efexit(-1)
endif
print *,'Fermeture du fichier'
end
subroutine mfiope(fid, name, access, cret)
Ouverture d'un fichier MED.
subroutine mficlo(fid, cret)
Fermeture d'un fichier MED.
subroutine mmhcre(fid, name, sdim, mdim, mtype, desc, dtunit, stype, atype, aname, aunit, cret)
Cette routine permet de créer un maillage dans un fichier.
subroutine mmheaw(fid, mname, numdt, numit, entype, geotype, n, ename, cret)
Cette routine permet d'écrire les noms d'un type d'entité d'un maillage.
subroutine mmhfnw(fid, name, numdt, numit, entype, geotype, n, num, cret)
subroutine mmhenw(fid, name, numdt, numit, entype, geotype, n, num, cret)
subroutine mmhphw(fid, name, numdt, numit, dt, entype, cmode, fisize, findex, nisize, nindex, con, cret)