3 subroutine set_vert(glo_num,ngv,nx,nel,vertex,ifcenter)
11 integer*8 glo_num(1),ngv
16 call setvert3d(glo_num,ngv,nx,nel,vertex,ifcenter)
18 call setvert2d(glo_num,ngv,nx,nel,vertex,ifcenter)
26 if(nio.eq.0 .and. loglevel.gt.2)
27 $
write(6,*)
'call usrsetvert'
28 call usrsetvert(glo_num,nel,nx,nx,nz)
29 if(nio.eq.0 .and. loglevel.gt.2)
30 $
write(6,
'(A,/)')
' done :: usrsetvert'
50 common /scrpre/ uc(lcr*lelt),w(2*lx1*ly1*lz1)
53 call fgslib_crs_solve(xxth(ifield),uc,uf)
91 common /nekmpi/ mid,mp,nekcomm,nekgroup,nekreal
93 common /ivrtx/ vertex((2**ldim)*lelt)
100 common /scrxxt/ cmlt(lcr,lelv),mask(lcr,lelv)
101 common /scrxxti/ ia(lcr,lcr,lelv), ja(lcr,lcr,lelv)
107 common /scrch/ iwork(2,lx1*ly1*lz1*lelv)
108 common /scrns/ w(7*lx1*ly1*lz1*lelv)
109 common /vptsol/ a(27*lx1*ly1*lz1*lelv)
114 common /scrvhx/ h1(lx1*ly1*lz1*lelv),h2(lx1*ly1*lz1*lelv)
115 common /scrmgx/ w1(lx1*ly1*lz1*lelv),w2(lx1*ly1*lz1*lelv)
118 character*132 amgfile_c
119 character*1 fname1(132)
120 equivalence(fname1,amgfile_c)
136 if(nio.eq.0)
write(6,*)
'setup h1 coarse grid, nx_crs=', nx_crs
144 call set_vert(se_to_gcrs,ngv,nxc,nelv,vertex,.true.)
156 if (ifield.eq.1)
then
159 cb=cbc(iface,ie,ifield)
160 if (cb.eq.
'o ' .or. cb.eq.
'on ' .or.
161 $ cb.eq.
'O ' .or. cb.eq.
'ON ' .or. cb.eq.
'MM ' .or.
162 $ cb.eq.
'mm ' .or. cb.eq.
'ms ' .or. cb.eq.
'MS ')
163 $
call facev(mask,ie,iface,z,nxc,nxc,nzc)
166 elseif (ifield.eq.ifldmhd)
then
169 cb=cbc(iface,ie,ifield)
170 if (cb.eq.
'ndd' .or. cb.eq.
'dnd' .or. cb.eq.
'ddn')
171 $
call facev(mask,ie,iface,z,nxc,nxc,nzc)
178 call fgslib_gs_setup(gs_handle,se_to_gcrs,ntot,nekcomm,mp)
179 call fgslib_gs_op (gs_handle,mask,1,2,0)
180 call fgslib_gs_op (gs_handle,cmlt,1,1,0)
181 call fgslib_gs_free (gs_handle)
203 if (ifield.eq.1)
then
204 if (ifvcor) null_space=1
205 elseif (ifield.eq.ifldmhd)
then
206 if (ifbcor) null_space=1
212 call blank(fname1,132)
213 lamgn =
ltrunc(amgfile,len(amgfile))
214 call chcopy(fname1,amgfile,lamgn)
215 call chcopy(fname1(lamgn+1),char(0),1)
218 call fgslib_crs_setup(xxth(ifield),isolver,nekcomm,mp,ntot,
219 $ se_to_gcrs,nz,ia,ja,a, null_space, crs_param,
229 write(6,*)
'done :: setup h1 coarse grid ',t0,
' sec'
239 integer*8 se_to_gcrs(1)
241 if(mask(i).lt.0.1) se_to_gcrs(i)=0
248 integer ia(n,n,ne), ja(n,n,ne)
254 ia(i,j,ie)=(ie-1)*n+i-1
255 ja(i,j,ie)=(ie-1)*n+j-1
280 integer ind(n),a(m,n)
281 integer key(nkey),aa(m)
282 logical iftuple_ianeb,a_ne_b
287 $
'WARNING: For single key, not clear that rank is unique!'
305 a_ne_b = iftuple_ianeb(aa,a(1,i),key,nk)
307 call icopy(aa,a(1,i),m)
330 integer a(lda,n),aa(lda)
331 integer ind(1),key(nkey)
332 logical iftuple_ialtb
345 call icopy(aa,a(1,l),lda)
349 call icopy(aa,a(1,ir),lda)
352 call icopy(a(1,ir),a(1,1),lda)
357 call icopy(a(1,1),aa,lda)
367 if (iftuple_ialtb(a(1,j),a(1,j+1),key,nkey)) j=j+1
369 if (iftuple_ialtb(aa,a(1,j),key,nkey))
then
371 call icopy(a(1,i),a(1,j),lda)
381 call icopy(a(1,i),aa,lda)
392 real a(lda,n),aa(lda)
393 integer ind(1),key(nkey)
407 call copy(aa,a(1,l),lda)
411 call copy(aa,a(1,ir),lda)
414 call copy(a(1,ir),a(1,1),lda)
419 call copy(a(1,1),aa,lda)
430 if (iftuple_altb(a(1,j),a(1,j+1),key,nkey)) j=j+1
433 if (iftuple_altb(aa,a(1,j),key,nkey))
then
435 call copy(a(1,i),a(1,j),lda)
445 call copy(a(1,i),aa,lda)
458 if (a(k).lt.b(k))
then
461 elseif (a(k).gt.b(k))
then
478 if (a(k).lt.b(k))
then
481 elseif (a(k).gt.b(k))
then
498 if (a(k).ne.b(k))
then
523 real a(1),h1(1),h2(1),w(ldw)
525 parameter(lcrd=lx1**ldim)
526 common /ctmp1/ x(lcrd),y(lcrd),z(lcrd)
530 n2 = ncrs_loc*ncrs_loc
535 write(6,*)nid,
'ERROR: increase storage get_local_crs:',nda,lda
543 call map_m_to_n(x,nxc,xm1(1,1,1,ie),lx1,if3d,w,ldw)
544 call map_m_to_n(y,nxc,ym1(1,1,1,ie),lx1,if3d,w,ldw)
545 if (if3d)
call map_m_to_n(z,nxc,zm1(1,1,1,ie),lx1,if3d,w,ldw)
574 real a(1),h1(1),h2(1)
575 real x1(nxc,nxc,1),y1(nxc,nxc,1),z1(nxc,nxc,1)
578 parameter(ldm2=2**ldim)
579 real a_loc(ldm2,ldm2)
583 n2 = ncrs_loc*ncrs_loc
602 x(k) = x1(kx+ix,ky+iy,kz+iz)
603 y(k) = y1(kx+ix,ky+iy,kz+iz)
604 z(k) = z1(kx+ix,ky+iy,kz+iz)
622 ja = (kx+jx) + nxc*(ky+jy-1) + nxc*nyc*(kz+jz-1)
629 ia = (kx+ix) + nxc*(ky+iy-1) + nxc*nyc*(kz+iz-1)
631 ija = ia + ncrs_loc*(ja-1)
632 a(ija) = a(ija) + a_loc(i,j)
659 real a(0:7,0:7),h1(0:7),h2(0:7)
660 real xc(0:7),yc(0:7),zc(0:7)
663 real xt(4),yt(4),zt(4)
665 integer vertex(4,5,2)
667 data vertex / 000 , 001 , 010 , 100
668 $ , 000 , 001 , 011 , 101
669 $ , 011 , 010 , 000 , 110
670 $ , 011 , 010 , 001 , 111
671 $ , 000 , 110 , 101 , 011
673 $ , 101 , 100 , 110 , 000
674 $ , 101 , 100 , 111 , 001
675 $ , 110 , 111 , 100 , 010
676 $ , 110 , 111 , 101 , 011
677 $ , 111 , 001 , 100 , 010 /
683 if (icalld.eq.0)
then
685 call bindec(vertex(i,1,1))
693 xt(iv) = xc(vertex(iv,k,1))
694 yt(iv) = yc(vertex(iv,k,1))
695 zt(iv) = zc(vertex(iv,k,1))
702 a(ii,jj) = a(ii,jj) + 0.5*a_loc(i,j)
712 integer bin_in,d,b,b2
752 xy234 = x34*y23 - x23*y34
753 xy341 = x34*y41 - x41*y34
754 xy412 = x12*y41 - x41*y12
755 xy123 = x12*y23 - x23*y12
756 xz234 = x23*z34 - x34*z23
757 xz341 = x41*z34 - x34*z41
758 xz412 = x41*z12 - x12*z41
759 xz123 = x23*z12 - x12*z23
760 yz234 = y34*z23 - y23*z34
761 yz341 = y34*z41 - y41*z34
762 yz412 = y12*z41 - y41*z12
763 yz123 = y12*z23 - y23*z12
765 g(1,1) = -(x(2)*yz234 + y(2)*xz234 + z(2)*xy234)
766 g(2,1) = -(x(3)*yz341 + y(3)*xz341 + z(3)*xy341)
767 g(3,1) = -(x(4)*yz412 + y(4)*xz412 + z(4)*xy412)
768 g(4,1) = -(x(1)*yz123 + y(1)*xz123 + z(1)*xy123)
784 det = x(1)*yz234 + x(2)*yz341 + x(3)*yz412 + x(4)*yz123
785 vol36 = 1.0/(6.0*det)
787 write(6,*)
'Error: tetrahedron not right-handed',ie
788 write(6,1)
'x',(x(k),k=1,4)
789 write(6,1)
'y',(y(k),k=1,4)
790 write(6,1)
'z',(z(k),k=1,4)
791 1
format(a1,1p4e15.5)
818 a(i,j)=vol36*(g(i,2)*g(j,2)+g(i,3)*g(j,3)+g(i,4)*g(j,4))
838 real a(4,4),h1(1),h2(1)
845 data elem / 1,2,4 , 1,4,3 /
872 area4 = 0.50/(x21*y31 - y12*x13)
874 a_loc(1, 1) = area4*( y23*y23+x32*x32 )
875 a_loc(1, 2) = area4*( y23*y31+x32*x13 )
876 a_loc(1, 3) = area4*( y23*y12+x32*x21 )
878 a_loc(2, 1) = area4*( y31*y23+x13*x32 )
879 a_loc(2, 2) = area4*( y31*y31+x13*x13 )
880 a_loc(2, 3) = area4*( y31*y12+x13*x21 )
882 a_loc(3, 1) = area4*( y12*y23+x21*x32 )
883 a_loc(3, 2) = area4*( y12*y31+x21*x13 )
884 a_loc(3, 3) = area4*( y12*y12+x21*x21 )
892 a(iv,jv) = a(iv,jv) + a_loc(il,jl)
913 real iba(lx*lx),ibat(lx*lx)
918 data nao,nbo / -9, -9/
920 if (na.gt.lx.or.nb.gt.lx)
then
921 write(6,*)
'ERROR: increase lx in map_m_to_n to max:',na,nb
925 if (na.ne.nao .or. nb.ne.nbo)
then
930 call igllm(iba,ibat,zb,za,nb,na,nb,na)
933 call specmpn(a,na,b,nb,iba,ibat,if3d,w,ldw)
940 subroutine specmpn(b,nb,a,na,ba,ab,if3d,w,ldw)
951 real b(nb,nb,nb),a(na,na,na)
955 if (if3d) ltest = na*na*nb + nb*na*na
956 if (ldw.lt.ltest)
then
957 write(6,*)
'ERROR specmp:',ldw,ltest,if3d
964 call mxm(ba,nb,a,na,w,na*na)
968 call mxm(w(k),nb,ab,na,w(l),nb)
973 call mxm(w(l),nbb,ab,na,b,nb)
975 call mxm(ba,nb,a,na,w,na)
976 call mxm(w,nb,ab,na,b,nb)
1017 IF ( a(ind(j)).lt.a(ind(j+1)) ) j=j+1
1019 IF (q.lt.a(ind(j)))
THEN
1040 integer r(1),input(1),ind(1),w(1)
1042 call icopy(r,input,n)
1049 if (r(i).ne.rlast)
then
1068 integer a(nx,ny,nz,lelt),val
1069 call facind (kx1,kx2,ky1,ky2,kz1,kz2,nx,ny,nz,iface)
1087 parameter(lxyz = lx2*ly2*lz2)
1088 real uc(nxyz_c,lelt),uf(lxyz,lelt),w(1)
1090 ltot22 = 2*lx2*ly2*lz2
1094 call maph1_to_l2(uf(1,ie),lx2,uc(1,ie),nx_crs,if3d,w,ltot22)
1111 parameter(lxyz = lx2*ly2*lz2)
1112 real uc(nxyz_c,lelt),uf(lxyz,lelt),w(1)
1114 ltot22 = 2*lx2*ly2*lz2
1118 call maph1_to_l2t(uc(1,ie),nx_crs,uf(1,ie),lx2,if3d,w,ltot22)
1137 real iba(lx*lx),ibat(lx*lx)
1142 data nao,nbo / -9, -9/
1145 if (na.gt.lx.or.nb.gt.lx)
then
1146 write(6,*)
'ERROR: increase lx in maph1_to_l2 to max:',na,nb
1150 if (na.ne.nao .or. nb.ne.nbo)
then
1155 call igllm(iba,ibat,zb,za,nb,na,nb,na)
1158 call specmpn(a,na,b,nb,iba,ibat,if3d,w,ldw)
1176 real iba(lx*lx),ibat(lx*lx)
1181 data nao,nbo / -9, -9/
1184 if (na.gt.lx.or.nb.gt.lx)
then
1185 write(6,*)
'ERROR: increase lx in maph1_to_l2 to max:',na,nb
1189 if (na.ne.nao .or. nb.ne.nbo)
then
1194 call igllm(iba,ibat,zb,za,nb,na,nb,na)
1197 call specmpn(b,nb,a,na,ibat,iba,if3d,w,ldw)
1222 integer ind(n),a(m,n)
1223 integer key(nkey),key2(0:3),aa(m)
1224 logical iftuple_ianeb,a_ne_b
1245 a_ne_b = iftuple_ianeb(aa,a(1,i),key,nk)
1248 if (aa(2).eq.0) ms = aa(2)
1250 call icopy(aa,a(1,i),m)
1258 if (aa(2).eq.0) ms = aa(2)
1283 integer se2crs(nx,nx,1)
1287 write(6,*)
'out_se',nx,name
1292 write(6,4) name,((se2crs(i,j,k+ie),i=1,nx),k=0,1)
1293 elseif(nx.eq.3)
then
1294 write(6,3) name,((se2crs(i,j,k+ie),i=1,nx),k=0,1)
1296 write(6,2) name,((se2crs(i,j,k+ie),i=1,nx),k=0,1)
1301 4
format(a4,5x,2(4i5,3x))
1302 3
format(a4,5x,2(3i5,3x))
1303 2
format(a4,5x,2(2i5,3x))
1313 integer se2crs(nx,nx,1)
1317 write(6,*)
'out_se',nx,name,nel
1322 write(6,4) name,((se2crs(i,j,k+ie),i=1,nx),k=0,3)
1323 elseif(nx.eq.3)
then
1324 write(6,3) name,((se2crs(i,j,k+ie),i=1,nx),k=0,3)
1326 write(6,2) name,((se2crs(i,j,k+ie),i=1,nx),k=0,3)
1331 4
format(a4,5x,4(4i5,3x))
1332 3
format(a4,5x,4(3i5,3x))
1333 2
format(a4,5x,4(2i5,3x))
1354 common /scrpre/ uc(lcr*lelt)
1355 common /scrpr2/ vc(lcr*lelt)
1356 common /scrxxt/ cmlt(lcr,lelv),mask(lcr,lelv)
1363 if (icalld1.eq.0)
then
1370 ntot = nelv*lx1*ly1*lz1
1371 call col3(uf,vf,vmult,ntot)
1378 call fgslib_crs_solve(xxth(ifield),uc,vc)
1396 h1_basis(ix) = 0.5*(1.0-zgm1(ix,1))
1397 h1_basis(ix+lx1) = 0.5*(1.0+zgm1(ix,1))
1399 call transpose(h1_basist,2,h1_basis,lx1)
1414 parameter(lxyz = lx1*ly1*lz1)
1415 real uc(2,2,ldim-1,lelt),uf(lxyz,lelt)
1416 parameter(l2 = ldim-1)
1417 common /ctmp0/ w(lx1,lx1,2),v(lx1,2,l2,lelt)
1422 if (icalld.eq.0)
then
1434 call mxm(h1_basis,lx1,uc,n2,v,n31)
1437 call mxm(v(1,1,iz,ie),lx1,h1_basist,n2,w(1,1,iz),lx1)
1439 call mxm(w,n13,h1_basist,n2,uf(1,ie),lx1)
1445 call mxm(h1_basis,lx1,uc,n2,v,n31)
1447 call mxm(v(1,1,1,ie),lx1,h1_basist,n2,uf(1,ie),lx1)
1464 parameter(lxyz = lx1*ly1*lz1)
1465 real uc(lcr,lelt),uf(lx1,ly1,lz1,lelt)
1466 common /ctmp0/ w(2,2,lx1),v(2,ly1,lz1,lelt)
1471 if (icalld.eq.0)
then
1480 call mxm(h1_basist,n2,uf,lx1,v,n31)
1483 call mxm(v(1,1,iz,ie),n2,h1_basis,lx1,w(1,1,iz),n2)
1485 call mxm(w,n13,h1_basis,lx1,uc(1,ie),n2)
1489 call mxm(h1_basist,n2,uf,lx1,v,n31)
1491 call mxm(v(1,1,1,ie),n2,h1_basis,lx1,uc(1,ie),n2)
1505 real a(ncl,ncl,1),h1(1),h2(1)
1506 real w1(lx1*ly1*lz1,nelv),w2(lx1*ly1*lz1,nelv)
1508 parameter(lcrd=lx1**ldim)
1509 common /ctmp1z/ b(lcrd,8)
1523 call copy(w1(1,e),b(1,j),nxyz)
1526 call axhelm (w2,w1,h1,h2,imsh,isd)
1530 a(i,j,e) =
vlsc2(b(1,i),w2(1,e),nxyz)
1544 real z0(lx1),z1(lx1)
1545 real zr(lx1),zs(lx1),zt(lx1)
1549 call zwgll(zr,zs,lx1)
1552 z0(i) = .5*(1-zr(i))
1553 z1(i) = .5*(1+zr(i))
1556 call copy(zr,z0,lx1)
1557 call copy(zs,z0,lx1)
1558 call copy(zt,z0,lx1)
1560 if (mod(j,2).eq.0)
call copy(zr,z1,lx1)
1561 if (j.eq.3.or.j.eq.4.or.j.eq.7.or.j.eq.8)
call copy(zs,z1,lx1)
1562 if (j.gt.4)
call copy(zt,z1,lx1)
1568 b(p,q,r) = zr(p)*zs(q)*zt(r)
1575 b(p,q,1) = zr(p)*zs(q)
1588 real z0(lx1),z1(lx1),z2(lx1)
1589 real zr(lx1),zs(lx1),zt(lx1)
1593 call zwgll(zr,zs,lx1)
1596 z0(i) = .5*(zr(i)-1)*zr(i)
1597 z1(i) = 4.*(1+zr(i))*(1-zr(i))
1598 z2(i) = .5*(zr(i)+1)*zr(i)
1601 call copy(zr,z0,lx1)
1602 call copy(zs,z0,lx1)
1603 call copy(zt,z0,lx1)
1605 if (mod(j,2).eq.0)
call copy(zr,z1,lx1)
1606 if (j.eq.3.or.j.eq.4.or.j.eq.7.or.j.eq.8)
call copy(zs,z1,lx1)
1607 if (j.gt.4)
call copy(zt,z1,lx1)
1613 b(p,q,r) = zr(p)*zs(q)*zt(r)
1620 b(p,q,1) = zr(p)*zs(q)
1632 common /ivrtx/ vertex((2**ldim)*lelt)
1659 integer ind(n),a(m,n)
1660 integer key(nkey),aa(m)
1661 logical iftuple_ianeb,a_ne_b
1672 a_ne_b = iftuple_ianeb(aa,a(1,i),key,nk)
1674 call icopy(aa,a(1,i),m)
1695 integer ind(nmax),tuple(m,nmax),cr_h
1698 integer key(mmax),wtuple(mmax)
1701 write(6,*) nid,m,mmax,
' gbtuple_rank fail'
1706 tuple(1,i) = mod(tuple(3,i),np)
1712 call fgslib_crystal_ituple_transfer(cr_h, tuple,m,ni,nmax, ky)
1715 if (ni.gt.nmax)
write(6,*) ni,nmax,n,
'cr_xfer problem, A'
1716 if (nimx.gt.nmax)
call exitt
1723 call irank_vecn(ind,nu,tuple,m,ni,key,nkey,wtuple)
1727 nu_prior = nu_tot - nu
1730 tuple(3,i) = ind(i) + nu_prior
1733 call fgslib_crystal_ituple_transfer(cr_h, tuple,m,ni,nmax, ky)
1757 integer*8 glo_num(1),ngv
1758 integer vertex(0:1,0:1,0:1,1),nx
1761 integer edge(0:1,0:1,0:1,3,lelt),enum(12,lelt),fnum(6,lelt)
1762 common /scrmg/ edge,enum,fnum
1765 integer etuple(4,12*lelt*nsafe),ftuple(5,6,lelt*nsafe)
1766 integer ind(12*lelt*nsafe)
1767 common /scrns/ ind,etuple
1768 equivalence(etuple,ftuple)
1770 integer gvf(4),facet(4),aa(3),key(3),e
1774 integer*8 ngvv,ngve,ngvs,ngvi,ngvm
1775 integer*8 n_on_edge,n_on_face,n_in_interior
1791 ngvv =
iglmax(vertex,nlv*nel)
1798 il = 1 + (nx-1)*i + nx*(nx-1)*j + nx*nx*(nx-1)*k
1799 ile = il + nx*ny*nz*(e-1)
1800 glo_num(ile) = vertex(i,j,k,e)
1817 edge(i,j,k,1,e) = vertex(i,j,k,e)
1818 edge(j,i,k,2,e) = vertex(i,j,k,e)
1819 edge(k,i,j,3,e) = vertex(i,j,k,e)
1827 if (edge(0,i,0,1,1).gt.edge(1,i,0,1,1))
then
1828 kswap = edge(0,i,0,1,1)
1829 edge(0,i,0,1,1) = edge(1,i,0,1,1)
1830 edge(1,i,0,1,1) = kswap
1832 etuple(3,i+1) = edge(0,i,0,1,1)
1833 etuple(4,i+1) = edge(1,i,0,1,1)
1839 nmax = 12*lelt*nsafe
1842 enum(i,1) = etuple(3,i)
1844 n_unique_edges =
iglmax(enum,12*nel)
1847 ngve = n_unique_edges*n_on_edge
1854 igv = ngv + n_on_edge*(enum(iedg_loc+1,e)-1)
1855 i0 = nx*(nx-1)*j + nx*nx*(nx-1)*k
1856 i0e = i0 + nxyz*(e-1)
1857 if (glo_num(i0e+1).lt.glo_num(i0e+nx))
then
1859 glo_num(i0e+i) = igv + i-1
1863 glo_num(i0e+i) = igv + 1 + n_on_edge-(i-1)
1866 iedg_loc = iedg_loc + 1
1873 igv = ngv + n_on_edge*(enum(iedg_loc+1,e)-1)
1874 i0 = 1+(nx-1)*i + nx*nx*(nx-1)*k
1875 i0e = i0 + nxyz*(e-1)
1876 if (glo_num(i0e).lt.glo_num(i0e+nx*(nx-1)))
then
1878 glo_num(i0e+(j-1)*nx) = igv + j-1
1882 glo_num(i0e+(j-1)*nx) = igv + 1 + n_on_edge-(j-1)
1885 iedg_loc = iedg_loc + 1
1892 igv = ngv + n_on_edge*(enum(iedg_loc+1,e)-1)
1893 i0 = 1 + (nx-1)*i + nx*(nx-1)*j
1894 i0e = i0 + nxyz*(e-1)
1895 if (glo_num(i0e).lt.glo_num(i0e+nx*nx*(nx-1)))
then
1897 glo_num(i0e+(k-1)*nx*nx) = igv + k-1
1901 glo_num(i0e+(k-1)*nx*nx) = igv + 1 + n_on_edge-(k-1)
1904 iedg_loc = iedg_loc + 1
1935 i = icface(icrn,ifac)-1
1936 facet(icrn) = vertex(i,0,0,e)
1938 call isort(facet,ind,ncrnr)
1939 call icopy(ftuple(3,ifac,e),facet,ncrnr-1)
1949 fnum(i,1) = ftuple(3,i,1)
1951 n_unique_faces =
iglmax(fnum,6*nel)
1953 call dsset (nx,ny,nz)
1956 i0 = skpdat(1,iface)
1957 i1 = skpdat(2,iface)
1958 is = skpdat(3,iface)
1959 j0 = skpdat(4,iface)
1960 j1 = skpdat(5,iface)
1961 js = skpdat(6,iface)
1977 gvf(1) = glo_num(i0+nx*(j0-1)+nxyz*(e-1))
1978 gvf(2) = glo_num(i1+nx*(j0-1)+nxyz*(e-1))
1979 gvf(3) = glo_num(i0+nx*(j1-1)+nxyz*(e-1))
1980 gvf(4) = glo_num(i1+nx*(j1-1)+nxyz*(e-1))
1982 call irank(gvf,ind,4)
1987 if (ind(1).eq.1)
then
1990 if (gvf(2).lt.gvf(3)) ifij = .true.
1991 elseif (ind(1).eq.2)
then
1994 if (gvf(1).lt.gvf(4)) ifij = .true.
1995 elseif (ind(1).eq.3)
then
1998 if (gvf(4).lt.gvf(1)) ifij = .true.
1999 elseif (ind(1).eq.4)
then
2002 if (gvf(3).lt.gvf(2)) ifij = .true.
2020 n_on_face = (nx-2)*(ny-2)
2021 ngvs = n_unique_faces*n_on_face
2022 ig0 = ngv + n_on_face*(fnum(iface,e)-1)
2030 if (k.gt.nx.and.k.lt.nxx-nx .and.
2031 $ mod(k,nx).ne.1.and.mod(k,nx).ne.0)
then
2034 glo_num(i+nx*(j-1)+nxyz*(e-1)) = l + ig0
2045 if (k.gt.nx.and.k.lt.nxx-nx .and.
2046 $ mod(k,nx).ne.1.and.mod(k,nx).ne.0)
then
2049 glo_num(i+nx*(j-1)+nxyz*(e-1)) = l + ig0
2061 n_in_interior = (nx-2)*(ny-2)*(nz-2)
2062 ngvi = n_in_interior*nelgt
2065 ig0 = ngv + n_in_interior*(lglel(e)-1)
2071 glo_num(i+nx*(j-1)+nx*ny*(k-1)+nxyz*(e-1)) = ig0+l
2084 glo_num(i+nx*(j-1)+nx*ny*(k-1)+nxyz*(e-1)) = 0
2093 ngvm = i8glmax(glo_num,m)
2094 ngvv = ngvv + ngve + ngvs
2096 if (nio.eq.0)
write(6,1) nx,ngvv,ngvi,ngv,ngvm
2097 1
format(
' setvert3d:',i4,4i12)
2112 integer*8 glo_num(1),ngv
2113 integer vertex(0:1,0:1,1),nx
2116 integer edge(0:1,0:1,2,lelt),enum(4,lelt)
2117 common /scrmg/ edge,
enum
2120 integer etuple(4,4*lelt*nsafe),ind(4*lelt*nsafe)
2121 common /scrns/ ind,etuple
2123 integer gvf(4),aa(3),key(3),e,eg
2127 integer*8 ngvv,ngve,ngvs,ngvi,ngvm
2128 integer*8 n_on_edge,n_on_face,n_in_interior
2144 ngvv =
iglmax(vertex,nlv*nel)
2152 il = 1 + (nx-1)*i + nx*(nx-1)*j
2153 ile = il + nx*ny*(e-1)
2154 glo_num(ile) = vertex(i,j,e)
2164 edge(i,j,1,e) = vertex(i,j,e)
2165 edge(j,i,2,e) = vertex(i,j,e)
2172 if (edge(0,i,1,1).gt.edge(1,i,1,1))
then
2173 kswap = edge(0,i,1,1)
2174 edge(0,i,1,1) = edge(1,i,1,1)
2175 edge(1,i,1,1) = kswap
2177 etuple(3,i+1) = edge(0,i,1,1)
2178 etuple(4,i+1) = edge(1,i,1,1)
2188 enum(i,1) = etuple(3,i)
2190 n_unique_edges =
iglmax(enum,4*nel)
2201 igv = ngv + n_on_edge*(enum(iedg_loc+1,e)-1)
2203 i0e = i0 + nxyz*(e-1)
2204 if (glo_num(i0e+1).lt.glo_num(i0e+nx))
then
2206 glo_num(i0e+i) = igv + i-1
2210 glo_num(i0e+i) = igv + 1 + n_on_edge-(i-1)
2213 iedg_loc = iedg_loc + 1
2218 igv = ngv + n_on_edge*(enum(iedg_loc+1,e)-1)
2220 i0e = i0 + nxyz*(e-1)
2221 if (glo_num(i0e).lt.glo_num(i0e+nx*(nx-1)))
then
2223 glo_num(i0e+(j-1)*nx) = igv + j-1
2227 glo_num(i0e+(j-1)*nx) = igv + 1 + n_on_edge-(j-1)
2230 iedg_loc = iedg_loc + 1
2234 ngve = n_unique_edges*n_on_edge
2239 n_in_interior = (nx-2)*(ny-2)
2240 ngvi = n_in_interior*nelgt
2243 ig0 = ngv + n_in_interior*(lglel(e)-1)
2248 glo_num(i+nx*(j-1)+nxyz*(e-1)) = ig0+l
2259 glo_num(i+nx*(j-1)+nxyz*(e-1)) = 0
2268 ngvm = i8glmax(glo_num,m)
2271 if (nio.eq.0)
write(6,1) nx,ngvv,ngvi,ngv,ngvm
2272 1
format(
' setvert2d:',i4,4i12)
2289 real iba(lx*lx),ibat(lx*lx)
2294 data nao,nbo / -9, -9/
2296 if (na.gt.lx.or.nb.gt.lx)
then
2297 write(6,*)
'ERROR: increase lx in map_to_crs to max:',na,nb
2301 if (na.ne.nao .or. nb.ne.nbo)
then
2306 call igllm(iba,ibat,zb,za,nb,na,nb,na)
2309 call specmpn(a,na,b,nb,iba,ibat,if3d,w,ldw)
2319 integer*8 glo_num(nx,ny,nz,nel)
2322 integer e,f,fo,ef,efo
2325 data eface0 / 4,2,1,3,5,6 /
2328 if (ifflow) ifld = 1
2336 if (cbc(ef,e,ifld).eq.
'p '.and.cbc(efo,e,ifld).eq.
'p ')
then
2340 gmn = min(glo_num(1,j,k,e),glo_num(nx,j,k,e))
2341 glo_num(1 ,j,k,e) = gmn
2342 glo_num(nx,j,k,e) = gmn
2345 elseif (f.eq.3)
then
2348 gmn = min(glo_num(i,1,k,e),glo_num(i,ny,k,e))
2349 glo_num(i,1 ,k,e) = gmn
2350 glo_num(i,ny,k,e) = gmn
2356 gmn = min(glo_num(i,j,1,e),glo_num(i,j,nz,e))
2357 glo_num(i,j,1 ,e) = gmn
2358 glo_num(i,j,nz,e) = gmn
function igl_running_sum(in)
real *8 function dnekclock()
subroutine facev(a, ie, iface, val, nx, ny, nz)
subroutine facind(kx1, kx2, ky1, ky2, kz1, kz2, nx, ny, nz, iface)
subroutine dsset(nx, ny, nz)
subroutine axhelm(au, u, helm1, helm2, imesh, isd)
subroutine col3(a, b, c, n)
subroutine transpose(a, lda, b, ldb)
subroutine icopy(a, b, n)
subroutine isort(a, ind, n)
real function vlsc2(x, y, n)
function ltrunc(string, l)
subroutine chcopy(a, b, n)
subroutine mxm(a, n1, b, n2, c, n3)
subroutine iunswap(b, ind, n, temp)
subroutine check_p_bc(glo_num, nx, ny, nz, nel)
subroutine irank(A, IND, N)
subroutine map_c_to_f_l2_bilin(uf, uc, w)
subroutine crs_solve_h1(uf, vf)
subroutine maph1_to_l2(a, na, b, nb, if3d, w, ldw)
subroutine map_c_to_f_h1_bilin(uf, uc)
subroutine a_crs_3d(a, h1, h2, xc, yc, zc, ie)
subroutine map_f_to_c_l2_bilin(uc, uf, w)
subroutine tuple_sort(a, lda, n, key, nkey, ind, aa)
subroutine bindec(bin_in)
subroutine set_vert(glo_num, ngv, nx, nel, vertex, ifcenter)
subroutine get_local_crs(a, lda, nxc, h1, h2, w, ldw)
subroutine a_crs_2d(a, h1, h2, x, y, ie)
logical function iftuple_altb(a, b, key, nkey)
subroutine specmpn(b, nb, a, na, ba, ab, if3d, w, ldw)
subroutine map_to_crs(a, na, b, nb, if3d, w, ldw)
subroutine gen_crs_basis2(b, j)
subroutine get_local_a_tet(a, x, y, z, kt, ie)
subroutine a_crs_enriched(a, h1, h2, x1, y1, z1, nxc, if3d, ie)
logical function iftuple_ialtb(a, b, key, nkey)
subroutine out_se0(se2crs, nx, nel, name)
subroutine crs_solve_l2(uf, vf)
subroutine maph1_to_l2t(b, nb, a, na, if3d, w, ldw)
subroutine map_m_to_n(a, na, b, nb, if3d, w, ldw)
subroutine out_se1(se2crs, nx, name)
subroutine setvert3d(glo_num, ngv, nx, nel, vertex, ifcenter)
subroutine ifacev_redef(a, ie, iface, val, nx, ny, nz)
subroutine map_f_to_c_h1_bilin(uc, uf)
subroutine irank_vec_tally(ind, nn, a, m, n, key, nkey, key2, aa)
subroutine setvert2d(glo_num, ngv, nx, nel, vertex, ifcenter)
subroutine gen_crs_basis(b, j)
subroutine get_local_crs_galerkin(a, ncl, nxc, h1, h2, w1, w2)
subroutine irank_vecn(ind, nn, a, m, n, key, nkey, aa)
subroutine iranku(r, input, n, w, ind)
logical function iftuple_ianeb(a, b, key, nkey)
subroutine set_h1_basis_bilin
subroutine set_mat_ij(ia, ja, n, ne)
subroutine gbtuple_rank(tuple, m, n, nmax, cr_h, nid, np, ind)
subroutine ituple_sort(a, lda, n, key, nkey, ind, aa)
subroutine irank_vec(ind, nn, a, m, n, key, nkey, aa)
subroutine set_jl_crs_mask(n, mask, se_to_gcrs)
subroutine zwgl(Z, W, NP)
subroutine zwgll(Z, W, NP)
subroutine igllm(I12, IT12, Z1, Z2, lz1, lz2, ND1, ND2)