implicit none
include 'med.hf77'
integer cret
integer*8 fid
character (MED_NAME_SIZE) mname
character (MED_NAME_SIZE) fname
character (MED_COMMENT_SIZE) cmt1,mdesc
integer sdim, mdim
character (MED_SNAME_SIZE) axname(2)
character (MED_SNAME_SIZE) unname(2)
real*8 inicoo(30)
integer nnodes, ntria3, nquad4
integer triacy(24)
integer quadcy(16)
real*8 nwcos1(6)
character (MED_NAME_SIZE) prof1n
integer profi1(3)
integer pro1sz
real*8 nwcos2(6)
character (MED_NAME_SIZE) prof2n
integer profi2(3)
integer pro2sz
parameter(fname = "UsesCase_MEDmesh_6.med")
parameter(cmt1 = "A 2D unstructured mesh : 15 nodes, 12 cells")
parameter(mdesc = "A 2D unstructured mesh")
parameter(mname="2D unstructured mesh")
parameter(sdim=2, mdim=2)
parameter(nnodes=15,ntria3=8,nquad4=4)
data axname /"x", "y"/
data unname /"cm", "cm"/
data inicoo /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 triacy /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 quadcy /3,4,9,8, 4,5,10,9,
& 15,14,9,10, 13,8,9,14/
data nwcos1 /12.,15., 17.,15., 22.,15./
parameter(prof1n="UPPER_QUAD4_PROFILE")
data profi1 /13, 14, 15/
parameter(pro1sz=3)
data nwcos2 /12.,10., 17.,10., 22.,10./
parameter(prof2n="MIDDLE_QUAD4_PROFILE")
data profi2 /8, 9, 10/
parameter(pro2sz=3)
call mfiope(fid,fname,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 mpfprw(fid,prof1n,pro1sz,profi1,cret)
if (cret .ne. 0 ) then
print *,"ERROR : create profile"
call efexit(-1)
endif
call mpfprw(fid,prof2n,pro2sz,profi2,cret)
if (cret .ne. 0 ) then
print *,"ERROR : create profile"
call efexit(-1)
endif
call mmhcre(fid, mname, sdim, mdim, med_unstructured_mesh, mdesc,
& "", med_sort_dtit, med_cartesian, axname, unname, cret)
if (cret .ne. 0 ) then
print *,"ERROR : mesh creation"
call efexit(-1)
endif
call mmhcpw(fid, mname, med_no_dt, med_no_it, 0.0d0,
& med_compact_stmode, med_no_profile,
& med_full_interlace, med_all_constituent,
& nnodes, inicoo, cret)
if (cret .ne. 0 ) then
print *,"ERROR : nodes coordinates"
call efexit(-1)
endif
call mmhypw(fid, mname, med_no_dt, med_no_it, 0.0d0,
& med_cell, med_tria3, med_nodal,
& med_compact_stmode, med_no_profile,
& med_full_interlace, med_all_constituent,
& ntria3, triacy, cret)
if (cret .ne. 0 ) then
print *,"ERROR : triangular cells connectivity"
call efexit(-1)
endif
call mmhypw(fid, mname, med_no_dt, med_no_it, 0.0d0,
& med_cell, med_quad4, med_nodal,
& med_compact_stmode, med_no_profile,
& med_full_interlace, med_all_constituent,
& nquad4, quadcy, cret)
if (cret .ne. 0 ) then
print *,"ERROR : quadrangular cells connectivity"
call efexit(-1)
endif
call mmhcpw(fid, mname, 1, 1, 5.5d0,
& med_compact_stmode, prof1n,
& med_full_interlace, med_all_constituent,
& nnodes, nwcos1, cret)
if (cret .ne. 0 ) then
print *,"ERROR : nodes coordinates"
call efexit(-1)
endif
call mmhcpw(fid, mname, 2, 1, 8.9d0,
& med_compact_stmode, prof2n,
& med_full_interlace, med_all_constituent,
& nnodes, nwcos2, cret)
if (cret .ne. 0 ) then
print *,"ERROR : nodes coordinates"
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
if (cret .ne. 0 ) then
print *,"ERROR : close file"
call efexit(-1)
endif
end
program usescase_medmesh_6
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 mmhcpw(fid, name, numdt, numit, dt, stm, pname, swm, dim, n, coo, cret)
subroutine mmhypw(fid, name, numdt, numit, dt, entype, geotype, cmode, stmode, pname, swm, dim, n, con, cret)
subroutine mpfprw(fid, pname, psize, profil, cret)