next up previous contents index
Next: Batch mode Up: Description file Previous: multi_desc description file   Contents   Index

extended description file

Some keywords can be used in a desciption file to modify default values, read meshes or field values:

bmesh: general format description.


c=================================================================
c  UPDATED VERSION 27/01/95 15h20 ( Herve STEVE ) : 
c      WITH INTERIOR AND BOUNDARY PATCHES ( STRUCTURED CASE )
c
c
c      The "WRITE" instructions listed below are requested in order 
c      to be able to read the file.mesh by our graphic tools.
c
c            -----------------------------------
c
c A MESH COULD BE SUBDIVIDED IN BLOCKS, AND FOR EACH BLOCK
c "WRITE" INSTRUCTIONS 1) AND 2) ARE ALWAYS REQUIRED.
c THEN THE FOLLOWING "WRITE" INSTRUCTIONS ARE REQUESTED
C DEPENDING ON THE MESH TYPES:
c
c 1st CASE: STRUCTURED BLOCK WITH INTERIOR AND BOUNDARY PATCHES :
c           INSTRUCTIONS 3a) 3b) 3c) 3d) 3e)
c  
c 2nd CASE: UNSTRUCTURED BLOCK WITH HOMOGENEOUS ELEMENTS AND 
c           HOMOGENEOUS BOUNDARY ELEMENTS :
c           INSTRUCTIONS 4a) 4b) 4c) 4d1) 4d2) 4f1) 4f2) 
c
c 3rd CASE: UNSTRUCTURED BLOCK WITH HOMOGENEOUS ELEMENTS AND 
c           NON HOMEGENEOUS BOUNDARY ELEMENTS :
c           INSTRUCTIONS 4a) 4b) 4c) 4d1) 4d2) 4g1) 4g2) 
c
c 4th CASE: UNSTRUCTURED BLOCK WITH NON HOMOGENEOUS ELEMENTS AND 
c           NON HOMOGENEOUS BOUNDARY ELEMENTS :
c           INSTRUCTIONS 4a) 4b) 4c) 4e1) 4e2) 4g1) 4g2) 
c
c 5th CASE: UNSTRUCTURED BLOCK WITH NON HOMOGENEOUS ELEMENTS AND 
c           HOMOGENEOUS BOUNDARY ELEMENTS :
c           INSTRUCTIONS 4a) 4b) 4c) 4e1) 4e2) 4f1) 4f2)  
c
c REMARKS: 
c
c     a) DEFINITION OF ELEMENT TYPES ( 7 POSSIBILITIES HERE )
c
c  itypX=1 ==> HE8 8-noded 3D hex-cube element
c  itypX=2 ==> P6 6-noded 3D prismatic element
c  itypX=3 ==> P5 5-noded 3D pyramidal element
c  itypX=4 ==> TE4 4-noded 3D tetrahedral element
c  itypX=5 ==> Q4 4-noded 2D quadrangular element
c  itypX=6 ==> T3 3-noded 2D triangular element
c  itypX=7 ==> S2 2-noded 1D edge element
c
c     b) LOGIC OF INTERIOR : LOGVOL=0 FOR VACUUM DOMAIN, 
c      ELEMENTS OR PATCHES : LOGVOL>0 FOR OTHER DOMAINS OF MATERIALS
c
c     c) LOGIC OF BOUNDARY : LOGFAC=1 FOR ARTIFICIAL BOUNDARY,
c      ELEMENTS OR PATCHES : LOGFAC=2 FOR OBSTACLE (PERFECTLY CONDUCTING)
c                            LOGFAC>10 FOR OTHER BOUNDARIES 
c
c=======================================================================
c
            PROGRAM MAIN
c
c=======================================================================
c parameters:
c------------
c ndimax                  : space dimension (2 ou 3)
c idimax,jdimax[,kdimax]  : max number of indices in X1,X2[,X3] directions 
c                           for structured meshes
c npatchmax               : max number of patches (structured meshes)
c nsmax                   : max number of nodes for unstructured meshes 
c neltmax                 : max number of elements for unstructured meshes
c nfacmax                 : max number of boundary elements for
c                           unstructured meshes
c
c arrays:
c--------
c
c FOR STRUCTURED MESHES:
c
c coor1          : X1,X2[,X3] coordinates
c ibegi,...kendi : extreme indices of interior patches      
c ibegf,...kendf : extreme indices of boundary patches      
c
c FOR UNSTRUCTURED MESHES:
c
c coor2          : X1,X2[,X3] coordinates 
c nnperel        : number of nodes per element or boundary element
c nuvol          : connectivity for element
c logvol         : logic type of the elements
c   nuvoltyp     : type of elements (non homogeneous)
c   nuvolp       : connectivity pointer for element (non homogeneous)
c nufac          : connectivity for boundary element
c logfac         : logic type of the boundary elements
c   nufacltyp    : type of boundary elements (non homogeneous)
c   nufacp       : connectivity pointer for boundary element (non homogeneous)
c=============================================================================
c
c  GIVE HERE PARAMETERS :
      parameter (ndimax=.....)
c
      real*4 coor1(ndimax,idimax,jdimax,kdimax),coor2(ndimax,nsmax)
      integer nnperel(7),iunit
      integer nuvoltyp(neltmax),nuvol(8*neltmax),logvol(neltmax)
      integer nufactyp(nfacmax),nufac(4*nfacmax),logfac(nfacmax)
      integer nuvolp(neltmax),nufacp(nfacmax)
      integer ibegi(npatchmax),iendi(npatchmax),
     &        jbegi(npatchmax),jendi(npatchmax),
     &        kbegi(npatchmax),kendi(npatchmax)
      integer ibegf(npatchmax),iendf(npatchmax),
     &        jbegf(npatchmax),jendf(npatchmax),
     &        kbegf(npatchmax),kendf(npatchmax)
c
c iunit is given arbitrary by the contributer
      open(iunit,file='file.mesh',form='unformatted')
c
c  1) Dimension (2 or 3) and number of blocks : 
c  ============================================ 
      WRITE(iunit) ndim,nblock 
c
      do ib=1,nblock
c
c  GIVE HERE THE DEFINITION OF YOUR BLOCKS 
      call lmesh(......)
c
c  WRITING OF YOUR MESH IN EEDB FORMAT
      call wmesh(ndimax,idimax,jdimax,kdimax,nsmax,neltmax,
     &           nfacmax,npatchmax,iunit,
     &           ndim,nblock,idim,jdim,kdim,istruc,npatchi,npatchf,
     &           ns,nfac,nelt,ihmgel,ihmgfac,itypel,itypfac,
     &           coor1,coor2,nnperel,nuvoltyp,nuvol,logvol,
     &           nuvolp,nufacp,nufactyp,nufac,logfac, 
     &           ibegi,iendi,jbegi,jendi,kbegi,kendi,
     &           ibegf,iendf,jbegf,jendf,kbegf,kendf)
c
      enddo
c     
      stop
      end
c=================================================================
      subroutine wmesh(ndimax,idimax,jdimax,kdimax,nsmax,neltmax,
     &           nfacmax,npatchmax,iunit,
     &           ndim,nblock,idim,jdim,kdim,istruc,npatchi,npatchf,
     &           ns,nfac,nelt,ihmgel,ihmgfac,itypel,itypfac,
     &           coor1,coor2,nnperel,nuvoltyp,nuvol,logvol,
     &           nuvolp,nufacp,nufactyp,nufac,logfac, 
     &           ibegi,iendi,jbegi,jendi,kbegi,kendi,
     &           ibegf,iendf,jbegf,jendf,kbegf,kendf)
c
      real*4 coor1(ndimax,idimax,jdimax,kdimax),coor2(ndimax,nsmax)
      integer nnperel(7),iunit
      integer nuvoltyp(neltmax),nuvol(8*neltmax),logvol(neltmax)
      integer nufactyp(nfacmax),nufac(4*nfacmax),logfac(nfacmax)
      integer nuvolp(neltmax),nufacp(nfacmax)
      integer ibegi(npatchmax),iendi(npatchmax),
     &        jbegi(npatchmax),jendi(npatchmax),
     &        kbegi(npatchmax),kendi(npatchmax)
      integer ibegf(npatchmax),iendf(npatchmax),
     &        jbegf(npatchmax),jendf(npatchmax),
     &        kbegf(npatchmax),kendf(npatchmax)
c=======================================================================
c
c Definition of element or boundary element types : itypel,itypfac 
c The type (from 1 to 7) give implicitely the number of nodes per element 
c     itypX=1 ==> HE8 8-noded 3D hex-cube element 
      nnperel(1)=8
c     itypX=2 ==> P6 6-noded 3D prismatic element 
      nnperel(2)=6
c     itypX=3 ==> P5 5-noded 3D pyramidal element 
      nnperel(3)=5
c     itypX=4 ==> TE4 4-noded 3D tetrahedral element 
      nnperel(4)=4
c     itypX=5 ==> Q4 4-noded 2D quadrangular element 
      nnperel(5)=4
c     itypX=6 ==> T3 3-noded 2D triangular element 
      nnperel(6)=3
c     itypX=7 ==> S2 2-noded 1D edge element 
      nnperel(7)=2
c
c  2) Type of each block  : 
c  ========================
c     istruc=1 Structured Block
c     istruc=0 Unstructured Block
      WRITE(iunit) istruc
c
c=====Case of structured block :
      if(istruc.eq.1) then
c
c   3a) Number of interior patches, number of boundary patches :
      WRITE(iunit) npatchi,npatchf 
c
c   3b) Number of points in X1,X2[,X3] directions : (In 2D, kdim=1) 
      WRITE(iunit) idim,jdim,kdim
      if(ndim.eq.2) kdim=1
c Number of nodes
      ns=idim*jdim*kdim
c
c   3c) Coordinates : 
      WRITE(iunit)((((coor1(l,i,j,k),l=1,ndim)
     &                ,i=1,idim),j=1,jdim),k=1,kdim)
c
c   3d) for each interior patch, indices min et max in each direction :
c  ( In 2D, kbegi=kendi=1 )
      do ip=1,npatchi
      WRITE(iunit)ibegi(ip),iendi(ip),jbegi(ip),jendi(ip)
     &           ,kbegi(ip),kendi(ip),logvol(ip)
      enddo
c
c   3e) for each boundary patch, indices min et max in each direction :
c  ( In 2D, kbegf=kendf=1 )
      do ip=1,npatchf
      WRITE(iunit)ibegf(ip),iendf(ip),jbegf(ip),jendf(ip)
     &           ,kbegf(ip),kendf(ip),logfac(ip)
      enddo
c
c=====end of istruc=1
      endif
c
c=====Case of unstructured block :
      if(istruc.eq.0) then
c 
c   4a) Numbers of nodes, elements, boundary elements :
      WRITE(iunit) ns,nelt,nfac
c
c   4b) Homegeneous element type, homegeneous boundary element type :
c     ihmgX=1 Homegeneous 
c     ihmgX=0 Non-Homegeneous 
      WRITE(iunit) ihmgel,ihmgfac
c
c   4c) Coordinates:
      WRITE(iunit) ((coor2(l,i),l=1,ndim),i=1,ns)
c
c-----Case of homogeneous element type :
      if(ihmgel.eq.1) then
c
c   4d1) Type of elements : (see the definitions above)
      WRITE(iunit) itypel 
c
c   4d2) For each element, nodal connectivity and logic of element :
      iptr=0
      do iel=1,nelt
      WRITE(iunit)(nuvol(iptr+i),i=1,nnperel(itypel)),logvol(iel) 
      iptr=iptr+nnperel(itypel)
      enddo
c
c-----end of ihmgel=1
      endif
c   
c-----Case of non-homogeneous element type :
      if(ihmgel.eq.0) then
c
      iptr=0
      do iel=1,nelt
      nuvolp(iel)=iptr+1
      itypel=nuvoltyp(iel)
c   4e1) Type of elements : 
      WRITE(iunit) itypel
c   4e2) nodal connectivity and logic of element :
      WRITE(iunit)(nuvol(iptr+i),i=1,nnperel(itypel)),logvol(iel) 
      iptr=iptr+nnperel(itypel)
      enddo
c
c-----end of ihmgel=0
      endif
c   
c-----Case of homogeneous boundary element type :
      if(ihmgfac.eq.1) then
c
c   4f1) Type of elements : (see the definitions above)
      WRITE(iunit) itypfac 
c
c   4f2) For each element, nodal connectivity and logic of element :
      iptr=0
      do ifac=1,nfac
      WRITE(iunit)(nufac(iptr+i),i=1,nnperel(itypfac)),logfac(ifac) 
      iptr=iptr+nnperel(itypfac)
      enddo
c
c-----end of ihmgfac=1
      endif
c   
c-----Case of non-homogeneous boundary element type :
      if(ihmgfac.eq.0) then
c
      iptr=0
      do ifac=1,nfac
      nufacp(ifac)=iptr+1
      itypfac=nufactyp(ifac)
c   4g1) Type of elements : 
      WRITE(iunit) itypfac
c   4g2) nodal connectivity and logic of element :
      WRITE(iunit)(nufac(iptr+i),i=1,nnperel(itypfac)),logfac(ifac) 
      iptr=iptr+nnperel(itypfac)
      enddo
c
c-----end of ihmgfac=0
      endif
c   
c=====end of istruc=0
      endif
c
      return
      end


next up previous contents index
Next: Batch mode Up: Description file Previous: multi_desc description file   Contents   Index
Robert Fournier 2002-09-13