The mesh is made of one or several blocks, each defined by surface elements.
Each block can be structured or unstructured.
For unstructured blocks, we distinguish homogeneous meshes (made by
same element types) between non-homogeneous meshes (several types of
elements: triangles or quadrangles).
Note: For the definition of several blocks, solutions defined
on mesh nodes must be identical in each block.
A structured block is defined by a matrix of points:
parameter (ndimax=2, idimax=101, jdimax=101)
real*4 coor(ndimax,idimax,jdimax)
real*4 q(idimax, jdimax, 1)
c
unit1 = 18
nblock = 1
c total number of blocks
itype = 1
c itype = 0: Unstructured mesh
c itype = 1: Structured mesh
nnu = 1
c nnu: number of unknowns stored
idim = 101
jdim = 101
c idim, jdim: number of nodes indexes on each dimension
c
c coor: nodes coordinates
c q: unknowns array
c
write (unit1) nblock
do 100 nb = 1,nblock
write (unit1) itype, nnu
write (unit1) idim, jdim
write (unit1) (((coor(l,i,j),l=1,2),i=1,idim),j=1,jdim)
write (unit1) (((q(i,j, nu),i=1,idim),j=1,jdim),nu=1,nnu)
100 continue
stop
end
c unstructured homogeneous mesh
c
parameter (ndimax=2, nnodesmax=5000, nnperelmax=4, nelemmax=10000)
real*4 coor(ndimax,nnodesmax)
real*4 q(nnodesmax, 1)
integer iconnec(nnperelmax,nelemmax)
integer nnperelement(6)
c
unit1 = 16
nblock = 1
c total number of blocks
itype = 0
c itype = 0: Unstructured mesh
c itype = 1: Structured mesh
c nnu: number of unknowns stored
ihmg = 0
c ihmg = 0: homogeneous mesh
c ihmg = 1: non-homogeneous mesh
c nnodes: number of nodes
c
c nelem: number of surface elements
ielemtype = 3
c ielemtype: type of surface elements
c 3: T3, 3-nodes triangular cell
c 4: Q4, 4-nodes quadrilateral cell
nnperelement(3) = 3
nnperelement(4) = 4
nnperel = nnperelement(ielemtype)
c nnperel: number of nodes per element.
c
c coor: nodes coordinates
c q: unknowns array
c iconnec: connectivity table
c
write (unit1) nblock
do 100 nb = 1,nblock
write (unit1) itype, nnu
write (unit1) ihmg, nnodes
write (unit1) nelem, ielemtype
write (unit1) ((coor(l,i),l=1,2),i=1,nnodes)
write (unit1) ((q(i,nu),i=1,nnodes),nu=1,nnu)
write (unit1) ((iconnec(l,i),l=1,nnperel),i=1,nelem)
100 continue
stop
end
c unstructured non-homogeneous mesh
c
parameter (ndimax=2, nnodesmax=5000, nnperelmax=4, nelemmax=10000)
real*4 coor(ndimax,nnodesmax)
real*4 q(nnodesmax, 1)
integer ietype(nelemmax)
integer iconnec(nnperelmax*nelemmax)
integer nnperelement(6)
c
unit1 = 17
nblock = 1
c nblock: total number of blocks
itype = 0
c itype = 0: Unstructured mesh
c itype = 1: Structured mesh
nnu = 1
c nnu: number of unknowns stored
ihmg = 1
c ihmg = 0: homogeneous mesh
c ihmg = 1: non-homogeneous mesh
nnodes = 1200
c nnodes: number of nodes
nelem = 2450
c nelem: number of surface elements
c ietype: array of surface element types
c iconnec: array of node. indices for successive surface elements.
c 3: T3, 3-nodes triangular cell
c 4: Q4, 4-nodes quadrilateral cell
nnperelement(3) = 3
nnperelement(4) = 4
c coor: nodes coordinates
c q: unknowns array
c iconnec: connectivity table
c
write (unit1) nblock
write (unit1) itype, nnu
write (unit1) ihmg, nnodes
write (unit1) nelem
write (unit1) ((coor(l,i),l=1,2),i=1,nnodes)
write (unit1) ((q(i,nu),i=1,nnodes),nu=1,nnu)
iptr = 0
do 200 iel=1,nelem
itypel = ietype(iel)
write (unit1) itypel
write (unit1) (iconnec(iptr+i),i=1,nnperelement(itypel))
iptr = iptr + nnperelement(itypel)
200 continue
stop
end
c unstructured non-homogeneous mesh
c
parameter (ndimax=2, nnodesmax=5000, nnperelmax=4, nelemmax=10000)
parameter (idimax=101, jdimax=101)
real*4 coor(ndimax,nnodesmax)
real*4 q(nnodesmax, 2)
integer ietype(nelemmax)
integer iconnec(nnperelmax*nelemmax)
integer nnperelement(6)
real*4 coorh(ndimax,idimax,jdimax)
real*4 qh(idimax, jdimax, 2)
c
unit1 = 19
nblock = 2
c nblock: total number of blocks
itype = 0
c itype = 0: Unstructured mesh
c itype = 1: Structured mesh
nnu = 2
c nnu: number of unknowns stored
ihmg = 1
c ihmg = 0: homogeneous mesh
c ihmg = 1: non-homogeneous mesh
nnodes = 11
c nnodes: number of nodes
nelem = 3
c nelem: number of surface elements
c
c elemtype: type of surface elements
c 3: T3, 3-nodes triangular cell
c 4: Q4, 4-nodes quadrilateral cell
nnperelement(3) = 3
nnperelement(4) = 4
c
c coor: nodes coordinates
c q: unknowns array
c iconnec: connectivity table
c
write (unit1) nblock
write (unit1) itype, nnu
write (unit1) ihmg, nnodes
write (unit1) nelem
write (unit1) ((coor(l,i),l=1,2),i=1,nnodes)
write (unit1) ((q(i,nu),i=1,nnodes),nu=1,nnu)
c
iptr = 0
do 200 iel=1,nelem
itypel = ietype(iel)
write (unit1) itypel
write (unit1) (iconnec(iptr+i),i=1,nnperelement(itypel))
iptr = iptr + nnperelement(itypel)
200 continue
c
c block 2
itype = 1
idim = 101
jdim = 101
do 300 i=1,idim
do 300 j=1,jdim
coorh(1,i,j)=coor(1,5)+(coor(1,4)-coor(1,5))*(j-1)/(jdim-1)-
* (coor(1,5)-coor(1,7))*(i-1)/(idim-1)
coorh(2,i,j)=coor(2,4)+(coor(2,8)-coor(2,4))*(i-1)/(idim-1)
qh(i,j,1)=coorh(1,i,j)
qh(i,j,2)=coorh(2,i,j)
300 continue
write (unit1) itype, nnu
write (unit1) idim, jdim
write (unit1) (((coorh(l,i,j),l=1,2),i=1,idim),j=1,jdim)
write (unit1) (((qh(i,j, nu),i=1,idim),j=1,jdim),nu=1,nnu)
stop
end