implicit none
include 'med.hf77'
integer cret
integer*8 fid
integer sdim, mdim
character*16 axname(2), unname(2)
character*64 mname, fyname, dtunit, finame
integer mtype, stype, grtype
integer fnum, ngro
character*80 gname
real*8 coords(30), dt
integer nnodes, ntria3, nquad4
integer tricon(24), quacon(16)
integer fanbrs(15)
character*200 cmt1, mdesc
parameter(sdim = 2, mdim = 2)
parameter(mname = "2D unstructured mesh")
parameter(fyname = "BOUNDARY_VERTICES")
parameter(dtunit = " ")
parameter(dt = 0.0d0)
parameter(finame = "UsesCase_MEDmesh_10.med")
parameter(gname = "MESH_BOUNDARY_VERTICES")
parameter(nnodes = 15, ntria3 = 8, nquad4 = 4)
parameter(cmt1 ="A 2D unstructured mesh : 15 nodes, 12 cells")
parameter(mtype=med_unstructured_mesh, stype=med_sort_dtit )
parameter(mdesc = "A 2D unstructured mesh")
parameter(grtype=med_cartesian_grid)
data axname /"x" ,"y" /
data unname /"cm","cm"/
data coords /2.,1., 7.,1., 12.,1., 17.,1., 22.,1.,
& 2.,6., 7.,6., 12.,6., 17.,6., 22.,6.,
& 2.,11., 7.,11., 12.,11., 17.,11., 22.,11./
data tricon /1,7,6, 2,7,1, 3,7,2, 8,7,3,
& 13,7,8, 12,7,13, 11,7,12, 6,7,11/
data quacon /3,4,9,8, 4,5,10,9,
& 15,14,9,10, 13,8,9,14/
data fanbrs /1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1/
call mfiope(fid,finame,med_acc_creat,cret)
if (cret .ne. 0 ) then
print *,'ERROR : file creation'
call efexit(-1)
endif
if (cret .ne. 0 ) then
print *,'ERROR : write file description'
call efexit(-1)
endif
call mmhcre(fid, mname, sdim, mdim, mtype, mdesc, dtunit,
& stype, grtype, axname, unname, cret)
if (cret .ne. 0 ) then
print *,'ERROR : mesh creation'
call efexit(-1)
endif
call mmhcow(fid,mname,med_no_dt,med_no_it,dt,
& med_full_interlace,nnodes,coords,cret)
if (cret .ne. 0 ) then
print *,'ERROR : write nodes coordinates description'
call efexit(-1)
endif
call mmhcyw(fid,mname,med_no_dt,med_no_it,dt,med_cell,
& med_tria3,med_nodal,med_full_interlace,
& ntria3,tricon,cret)
if (cret .ne. 0 ) then
print *,'ERROR : triangular cells connectivity'
call efexit(-1)
endif
call mmhcyw(fid,mname,med_no_dt,med_no_it,dt,med_cell,
& med_quad4,med_nodal,med_full_interlace,
& nquad4,quacon,cret)
if (cret .ne. 0 ) then
print *,'ERROR : quadrangular cells connectivity'
call efexit(-1)
endif
call mfacre(fid,mname,med_no_name,0,0,med_no_group,cret)
if (cret .ne. 0 ) then
print *,'ERROR : create family 0'
call efexit(-1)
endif
fnum = 1
ngro = 1
call mfacre(fid, mname, fyname, fnum, ngro, gname, cret)
if (cret .ne. 0 ) then
print *,'ERROR : create family 0'
call efexit(-1)
endif
call mmhfnw(fid, mname, med_no_dt, med_no_it, med_node, med_none,
& nnodes, fanbrs, cret)
if (cret .ne. 0 ) then
print *,'ERROR : nodes family numbers ...'
call efexit(-1)
endif
if (cret .ne. 0 ) then
print *,'ERROR : close file'
call efexit(-1)
endif
end
program usescase_medmesh_10
subroutine mfacre(fid, name, fname, fnum, ngro, gname, cret)
Cette routine permet la création d'une famille portant sur les entités d'un maillage.
subroutine mfiope(fid, name, access, cret)
Ouverture d'un fichier MED.
subroutine mficow(fid, cmt, cret)
Ecriture d'un descripteur dans 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 mmhcyw(fid, name, numdt, numit, dt, entype, geotype, cmode, swm, n, con, cret)
subroutine mmhfnw(fid, name, numdt, numit, entype, geotype, n, num, cret)
subroutine mmhcow(fid, name, numdt, numit, dt, swm, n, coo, cret)