| 1 | C> @file face.f low-level initialization drivers. Eventually to be
|
|---|
| 2 | C> superceded by nek5000 core DG handles and operators.
|
|---|
| 3 | c-----------------------------------------------------------------------
|
|---|
| 4 | subroutine iface_vert_int8cmt(nx,ny,nz,fa,va,jz0,jz1,nel)
|
|---|
| 5 | include 'SIZE'
|
|---|
| 6 | integer*8 fa(nx*nz,2*ldim,nel),va(0:nx+1,0:ny+1,jz0:jz1,nel)
|
|---|
| 7 | integer e,f
|
|---|
| 8 |
|
|---|
| 9 | n = nx*nz*2*ldim*nel
|
|---|
| 10 | call izero8(fa,n)
|
|---|
| 11 |
|
|---|
| 12 | mx1 = nx+2
|
|---|
| 13 | my1 = ny+2
|
|---|
| 14 | mz1 = nz+2
|
|---|
| 15 | if (ldim.eq.2) mz1=1
|
|---|
| 16 |
|
|---|
| 17 | nface = 2*ldim
|
|---|
| 18 | do e=1,nel
|
|---|
| 19 | do f=1,nface
|
|---|
| 20 | call facind (kx1,kx2,ky1,ky2,kz1,kz2,nx,ny,nz,f)
|
|---|
| 21 |
|
|---|
| 22 | if (f.eq.1) then ! EB notation
|
|---|
| 23 | ky1=ky1-1
|
|---|
| 24 | ky2=ky1
|
|---|
| 25 | elseif (f.eq.2) then
|
|---|
| 26 | kx1=kx1+1
|
|---|
| 27 | kx2=kx1
|
|---|
| 28 | elseif (f.eq.3) then
|
|---|
| 29 | ky1=ky1+1
|
|---|
| 30 | ky2=ky1
|
|---|
| 31 | elseif (f.eq.4) then
|
|---|
| 32 | kx1=kx1-1
|
|---|
| 33 | kx2=kx1
|
|---|
| 34 | elseif (f.eq.5) then
|
|---|
| 35 | kz1=kz1-1
|
|---|
| 36 | kz2=kz1
|
|---|
| 37 | elseif (f.eq.6) then
|
|---|
| 38 | kz1=kz1+1
|
|---|
| 39 | kz2=kz1
|
|---|
| 40 | endif
|
|---|
| 41 |
|
|---|
| 42 | i = 0
|
|---|
| 43 | do iz=kz1,kz2
|
|---|
| 44 | do iy=ky1,ky2
|
|---|
| 45 | do ix=kx1,kx2
|
|---|
| 46 | i = i+1
|
|---|
| 47 | fa(i,f,e)=va(ix,iy,iz,e)
|
|---|
| 48 | enddo
|
|---|
| 49 | enddo
|
|---|
| 50 | enddo
|
|---|
| 51 | enddo
|
|---|
| 52 | enddo
|
|---|
| 53 |
|
|---|
| 54 | return
|
|---|
| 55 | end
|
|---|
| 56 |
|
|---|
| 57 | !-----------------------------------------------------------------------
|
|---|
| 58 |
|
|---|
| 59 | subroutine setup_cmt_gs(dg_hndl,nx,ny,nz,nel,melg,vertex,gnv,gnf)
|
|---|
| 60 |
|
|---|
| 61 | ! Global-to-local mapping for gs
|
|---|
| 62 |
|
|---|
| 63 | include 'SIZE'
|
|---|
| 64 | include 'TOTAL'
|
|---|
| 65 |
|
|---|
| 66 | integer dg_hndl
|
|---|
| 67 | integer vertex(*)
|
|---|
| 68 |
|
|---|
| 69 | integer*8 gnv(*),gnf(*),ngv
|
|---|
| 70 |
|
|---|
| 71 | common /nekmpi/ mid,mp,nekcomm,nekgroup,nekreal
|
|---|
| 72 |
|
|---|
| 73 | mx = nx+2
|
|---|
| 74 | call set_vert(gnv,ngv,mx,nel,vertex,.false.) ! lives in navier8.f
|
|---|
| 75 |
|
|---|
| 76 | mz0 = 1
|
|---|
| 77 | mz1 = 1
|
|---|
| 78 | if (if3d) mz0 = 0
|
|---|
| 79 | if (if3d) mz1 = nz+1
|
|---|
| 80 | call iface_vert_int8cmt(nx,ny,nz,gnf,gnv,mz0,mz1,nelt)
|
|---|
| 81 |
|
|---|
| 82 | nf = nx*nz*2*ldim*nelt !total number of points on faces BETTA BE 4-byte!
|
|---|
| 83 | call fgslib_gs_setup(dg_hndl,gnf,nf,nekcomm,np)
|
|---|
| 84 |
|
|---|
| 85 | return
|
|---|
| 86 | end
|
|---|
| 87 |
|
|---|
| 88 | !-----------------------------------------------------------------------
|
|---|
| 89 |
|
|---|
| 90 | subroutine setup_cmt_commo
|
|---|
| 91 | include 'SIZE'
|
|---|
| 92 | include 'TOTAL'
|
|---|
| 93 | include 'DG'
|
|---|
| 94 |
|
|---|
| 95 | parameter(lf=lx1*lz1*2*ldim*lelt)
|
|---|
| 96 | common /c_is1/ glo_num_face(lf)
|
|---|
| 97 | $ , glo_num_vol((lx1+2)*(ly1+2)*(lz1+2)*lelt)
|
|---|
| 98 | integer*8 glo_num_face,glo_num_vol,ngv
|
|---|
| 99 |
|
|---|
| 100 | call setup_cmt_gs(dg_hndl,lx1,ly1,lz1,nelt,nelgt,vertex,
|
|---|
| 101 | > glo_num_vol,glo_num_face)
|
|---|
| 102 | call cmt_set_fc_ptr(nelt,lx1,ly1,lz1,ndg_face,iface_flux)
|
|---|
| 103 |
|
|---|
| 104 | return
|
|---|
| 105 | end
|
|---|
| 106 |
|
|---|
| 107 | !-----------------------------------------------------------------------
|
|---|
| 108 |
|
|---|
| 109 | subroutine cmt_set_fc_ptr(nel,nx,ny,nz,nface,iface)
|
|---|
| 110 |
|
|---|
| 111 | ! Set up pointer to restrict u to faces ! NOTE: compact
|
|---|
| 112 | ! JH062314 Now 2D so we can strip faces by element and not necessarily
|
|---|
| 113 | ! from the whole field
|
|---|
| 114 |
|
|---|
| 115 | include 'SIZE'
|
|---|
| 116 | include 'TOTAL'
|
|---|
| 117 |
|
|---|
| 118 | integer nx, ny, nz, nel
|
|---|
| 119 | integer nface,iface(nx*nz*2*ldim,*)
|
|---|
| 120 | integer e,f,ef
|
|---|
| 121 |
|
|---|
| 122 | call dsset(nx,ny,nz) ! set skpdat. lives in connect1.f
|
|---|
| 123 |
|
|---|
| 124 | nxyz = nx*ny*nz
|
|---|
| 125 | nxz = nx*nz
|
|---|
| 126 | nfpe = 2*ldim
|
|---|
| 127 | nxzf = nx*nz*nfpe ! red'd mod to area, unx, etc.
|
|---|
| 128 |
|
|---|
| 129 | do e=1,nel
|
|---|
| 130 | do f=1,nfpe
|
|---|
| 131 |
|
|---|
| 132 | ef = eface(f)
|
|---|
| 133 | js1 = skpdat(1,f)
|
|---|
| 134 | jf1 = skpdat(2,f)
|
|---|
| 135 | jskip1 = skpdat(3,f)
|
|---|
| 136 | js2 = skpdat(4,f)
|
|---|
| 137 | jf2 = skpdat(5,f)
|
|---|
| 138 | jskip2 = skpdat(6,f)
|
|---|
| 139 |
|
|---|
| 140 | i = 0
|
|---|
| 141 | do j2=js2,jf2,jskip2
|
|---|
| 142 | do j1=js1,jf1,jskip1
|
|---|
| 143 |
|
|---|
| 144 | i = i+1
|
|---|
| 145 | k = i+nxz*(ef-1) ! face numbering
|
|---|
| 146 | iface(k,e) = j1+nx*(j2-1) ! cell numbering
|
|---|
| 147 |
|
|---|
| 148 | enddo
|
|---|
| 149 | enddo
|
|---|
| 150 |
|
|---|
| 151 | enddo
|
|---|
| 152 | enddo
|
|---|
| 153 | nface = nxzf*nel
|
|---|
| 154 |
|
|---|
| 155 | return
|
|---|
| 156 | end
|
|---|
| 157 |
|
|---|
| 158 | !-----------------------------------------------------------------------
|
|---|
| 159 |
|
|---|
| 160 | subroutine full2face_cmt(nel,nx,ny,nz,iface,faces,vols)
|
|---|
| 161 |
|
|---|
| 162 | ! JH062314 Store face data from nel full elements (volume data). Merely
|
|---|
| 163 | ! selection for the time being (GLL grid), but if we need to
|
|---|
| 164 | ! extrapolate to faces (say, from Gauss points), this is where
|
|---|
| 165 | ! we'd do it.
|
|---|
| 166 |
|
|---|
| 167 | include 'SIZE'
|
|---|
| 168 | include 'TOTAL'
|
|---|
| 169 |
|
|---|
| 170 | integer nel,nx,ny,nz
|
|---|
| 171 | integer iface(nx*nz*2*ldim,1)
|
|---|
| 172 | real faces(nx*nz ,2*ldim,nel)
|
|---|
| 173 | real vols (nx,ny,nz ,1 )
|
|---|
| 174 | integer e,i,j
|
|---|
| 175 |
|
|---|
| 176 | n= nx*nz*2*ldim
|
|---|
| 177 | do e=1,nel
|
|---|
| 178 | do j=1,n
|
|---|
| 179 | i=iface(j,e)
|
|---|
| 180 | faces(j,1,e) = vols(i,1,1,e)
|
|---|
| 181 | enddo
|
|---|
| 182 | enddo
|
|---|
| 183 |
|
|---|
| 184 | return
|
|---|
| 185 | end
|
|---|
| 186 |
|
|---|
| 187 | !-----------------------------------------------------------------------
|
|---|
| 188 |
|
|---|
| 189 | subroutine add_face2full_cmt(nel,nx,ny,nz,iface,vols,faces)
|
|---|
| 190 |
|
|---|
| 191 | include 'SIZE'
|
|---|
| 192 | include 'TOTAL'
|
|---|
| 193 |
|
|---|
| 194 | integer nel,nx,ny,nz
|
|---|
| 195 | integer iface(nx*nz*2*ldim,*)
|
|---|
| 196 | real faces(nx*nz ,2*ldim,* )
|
|---|
| 197 | real vols (nx,ny,nz ,nel)
|
|---|
| 198 | integer ie,i,j
|
|---|
| 199 |
|
|---|
| 200 | n= nx*nz*2*ldim
|
|---|
| 201 | do ie=1,nel
|
|---|
| 202 | do j=1,n
|
|---|
| 203 | i=iface(j,ie)
|
|---|
| 204 | vols(i,1,1,ie) = vols(i,1,1,ie)+faces(j,1,ie)
|
|---|
| 205 | enddo
|
|---|
| 206 | enddo
|
|---|
| 207 |
|
|---|
| 208 | return
|
|---|
| 209 | end
|
|---|