UsesCase_MEDmesh_13.f

Aller à la documentation de ce fichier.
00001 C*  This file is part of MED.
00002 C*
00003 C*  COPYRIGHT (C) 1999 - 2015  EDF R&D, CEA/DEN
00004 C*  MED is free software: you can redistribute it and/or modify
00005 C*  it under the terms of the GNU Lesser General Public License as published by
00006 C*  the Free Software Foundation, either version 3 of the License, or
00007 C*  (at your option) any later version.
00008 C*
00009 C*  MED is distributed in the hope that it will be useful,
00010 C*  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 C*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 C*  GNU Lesser General Public License for more details.
00013 C*
00014 C*  You should have received a copy of the GNU Lesser General Public License
00015 C*  along with MED.  If not, see <http://www.gnu.org/licenses/>.
00016 C*
00017 
00018 C******************************************************************************
00019 C* 
00020 C* Use case 13 : a 2D unstructured mesh with 10 nodes and 2 polygons
00021 C* 
00022 C* poly1 : 1,4,7,9,6,3
00023 C* poly2 : 2,5,8,10,7,4
00024 C
00025 C*      9   10
00026 C*
00027 C*   6    7    8
00028 C* 
00029 C*   3    4    5
00030 C*  
00031 C*      1     2
00032 C*
00033 C *****************************************************************************
00034       program UsesCase_MEDmesh_13
00035 C     
00036       implicit none
00037       include 'med.hf77'
00038 C
00039 C     
00040       integer cret
00041       integer fid
00042 C     space dim, mesh dim      
00043       integer sdim, mdim
00044 C     axis name, unit name
00045       character*16 axname(2), unname(2)
00046 C     mesh name, file name
00047       character*64 mname, finame
00048       character*64 dtunit
00049 C     coordinates
00050       real*8 coords(2*10)
00051       integer nnodes
00052       integer isize
00053       integer index(3)
00054       integer conity(12)
00055 C     comment 1, mesh description
00056       character*200 cmt1, mdesc
00057 C
00058       parameter (sdim = 2, mdim = 2)
00059       parameter (mname = "2D unstructured mesh")
00060       parameter (dtunit = "")
00061       parameter (finame = "UsesCase_MEDmesh_13.med")
00062 C     Dix noeuds dont deux communs aux deux polygones */
00063       parameter (nnodes = 10)
00064       parameter (isize = 3)
00065       parameter (cmt1 ="A 2D unstructured mesh : 10 nodes, 2 polygons")
00066       parameter (mdesc = "A 2D mesh with 2 polygons")
00067 C
00068       data axname  /"x               ","y               "/
00069       data unname  /"cm              ","cm              "/
00070       data coords / 0.5,   0.,  
00071      &              1.5,   0.,  
00072      &              0.,    0.5,
00073      &              1.,    0.5,
00074      &              2.,    0.5,
00075      &              0.,    1.,
00076      &              1.,    1.,
00077      &              2.,    1.,
00078      &              0.5,   2.,
00079      &              1.5,   2. /
00080       data index / 1, 7, 13 /
00081       data conity / 1,4,7,9,6,3,
00082      &              2,5,8,10,7,4 /
00083 C 
00084 C
00085 C     file creation
00086       call mfiope(fid,finame,MED_ACC_CREAT,cret)
00087       if (cret .ne. 0 ) then
00088          print *,'ERROR : file creation'
00089          call efexit(-1)
00090       endif
00091 C
00092 C
00093 C     write a comment in the file
00094       call mficow(fid,cmt1,cret)
00095       if (cret .ne. 0 ) then
00096          print *,'ERROR : write file description'
00097          call efexit(-1)
00098       endif
00099 C
00100 C
00101 C     mesh creation : a 2D unstructured mesh
00102       call mmhcre(fid, mname, sdim, mdim, MED_UNSTRUCTURED_MESH, mdesc,
00103      &            dtunit, MED_SORT_DTIT, MED_CARTESIAN, 
00104      &            axname, unname, cret)
00105       if (cret .ne. 0 ) then
00106          print *,'ERROR : mesh creation'
00107          call efexit(-1)
00108       endif
00109 C
00110 C
00111 C     nodes coordinates in a cartesian axis in full interlace mode
00112 C     (X1,Y1, X2,Y2, X3,Y3, ...) with no iteration and computation step
00113       call mmhcow(fid,mname,MED_NO_DT,MED_NO_IT, MED_UNDEF_DT,
00114      &            MED_FULL_INTERLACE,nnodes,coords,cret)
00115       if (cret .ne. 0 ) then
00116          print *,'ERROR : write nodes coordinates description'
00117          call efexit(-1)
00118       endif
00119 C
00120 C
00121 C     cells connectiviy is defined in nodal mode
00122 C     2 polygons
00123       call mmhpgw(fid, mname, MED_NO_DT, MED_NO_IT, MED_UNDEF_DT,
00124      &            MED_CELL, MED_NODAL, isize, index, conity, cret)
00125       if (cret .ne. 0 ) then
00126          print *,'ERROR : polygon connectivity ...'
00127          call efexit(-1)
00128       endif
00129 C
00130 C
00131 C     create family 0 : by default, all mesh entities family number is 0
00132       call mfacre(fid,mname,MED_NO_NAME,0,0,MED_NO_GROUP,cret)
00133       if (cret .ne. 0 ) then
00134          print *,'ERROR : create family 0'
00135          call efexit(-1)
00136       endif
00137 C
00138 C
00139 C     close file
00140       call mficlo(fid,cret)
00141       if (cret .ne. 0 ) then
00142          print *,'ERROR :  close file'
00143          call efexit(-1)
00144       endif        
00145 C
00146 C
00147 C
00148       end
00149 C

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