2 subroutine cggosf (u1,u2,u3,r1,r2,r3,h1,h2,rmult,binv,
3 $ vol,tin,maxit,matmod)
13 common /screv/ dpc(lx1*ly1*lz1*lelt)
14 $ , p1(lx1*ly1*lz1*lelt)
15 common /scrch/ p2(lx1*ly1*lz1*lelt)
16 $ , p3(lx1*ly1*lz1*lelt)
17 common /scrsl/ qq1(lx1*ly1*lz1*lelt)
18 $ , qq2(lx1*ly1*lz1*lelt)
19 $ , qq3(lx1*ly1*lz1*lelt)
20 common /scrmg/ pp1(lx1*ly1*lz1*lelt)
21 $ , pp2(lx1*ly1*lz1*lelt)
22 $ , pp3(lx1*ly1*lz1*lelt)
23 $ , wa(lx1*ly1*lz1*lelt)
24 real ap1(1),ap2(1),ap3(1)
25 equivalence(ap1,pp1),(ap2,pp2),(ap3,pp3)
27 common /fastmd/ ifdfrm(lelt), iffast(lelt), ifh2, ifsolv
28 common /cprint/ ifprint
29 logical ifdfrm, iffast, ifh2, ifsolv, ifprint
31 real u1(1),u2(1),u3(1),
32 $ r1(1),r2(1),r3(1),h1(1),h2(1),rmult(1),binv(1)
51 if (restol(ifield).ne.0) tol=restol(ifield)
58 if ( .not.ifsolv )
then
63 call opdot (wa,r1,r2,r3,r1,r2,r3,n)
64 rbnorm =
glsc3(wa,binv,rmult,n)
65 rbnorm = sqrt( rbnorm / vol )
66 if (rbnorm .lt. tol**2)
then
70 if (matmod.ge.0.and.nio.eq.0)
write (6,3000)
71 $ istep,iter,rbnorm,r0,tol
72 if (matmod.lt.0.and.nio.eq.0)
write (6,3010)
73 $ istep,iter,rbnorm,r0,tol
78 call setprec (dpc,h1,h2,imesh,1)
79 call setprec (wa ,h1,h2,imesh,2)
90 call fdm_h1a (pp1,r1,dpc,nel,ktype(1,1,1),wa)
91 call fdm_h1a (pp2,r2,dpc,nel,ktype(1,1,2),wa)
92 call fdm_h1a (pp3,r3,dpc,nel,ktype(1,1,3),wa)
93 call rmask (pp1,pp2,pp3,nel)
96 call col3 (pp1,dpc,r1,n)
97 call col3 (pp2,dpc,r2,n)
98 if (if3d)
call col3 (pp3,dpc,r3,n)
102 call rmask (p1,p2,p3,nel)
106 call opadd2 (p1,p2,p3,pp1,pp2,pp3)
111 call axhmsf (ap1,ap2,ap3,p1,p2,p3,h1,h2,matmod)
112 call rmask (ap1,ap2,ap3,nel)
117 call opadds (u1,u2,u3,p1 ,p2 ,p3 , alpha,n,2)
118 call opadds (r1,r2,r3,ap1,ap2,ap3,-alpha,n,2)
120 call opdot (wa,r1,r2,r3,r1,r2,r3,n)
121 rbnorm =
glsc3(wa,binv,rmult,n)
122 rbnorm = sqrt(rbnorm/vol)
124 if (iter.eq.1) r0 = rbnorm
126 if (rbnorm.lt.tol)
then
129 if (matmod.ge.0)
write(6,3000) istep,ifin,rbnorm,r0,tol
130 if (matmod.lt.0)
write(6,3010) istep,ifin,rbnorm,r0,tol
136 call fdm_h1a (pp1,r1,dpc,nel,ktype(1,1,1),wa)
137 call fdm_h1a (pp2,r2,dpc,nel,ktype(1,1,2),wa)
138 call fdm_h1a (pp3,r3,dpc,nel,ktype(1,1,3),wa)
139 call rmask (pp1,pp2,pp3,nel)
142 call col3 (pp1,dpc,r1,n)
143 call col3 (pp2,dpc,r2,n)
144 if (if3d)
call col3 (pp3,dpc,r3,n)
149 call rmask (qq1,qq2,qq3,nel)
150 call opadd2 (pp1,pp2,pp3,qq1,qq2,qq3)
153 call opdot (wa,r1,r2,r3,pp1,pp2,pp3,n)
156 rpp1 =
glsc2(wa,rmult,n)
158 call opadds (p1,p2,p3,pp1,pp2,pp3,beta,n,1)
161 if (matmod.ge.0.and.nio.eq.0)
write (6,3001)
162 $ istep,iter,rbnorm,r0,tol
163 if (matmod.lt.0.and.nio.eq.0)
write (6,3011)
164 $ istep,iter,rbnorm,r0,tol
170 3000
format(i11,
' Helmh3 fluid ',i6,1p3e13.4)
171 3010
format(i11,
' Helmh3 mesh ',i6,1p3e13.4)
172 3001
format(i11,
' Helmh3 fluid unconverged! ',i6,1p3e13.4)
173 3011
format(i11,
' Helmh3 mesh unconverged! ',i6,1p3e13.4)
189 common /scruz/ cx(lx1*ly1*lz1*lelt)
190 $ , cy(lx1,ly1,lz1,lelt)
191 $ , cz(lx1,ly1,lz1,lelt)
193 common /cprint/ ifprint
204 data iffxdt /.false./
207 if (param(12).lt.0.or.iffxdt)
then
209 param(12) = abs(param(12))
213 call opsub3 (cx,cy,cz,vx,vy,vz,wx,wy,wz)
220 else IF (param(84).NE.0.0)
THEN
221 if (dtold.eq.0.0)
then
246 IF ((dt.EQ.0.).AND.(dtfs.GT.0.))
THEN
248 ELSEIF ((dt.GT.0.).AND.(dtfs.GT.0.))
THEN
250 ELSEIF ((dt.EQ.0.).AND.(dtfs.EQ.0.))
THEN
252 IF (ifflow.AND.nid.EQ.0.AND.ifprint)
THEN
253 WRITE (6,*)
'WARNING: CFL-condition & surface tension'
254 WRITE (6,*)
' are not applicable'
256 ELSEIF ((dt.GT.0.).AND.(dtfs.EQ.0.))
THEN
260 IF (nio.EQ.0)
WRITE (6,*)
'WARNING: DT<0 or DTFS<0'
261 IF (nio.EQ.0)
WRITE (6,*)
' Reset DT '
266 IF ((dt.GT.0.).AND.(dtinit.GT.0.))
THEN
268 ELSEIF ((dt.EQ.0.).AND.(dtinit.GT.0.))
THEN
270 ELSEIF ((dt.GT.0.).AND.(dtinit.EQ.0.))
THEN
272 ELSEIF (.not.iffxdt)
THEN
274 IF(nio.EQ.0)
WRITE (6,*)
'WARNING: Set DT=0.001 (arbitrarily)'
279 200
IF (time+dt .GE. fintim .AND. fintim.NE.0.0)
THEN
283 IF (nio.EQ.0)
WRITE (6,*)
'Final time step = ',dt
287 IF (nio.EQ.0.AND.ifprint.AND.dt.NE.dtold)
288 $
WRITE (6,100) dt,dtcfl,dtfs,dtinit
289 100
FORMAT(5x,
'DT/DTCFL/DTFS/DTINIT',4e12.3)
293 IF (dtold.NE.0.0 .AND. lastep.NE.1)
THEN
312 if (iffxdt.and.abs(courno).gt.10.*abs(ctarg))
then
313 if (nid.eq.0)
write(6,*)
'CFL, Ctarg!',courno,ctarg
335 IF (ifnonl(ifield))
THEN
342 tnorm1 = tnrmh1(ifield-1)
344 tnorm2 = tnrmh1(ifield-1)
345 eps = abs((tnorm2-tnorm1)/tnorm2)
346 IF (eps .LT. tolnl) ifconv = .true.
361 IF (ifield.EQ.1)
THEN
367 CALL normvc (vnrmh1,vnrmsm,vnrml2,vnrml8,vx,vy,vz)
368 IF (istep.EQ.0)
return
374 if (time.le.0) tden = abs(time)+1.e-9
375 arg = ((time-dt)*dtinvm**2+1./dt)/tden
376 if (arg.gt.0) dtinvm = sqrt(arg)
377 arg = ((time-dt)*vmean**2+dt*vnrmh1**2)/tden
378 if (arg.gt.0) vmean = sqrt(arg)
384 CALL normsc (tnrmh1(ifield-1),tnrmsm(ifield-1),
385 $ tnrml2(ifield-1),tnrml8(ifield-1),
386 $ t(1,1,1,1,ifield-1),imesh)
393 subroutine chktmg (tol,res,w1,w2,mult,mask,imesh)
406 REAL RES (LX1,LY1,LZ1,1)
407 REAL W1 (LX1,LY1,LZ1,1)
408 REAL W2 (LX1,LY1,LZ1,1)
409 REAL MULT (LX1,LY1,LZ1,1)
410 REAL MASK (LX1,LY1,LZ1,1)
418 IF (diff.EQ.0.) eps = 1.e-6*eigga/eigaa
419 IF (diff.GT.0.) eps = 1.e-13*eigga/eigaa
421 IF (imesh.EQ.1) nl = nelv
422 IF (imesh.EQ.2) nl = nelt
423 ntot1 = lx1*ly1*lz1*nl
424 CALL copy (w1,res,ntot1)
426 CALL dssum (w1,lx1,ly1,lz1)
429 CALL col3 (w2,binvm1,w1,ntot1)
430 rinit = sqrt(
glsc3(w2,w1,mult,ntot1)/volvm1)
432 CALL col3 (w2,bintm1,w1,ntot1)
433 rinit = sqrt(
glsc3(w2,w1,mult,ntot1)/voltm1)
436 IF (tol.LT.rmin)
THEN
440 $
WRITE (6,*)
'New MG-tolerance (RINIT*epsm*cond) = ',tol,tolold
444 bcneu1 =
glsc3(w1,mask,mult,ntot1)
445 bcneu2 =
glsc3(w1,w1 ,mult,ntot1)
446 bctest = abs(bcneu1-bcneu2)
447 IF (bctest .LT. .1)
THEN
448 otr =
glsum(res,ntot1)
449 tolmin = abs(otr)*eigga/eigaa
450 IF (tol .LT. tolmin)
THEN
454 $
WRITE (6,*)
'New MG-tolerance (OTR) = ',tol,tolold
476 common /ctmp1/ u(lx1,ly1,lz1,lelv)
477 $ , v(lx1,ly1,lz1,lelv)
478 $ , w(lx1,ly1,lz1,lelv)
479 common /ctmp0/ x(lx1,ly1,lz1,lelv)
480 $ , r(lx1,ly1,lz1,lelv)
483 common /scruz/ cx(lx1*ly1*lz1*lelv)
484 $ , cy(lx1,ly1,lz1,lelv)
485 $ , cz(lx1,ly1,lz1,lelv)
499 IF (.NOT.iftran)
THEN
506 if (irst.gt.0) ifirst=1
510 IF (ifirst.EQ.0)
THEN
514 CALL bcdirvc (vx,vy,vz,v1mask,v2mask,v3mask)
527 IF (ifflow .AND. ifnav) iconv=1
530 DO 10 ipscal=0,npscal
531 IF (ifadvc(ipscal+2)) iconv=1
544 ntot = lx1*ly1*lz1*nelv
545 ntotl = lx1*ly1*lz1*lelv
552 call opsub3 (cx,cy,cz,vx,vy,vz,wx,wy,wz)
563 IF (dt .EQ. 0.0)
THEN
565 IF (umax .NE. 0.0)
THEN
577 CALL opcolv (bfx,bfy,bfz,binvm1)
581 u(i,1,1,1) = abs(bfx(i,1,1,1))
582 v(i,1,1,1) = abs(bfy(i,1,1,1))
583 w(i,1,1,1) = abs(bfz(i,1,1,1))
585 fmax =
glmax(u,ntotd)
588 dxchar = sqrt( (xm1(1,1,1,1)-xm1(2,1,1,1))**2 +
589 $ (ym1(1,1,1,1)-ym1(2,1,1,1))**2 +
590 $ (zm1(1,1,1,1)-zm1(2,1,1,1))**2 )
591 dxchar =
glmin(dxchar,1)
593 dt = sqrt(ctarg*dxchar/amax)
596 $
WRITE (6,*)
'CFL: Zero velocity and body force'
602 $
WRITE (6,*)
' Stefan problem with no fluid flow'
607 ELSEIF ((dt.GT.0.0).AND.(umax.NE.0.0))
THEN
616 IF (ifirst.EQ.1)
THEN
620 cpred = 2.*courno-cold
627 IF(courno.GT.cmax .OR. cpred.GT.cmax .OR. courno.LT.cmin)
THEN
640 ELSE IF(abs((vcour-vold)/vcour).LT.0.001)
THEN
647 dtlow=(-b+sqrt(discr) )/(2.0*a)
648 dthi =(-b-sqrt(discr) )/(2.0*a)
649 IF(dthi .GT. 0.0 .AND. dtlow .GT. 0.0)
THEN
654 ELSE IF(dthi .LE. 0.0 .AND. dtlow .LE. 0.0)
THEN
671 IF (dtold/dt .LT. 0.2) dt = dtold*5
686 common /ctmp0/ stc(lx1,ly1,lz1),sigst(lx1,ly1),dtst(lx1,ly1)
691 IF (.NOT.ifsurt)
THEN
698 ntot1 = lx1*ly1*lz1*nelv
705 IF (factor .LE. 0.0) factor=1.0
706 factor = factor / sqrt( pi**3 )
711 rhomin =
glmin( vtrans(1,1,1,1,ifield),ntot1 )
715 cb =cbc(ifc,iel,ifield)
716 cb2=cbc(ifc,iel,ifield)
717 IF (cb2.NE.
'MS' .AND. cb2.NE.
'ms')
GOTO 100
718 IF (cb2(1:1).EQ.
'M')
THEN
719 bc4 = bc(4,ifc,iel,ifield)
720 CALL cfill (sigst,bc4,nxz1)
722 CALL faceis (cb,stc,iel,ifc,lx1,ly1,lz1)
723 CALL facexs (sigst,stc,ifc,0)
725 sigmax =
vlmax(sigst,nxz1)
726 IF (sigmax.LE.0.0)
GOTO 100
727 rhosig = sqrt( rhomin/sigmax )
729 CALL cdxmin2 (dtst,rhosig,iel,ifc,ifaxis)
731 CALL cdxmin3 (dtst,rhosig,iel,ifc)
733 dtmin =
vlmin( dtst,nxz1 )
734 dtfs = min( dtfs,dtmin )
736 dtfs =
glmin( dtfs,1 )
738 IF (dtfs .GT. 1.e+10) dtfs = 0.0
741 IF (dtfs.EQ.0.0)
THEN
742 IF (istep.EQ.1.AND.nio.EQ.0)
THEN
743 WRITE (6,*)
' Warning - zero surface-tension may results in'
744 WRITE (6,*)
' instability of free-surface update'
750 subroutine cdxmin2 (dtst,rhosig,iel,ifc,ifaxis)
755 common /delrst/ drst(lx1),drsti(lx1)
756 common /ctmp0/ xfm1(lx1),yfm1(lx1),t1xf(lx1),t1yf(lx1)
757 dimension dtst(lx1,1)
764 IF (diff.EQ.0.) eps = 1.e-6
765 IF (diff.GT.0.) eps = 1.e-13
767 CALL facec2 (xfm1,yfm1,xm1(1,1,1,iel),ym1(1,1,1,iel),ifc)
769 IF (ifc.EQ.1 .OR. ifc.EQ.3)
THEN
770 CALL mxm (dxm1,lx1,xfm1,lx1,t1xf,1)
771 CALL mxm (dxm1,lx1,yfm1,lx1,t1yf,1)
773 IF (ifaxis)
CALL setaxdy ( ifrzer(iel) )
774 CALL mxm (dym1,ly1,xfm1,ly1,t1xf,1)
775 CALL mxm (dym1,ly1,yfm1,ly1,t1yf,1)
780 IF (yfm1(ix) .LT. eps)
THEN
783 xj = sqrt( t1xf(ix)**2 + t1yf(ix)**2 )*drst(ix)
784 dtst(ix,1) = rhosig * sqrt( xj**3 ) * yfm1(ix)
789 xj = sqrt( t1xf(ix)**2 + t1yf(ix)**2 )*drst(ix)
790 dtst(ix,1) = rhosig * sqrt( xj**3 )
801 common /delrst/ drst(lx1),drsti(lx1)
802 common /ctmp0/ xfm1(lx1,ly1),yfm1(lx1,ly1),zfm1(lx1,ly1)
803 common /ctmp1/ drm1(lx1,lx1),drtm1(lx1,ly1)
804 $ , dsm1(lx1,lx1),dstm1(lx1,ly1)
805 common /scrmg/ xrm1(lx1,ly1),yrm1(lx1,ly1),zrm1(lx1,ly1)
806 $ , xsm1(lx1,ly1),ysm1(lx1,ly1),zsm1(lx1,ly1)
807 dimension dtst(lx1,ly1)
809 call facexv (xfm1,yfm1,zfm1,xm1(1,1,1,iel),ym1(1,1,1,iel),
810 $ zm1(1,1,1,iel),ifc,0)
811 call setdrs (drm1,drtm1,dsm1,dstm1,ifc)
813 CALL mxm (drm1,lx1, xfm1,lx1,xrm1,ly1)
814 CALL mxm (drm1,lx1, yfm1,lx1,yrm1,ly1)
815 CALL mxm (drm1,lx1, zfm1,lx1,zrm1,ly1)
816 CALL mxm (xfm1,lx1,dstm1,ly1,xsm1,ly1)
817 CALL mxm (yfm1,lx1,dstm1,ly1,ysm1,ly1)
818 CALL mxm (zfm1,lx1,dstm1,ly1,zsm1,ly1)
822 delr = xrm1(ix,iy)**2 + yrm1(ix,iy)**2 + zrm1(ix,iy)**2
823 dels = xsm1(ix,iy)**2 + ysm1(ix,iy)**2 + zsm1(ix,iy)**2
824 delr = sqrt( delr )*drst(ix)
825 dels = sqrt( dels )*drst(iy)
826 xj = min( delr,dels )
827 dtst(ix,iy) = rhosig * sqrt( xj**3 )
843 dimension a(lx1,ly1,lz1),b(lx1,ly1)
847 CALL dsset(lx1,ly1,lz1)
848 iface = eface1(iface1)
849 js1 = skpdat(1,iface)
850 jf1 = skpdat(2,iface)
851 jskip1 = skpdat(3,iface)
852 js2 = skpdat(4,iface)
853 jf2 = skpdat(5,iface)
854 jskip2 = skpdat(6,iface)
858 DO 100 j2=js2,jf2,jskip2
859 DO 100 j1=js1,jf1,jskip1
861 sum = sum + a(j1,j2,1)*b(i,1)
881 REAL A(LX1,LY1,LZ1,1)
888 CALL dsset(lx1,ly1,lz1)
889 iface = eface1(iface1)
890 js1 = skpdat(1,iface)
891 jf1 = skpdat(2,iface)
892 jskip1 = skpdat(3,iface)
893 js2 = skpdat(4,iface)
894 jf2 = skpdat(5,iface)
895 jskip2 = skpdat(6,iface)
898 DO 100 j2=js2,jf2,jskip2
899 DO 100 j1=js1,jf1,jskip1
901 fcarea = fcarea+area(i,1,iface1,iel)
902 xaver = xaver +area(i,1,iface1,iel)*a(j1,j2,1,iel)
920 dimension a(lx1,ly1,lz1),b(lx1,ly1)
924 CALL dsset(lx1,ly1,lz1)
925 iface = eface1(iface1)
926 js1 = skpdat(1,iface)
927 jf1 = skpdat(2,iface)
928 jskip1 = skpdat(3,iface)
929 js2 = skpdat(4,iface)
930 jf2 = skpdat(5,iface)
931 jskip2 = skpdat(6,iface)
934 DO 100 j2=js2,jf2,jskip2
935 DO 100 j1=js1,jf1,jskip1
937 a(j1,j2,1) = a(j1,j2,1)*b(i,1)
955 dimension a(lx1,ly1,lz1),b(lx1,ly1,lz1),c(lx1,ly1)
959 CALL dsset(lx1,ly1,lz1)
960 iface = eface1(iface1)
961 js1 = skpdat(1,iface)
962 jf1 = skpdat(2,iface)
963 jskip1 = skpdat(3,iface)
964 js2 = skpdat(4,iface)
965 jf2 = skpdat(5,iface)
966 jskip2 = skpdat(6,iface)
969 DO 100 j2=js2,jf2,jskip2
970 DO 100 j1=js1,jf1,jskip1
972 a(j1,j2,1) = b(j1,j2,1)*c(i,1)
990 dimension a(lx1,ly1,lz1),b(lx1,ly1,lz1),c(lx1,ly1)
994 CALL dsset(lx1,ly1,lz1)
995 iface = eface1(iface1)
996 js1 = skpdat(1,iface)
997 jf1 = skpdat(2,iface)
998 jskip1 = skpdat(3,iface)
999 js2 = skpdat(4,iface)
1000 jf2 = skpdat(5,iface)
1001 jskip2 = skpdat(6,iface)
1004 DO 100 j2=js2,jf2,jskip2
1005 DO 100 j1=js1,jf1,jskip1
1007 a(j1,j2,1) = a(j1,j2,1) + b(j1,j2,1)*c(i,1)
1027 nel = nelfld(ifield)
1028 ntot1 = lx1*ly1*lz1*nel
1032 call copy (h1,vdiff(1,1,1,1,ifield),ntot1)
1033 if (intloc.eq.0)
then
1034 call rzero (h2,ntot1)
1036 call cmult2 (h2,vtrans(1,1,1,1,ifield),dtbd,ntot1)
1045 CALL copy (h1,vdiff(1,1,1,1,ifield),ntot1)
1046 CALL rzero (h2,ntot1)
1069 if (optlevel.le.2)
CALL nekasgn (i,j,k,iel)
1070 CALL uservp (i,j,k,ielg)
1071 vdiff(i,j,k,iel,ifield) = udiff
1072 vtrans(i,j,k,iel,ifield) = utrans
1085 common /fastmd/ ifdfrm(lelt), iffast(lelt), ifh2, ifsolv
1086 logical ifdfrm, iffast, ifh2, ifsolv
1093 subroutine hmhzsf (name,u1,u2,u3,r1,r2,r3,h1,h2,
1094 $ rmask1,rmask2,rmask3,rmult,
1108 real u1(1),u2(1),u3(1),r1(1),r2(1),r3(1),h1(1),h2(1)
1109 real rmask1(1),rmask2(1),rmask3(1),rmult(1)
1117 nel = nelfld(ifield)
1118 vol = volfld(ifield)
1123 if (ifprojfld(ifield)) iproj = param(94)
1124 if (iproj.gt.0.and.istep.ge.iproj) napproxstrs(1)=param(93)
1125 napproxstrs(1)=min(napproxstrs(1),mxprev)
1127 call rmask (r1,r2,r3,nel)
1131 if (imesh.eq.1)
then
1132 call chktcgs (r1,r2,r3,rmask1,rmask2,rmask3,rmult,binvm1
1137 call cggosf (u1,u2,u3,r1,r2,r3,h1,h2,rmult,binvm1
1138 $ ,vol,tol,maxit,matmod)
1144 call chktcgs (r1,r2,r3,rmask1,rmask2,rmask3,rmult,bintm1
1146 call cggosf (u1,u2,u3,r1,r2,r3,h1,h2,rmult,bintm1
1147 $ ,vol,tol,maxit,matmod)
1158 subroutine chktcgs (r1,r2,r3,rmask1,rmask2,rmask3,rmult,binv,
1171 common /cprint/ ifprint
1173 common /ctmp0/ wa(lx1,ly1,lz1,lelt)
1175 dimension r1(lx1,ly1,lz1,1)
1176 $ , r2(lx1,ly1,lz1,1)
1177 $ , r3(lx1,ly1,lz1,1)
1178 $ , rmask1(lx1,ly1,lz1,1)
1179 $ , rmask2(lx1,ly1,lz1,1)
1180 $ , rmask3(lx1,ly1,lz1,1)
1181 $ , rmult(lx1,ly1,lz1,1)
1182 $ , binv(lx1,ly1,lz1,1)
1184 ntot1 = lx1*ly1*lz1*nel
1186 IF (eigaa .NE. 0.0)
THEN
1187 acondno = eigga/eigaa
1198 IF (diff .EQ. 0.0) eps = 1.0e-6
1199 IF (diff .GT. 0.0) eps = 1.0e-13
1201 CALL opdot (wa,r1,r2,r3,r1,r2,r3,ntot1)
1202 rinit =
glsc3(wa,binv,rmult,ntot1)
1203 rinit = sqrt(rinit/vol)
1206 IF (tol.LT.rmin)
THEN
1214 CALL add3 (wa,rmask1,rmask2,ntot1)
1216 CALL add4 (wa,rmask1,rmask2,rmask3,ntot1)
1218 bcneu1 =
glsc2(wa,rmult,ntot1)
1219 bcneu2 = (ldim) *
glsum(rmult,ntot1)
1220 bctest = abs(bcneu1 - bcneu2)
1221 IF (bctest .LT. 0.1)
THEN
1223 CALL add3 (wa,r1,r2,ntot1)
1225 CALL add4 (wa,r1,r2,r3,ntot1)
1227 otr =
glsc2(wa,rmult,ntot1) / ( ldim )
1228 tolmin = abs(otr) * acondno
1229 IF (tol .LT. tolmin)
THEN
1240 subroutine axhmsf (au1,au2,au3,u1,u2,u3,h1,h2,matmod)
1255 common /fastmd/ ifdfrm(lelt), iffast(lelt), ifh2, ifsolv
1256 logical ifdfrm, iffast, ifh2, ifsolv
1258 dimension au1(lx1,ly1,lz1,1)
1259 $ , au2(lx1,ly1,lz1,1)
1260 $ , au3(lx1,ly1,lz1,1)
1261 $ , u1(lx1*ly1*lz1*1)
1262 $ , u2(lx1*ly1*lz1*1)
1263 $ , u3(lx1*ly1*lz1*1)
1264 $ , h1(lx1,ly1,lz1,1)
1265 $ , h2(lx1,ly1,lz1,1)
1270 nel = nelfld(ifield)
1271 ntot1 = lx1*ly1*lz1*nel
1282 if (matmod.lt.0) icase=2
1284 if (matmod.lt.0) icase=1
1285 if (.not.ifstrs) icase=3
1287 if (icase.eq.1)
then
1289 call axsf_fast(au1,au2,au3,u1,u2,u3,h1,h2,ifield)
1291 elseif (icase.eq.3)
then
1293 call axhelm(au1,u1,h1,h2,1,1)
1294 call axhelm(au2,u2,h1,h2,1,2)
1295 if (if3d)
call axhelm(au3,u3,h1,h2,1,3)
1299 if ( .not.ifsolv )
call setfast (h1,h2,imesh)
1301 call stnrate (u1,u2,u3,nel,matmod)
1302 call stress (h1,h2,nel,matmod,ifaxis)
1303 call aijuj (au1,au2,au3,nel,ifaxis)
1305 if (ifh2 .and. matmod.ge.0)
then
1306 call addcol4 (au1,bm1,h2,u1,ntot1)
1307 call addcol4 (au2,bm1,h2,u2,ntot1)
1308 if (ldim.eq.3)
call addcol4 (au3,bm1,h2,u3,ntot1)
1329 common /ctmp0/ exz(lx1*ly1*lz1*lelt)
1330 $ , eyz(lx1*ly1*lz1*lelt)
1331 common /ctmp1/ exx(lx1*ly1*lz1*lelt)
1332 $ , exy(lx1*ly1*lz1*lelt)
1333 $ , eyy(lx1*ly1*lz1*lelt)
1334 $ , ezz(lx1*ly1*lz1*lelt)
1336 dimension u1(lx1,ly1,lz1,1)
1337 $ , u2(lx1,ly1,lz1,1)
1338 $ , u3(lx1,ly1,lz1,1)
1340 ntot1 = lx1*ly1*lz1*nel
1342 CALL rzero3 (exx,eyy,ezz,ntot1)
1343 CALL rzero3 (exy,exz,eyz,ntot1)
1345 CALL uxyz (u1,exx,exy,exz,nel)
1346 CALL uxyz (u2,exy,eyy,eyz,nel)
1347 IF (ldim.EQ.3)
CALL uxyz (u3,exz,eyz,ezz,nel)
1349 CALL invcol2 (exx,jacm1,ntot1)
1350 CALL invcol2 (exy,jacm1,ntot1)
1351 CALL invcol2 (eyy,jacm1,ntot1)
1353 IF (ifaxis)
CALL axiezz (u2,eyy,ezz,nel)
1356 CALL invcol2 (exz,jacm1,ntot1)
1357 CALL invcol2 (eyz,jacm1,ntot1)
1358 CALL invcol2 (ezz,jacm1,ntot1)
1372 common /ctmp1/ txx(lx1,ly1,lz1,lelt)
1373 $ , txy(lx1,ly1,lz1,lelt)
1374 $ , tyy(lx1,ly1,lz1,lelt)
1375 $ , tzz(lx1,ly1,lz1,lelt)
1376 common /ctmp0/ txz(lx1,ly1,lz1,lelt)
1377 $ , tyz(lx1,ly1,lz1,lelt)
1378 common /scrsf/ t11(lx1,ly1,lz1,lelt)
1379 $ , t22(lx1,ly1,lz1,lelt)
1380 $ , t33(lx1,ly1,lz1,lelt)
1381 $ , hii(lx1,ly1,lz1,lelt)
1383 dimension h1(lx1,ly1,lz1,1),h2(lx1,ly1,lz1,1)
1386 NTOT1 = lx1*ly1*lz1*nel
1388 IF (matmod.EQ.0)
THEN
1393 CALL cmult2 (hii,h1,const,ntot1)
1394 CALL col2 (txx,hii,ntot1)
1395 CALL col2 (txy,h1 ,ntot1)
1396 CALL col2 (tyy,hii,ntot1)
1397 IF (ifaxis .OR. ldim.EQ.3)
CALL col2 (tzz,hii,ntot1)
1399 CALL col2 (txz,h1 ,ntot1)
1400 CALL col2 (tyz,h1 ,ntot1)
1403 ELSEIF (matmod.EQ.-1)
THEN
1408 CALL add3s (hii,h1,h2,const,ntot1)
1409 CALL copy (t11,txx,ntot1)
1410 CALL copy (t22,tyy,ntot1)
1411 CALL col3 (txx,hii,t11,ntot1)
1412 CALL addcol3 (txx,h1 ,t22,ntot1)
1413 CALL col3 (tyy,h1 ,t11,ntot1)
1414 CALL addcol3 (tyy,hii,t22,ntot1)
1415 CALL col2 (txy,h2 ,ntot1)
1416 IF (ifaxis .OR. ldim.EQ.3)
THEN
1417 CALL copy (t33,tzz,ntot1)
1418 CALL col3 (tzz,h1 ,t11,ntot1)
1419 CALL addcol3 (tzz,h1 ,t22,ntot1)
1420 CALL addcol3 (tzz,hii,t33,ntot1)
1421 CALL addcol3 (txx,h1 ,t33,ntot1)
1422 CALL addcol3 (tyy,h1 ,t33,ntot1)
1425 CALL col2 (txz,h2 ,ntot1)
1426 CALL col2 (tyz,h2 ,ntot1)
1434 subroutine aijuj (au1,au2,au3,nel,ifaxis)
1437 common /ctmp1/ txx(lx1,ly1,lz1,lelt)
1438 $ , txy(lx1,ly1,lz1,lelt)
1439 $ , tyy(lx1,ly1,lz1,lelt)
1440 $ , tzz(lx1,ly1,lz1,lelt)
1441 common /ctmp0/ txz(lx1,ly1,lz1,lelt)
1442 $ , tyz(lx1,ly1,lz1,lelt)
1444 dimension au1(lx1,ly1,lz1,1)
1445 $ , au2(lx1,ly1,lz1,1)
1446 $ , au3(lx1,ly1,lz1,1)
1449 CALL ttxyz (au1,txx,txy,txz,nel)
1450 CALL ttxyz (au2,txy,tyy,tyz,nel)
1451 IF (ifaxis)
CALL axitzz (au2,tzz,nel)
1452 IF (ldim.EQ.3)
CALL ttxyz (au3,txz,tyz,tzz,nel)
1461 common /scrsf/ ur(lx1,ly1,lz1,lelt)
1462 $ , us(lx1,ly1,lz1,lelt)
1463 $ , ut(lx1,ly1,lz1,lelt)
1465 dimension u(lx1,ly1,lz1,1)
1466 $ , ex(lx1,ly1,lz1,1)
1467 $ , ey(lx1,ly1,lz1,1)
1468 $ , ez(lx1,ly1,lz1,1)
1470 ntot1 = lx1*ly1*lz1*nel
1472 CALL urst (u,ur,us,ut,nel)
1474 CALL addcol3 (ex,rxm1,ur,ntot1)
1475 CALL addcol3 (ex,sxm1,us,ntot1)
1476 CALL addcol3 (ey,rym1,ur,ntot1)
1477 CALL addcol3 (ey,sym1,us,ntot1)
1480 CALL addcol3 (ez,rzm1,ur,ntot1)
1481 CALL addcol3 (ez,szm1,us,ntot1)
1482 CALL addcol3 (ez,tzm1,ut,ntot1)
1483 CALL addcol3 (ex,txm1,ut,ntot1)
1484 CALL addcol3 (ey,tym1,ut,ntot1)
1495 dimension u(lx1,ly1,lz1,1)
1496 $ , ur(lx1,ly1,lz1,1)
1497 $ , us(lx1,ly1,lz1,1)
1498 $ , ut(lx1,ly1,lz1,1)
1501 IF (ifaxis)
CALL setaxdy ( ifrzer(iel) )
1502 CALL ddrst (u(1,1,1,iel),ur(1,1,1,iel),
1503 $ us(1,1,1,iel),ut(1,1,1,iel))
1513 dimension u(lx1,ly1,lz1)
1521 CALL mxm (dxm1,lx1,u,lx1,ur,nyz1)
1523 CALL mxm (u,lx1,dytm1,ly1,us,ly1)
1526 CALL mxm (u(1,1,iz),lx1,dytm1,ly1,us(1,1,iz),ly1)
1528 CALL mxm (u,nxy1,dztm1,lz1,ut,lz1)
1538 dimension u2(lx1,ly1,lz1,1)
1539 $ , eyy(lx1,ly1,lz1,1)
1540 $ , ezz(lx1,ly1,lz1,1)
1545 IF ( ifrzer(iel) )
THEN
1547 ezz(ix, 1,1,iel) = eyy(ix,1,1,iel)
1549 ezz(ix,iy,1,iel) = u2(ix,iy,1,iel) / ym1(ix,iy,1,iel)
1552 CALL invcol3 (ezz(1,1,1,iel),u2(1,1,1,iel),ym1(1,1,1,iel),
1578 real x(lx1,ly1,lz1,1)
1585 call dsset(lx1,ly1,lz1)
1589 jskip1 = skpdat(3,fd)
1592 jskip2 = skpdat(6,fd)
1595 do j2=js2,jf2,jskip2
1596 do j1=js1,jf1,jskip1
1598 xsum = xsum+area(i,1,f,e)*x(j1,j2,1,e)
1599 asum = asum+area(i,1,f,e)
1622 if (cbc(f,e,ifld).eq.bc_in)
then
1623 call fcsum2(usum_f,asum_f,u,e,f)
1624 usum = usum + usum_f
1625 asum = asum + asum_f
1630 usum =
glsum(usum,1)
1631 asum =
glsum(asum,1)
1637 if (asum.gt.0) ierr = 0
1646 common /ctmp0/ w(lx1,ly1,lz1)
1652 real z(lx1,ly1,lz1,1)
1653 real r(lx1,ly1,lz1,1)
1654 real d(lx1,ly1,lz1,1)
1655 real rr(lx1,ly1,lz1,1)
1669 call col3(rr,r,bhalf,n)
1679 call mxm(fdst(1,kt(ie,1)),n1,rr(1,1,1,ie),n1,w,n2)
1681 call mxm(w(1,1,iz),n1,fds(1,kt(ie,2)),n1,z(1,1,iz,ie),n1)
1683 call mxm(z(1,1,1,ie),n2,fds(1,kt(ie,3)),n1,w,n1)
1687 call col2(w,d(1,1,1,ie),n3)
1691 call mxm(w,n2,fdst(1,kt(ie,3)),n1,z(1,1,1,ie),n1)
1693 call mxm(z(1,1,iz,ie),n1,fdst(1,kt(ie,2)),n1,w(1,1,iz),n1)
1695 call mxm(fds(1,kt(ie,1)),n1,w,n1,z(1,1,1,ie),n2)
1699 call mxm(fdst(1,kt(ie,1)),n1,rr(1,1,1,ie),n1,w,n1)
1700 call mxm(w,n1,fds(1,kt(ie,2)),n1,z(1,1,1,ie),n1)
1704 call col2(z(1,1,1,ie),d(1,1,1,ie),n2)
1708 call mxm(z(1,1,1,ie),n1,fdst(1,kt(ie,2)),n1,w,n1)
1709 call mxm(fds(1,kt(ie,1)),n1,w,n1,z(1,1,1,ie),n1)
1714 if (ifbhalf)
call col2(z,bhalf,n)
1716 call dssum(z,lx1,ly1,lz1)
1729 integer*8 glo_num(1),ngv
1730 integer vertex(1),nx
1733 common /ctmp0/ gnum(lx1*ly1*lz1*lelt)
1736 call set_vert(gnum,ngv,nx,nel,vertex,ifcenter)
1747 glo_num(k+j) = ldim*(gnum(i)-1) + j
1761 real mask(ldim,nxc,nxc,nzc,nel)
1770 k = 1 + ((lx1-1)*(kc-1))/(nxc-1)
1771 j = 1 + ((lx1-1)*(jc-1))/(nxc-1)
1772 i = 1 + ((lx1-1)*(ic-1))/(nxc-1)
1773 mask(1,ic,jc,kc,e) = v1mask(i,j,k,e)
1774 mask(2,ic,jc,kc,e) = v2mask(i,j,k,e)
1775 mask(3,ic,jc,kc,e) = v3mask(i,j,k,e)
1784 j = 1 + ((lx1-1)*(jc-1))/(nxc-1)
1785 i = 1 + ((lx1-1)*(ic-1))/(nxc-1)
1786 mask(1,ic,jc,1,e) = v1mask(i,j,1,e)
1787 mask(2,ic,jc,1,e) = v2mask(i,j,1,e)
1796 subroutine axstrs(a1,a2,a3,p1,p2,p3,h1,h2,matmod,nel)
1797 real a1(1),a2(1),a3(1),p1(1),p2(1),p3(1)
1799 call axhmsf (a1,a2,a3,p1,p2,p3,h1,h2,matmod)
1800 call rmask (a1,a2,a3,nel)
1807 real a1(1),a2(1),a3(1),p1(1),p2(1),p3(1)
1809 call rmask (p1,p2,p3,nel)
1810 call axhmsf (a1,a2,a3,p1,p2,p3,h1,h2,matmod)
1811 call rmask (a1,a2,a3,nel)
1827 real a(ldim,ncl,ldim,ncl,1),h1(1),h2(1)
1830 common /scrcr2/ a1(lx1*ly1*lz1,lelt),w1(lx1*ly1*lz1,lelt)
1831 $ , a2(lx1*ly1*lz1,lelt),w2(lx1*ly1*lz1,lelt)
1832 common /scrcr3/ a3(lx1*ly1*lz1,lelt),w3(lx1*ly1*lz1,lelt)
1833 $ , b(lx1*ly1*lz1,8)
1837 nel = nelfld(ifield)
1851 if (k.eq.1)
call copy(w1(1,e),b(1,j),nxyz)
1852 if (k.eq.2)
call copy(w2(1,e),b(1,j),nxyz)
1853 if (k.eq.3)
call copy(w3(1,e),b(1,j),nxyz)
1856 call axstrs_nds(a1,a2,a3,w1,w2,w3,h1,h2,matmod,nel)
1861 a(1,i,k,j,e)=
vlsc2(b(1,i),a1(1,e),nxyz)
1862 a(2,i,k,j,e)=
vlsc2(b(1,i),a2(1,e),nxyz)
1864 $ a(3,i,k,j,e)=
vlsc2(b(1,i),a3(1,e),nxyz)
1886 real u1(1),u2(1),u3(1),v1(1),v2(1),v3(1)
1888 common /scrpr3/ uc1(lcr*lelt),uc2(lcr*lelt),uc3(lcr*lelt)
1889 common /scrpr2/ vc1(lcr*lelt),vc2(lcr*lelt),vc3(lcr*lelt)
1896 if (icalld1.eq.0)
then
1903 n = nelv*lx1*ly1*lz1
1927 call fgslib_crs_solve(xxth_strs,uc1,vc1)
1960 common /nekmpi/ mid,mp,nekcomm,nekgroup,nekreal
1962 common /ivrtx/ vertex((2**ldim)*lelt)
1965 integer null_space,e
1968 common /scrxxti/ ia(ldim*ldim*lcr*lcr*lelv)
1969 $ , ja(ldim*ldim*lcr*lcr*lelv)
1971 parameter(lcc=2**ldim)
1972 common /scrcr1/ a(ldim*ldim*lcc*lcc*lelt)
1973 real mask(ldim,lcr,lelv)
1974 equivalence (mask,a)
2009 $
write(6,*)
'start:: setup h1 coarse grid ',t1,
' sec'
2013 write(44,44) ia(i),ja(i),a(i)
2015 44
format(2i9,1pe22.13)
2019 call fgslib_crs_setup(xxth_strs,imode,nekcomm,mp,n,se_to_gcrs,
2020 $ nnz,ia,ja,a,null_space)
2024 write(6,*)
'done :: setup h1 coarse grid ',t0,
' sec',xxth_strs
2040 real au(1),av(1),aw(1),u(1),v(1),w(1),h1(1),h2(1)
2042 parameter(l=lx1*ly1*lz1)
2043 real ur(l,ldim,ldim)
2051 call local_grad3(ur(1,1,1),ur(1,2,1),ur(1,3,1),u,p,1,dxm1,dxtm1)
2052 call local_grad3(ur(1,1,2),ur(1,2,2),ur(1,3,2),v,p,1,dxm1,dxtm1)
2053 call local_grad3(ur(1,1,3),ur(1,2,3),ur(1,3,3),w,p,1,dxm1,dxtm1)
2057 u1 = ur(i,1,1)*rxm1(i,1,1,e) + ur(i,2,1)*sxm1(i,1,1,e)
2058 $ + ur(i,3,1)*txm1(i,1,1,e)
2059 u2 = ur(i,1,1)*rym1(i,1,1,e) + ur(i,2,1)*sym1(i,1,1,e)
2060 $ + ur(i,3,1)*tym1(i,1,1,e)
2061 u3 = ur(i,1,1)*rzm1(i,1,1,e) + ur(i,2,1)*szm1(i,1,1,e)
2062 $ + ur(i,3,1)*tzm1(i,1,1,e)
2064 v1 = ur(i,1,2)*rxm1(i,1,1,e) + ur(i,2,2)*sxm1(i,1,1,e)
2065 $ + ur(i,3,2)*txm1(i,1,1,e)
2066 v2 = ur(i,1,2)*rym1(i,1,1,e) + ur(i,2,2)*sym1(i,1,1,e)
2067 $ + ur(i,3,2)*tym1(i,1,1,e)
2068 v3 = ur(i,1,2)*rzm1(i,1,1,e) + ur(i,2,2)*szm1(i,1,1,e)
2069 $ + ur(i,3,2)*tzm1(i,1,1,e)
2071 w1 = ur(i,1,3)*rxm1(i,1,1,e) + ur(i,2,3)*sxm1(i,1,1,e)
2072 $ + ur(i,3,3)*txm1(i,1,1,e)
2073 w2 = ur(i,1,3)*rym1(i,1,1,e) + ur(i,2,3)*sym1(i,1,1,e)
2074 $ + ur(i,3,3)*tym1(i,1,1,e)
2075 w3 = ur(i,1,3)*rzm1(i,1,1,e) + ur(i,2,3)*szm1(i,1,1,e)
2076 $ + ur(i,3,3)*tzm1(i,1,1,e)
2078 dj = h1(i)*w3m1(i,1,1)*jacmi(i,e)
2091 ur(i,1,1)=rxm1(i,1,1,e)*s11+rym1(i,1,1,e)*s12+rzm1(i,1,1,e)*s13
2092 ur(i,2,1)=sxm1(i,1,1,e)*s11+sym1(i,1,1,e)*s12+szm1(i,1,1,e)*s13
2093 ur(i,3,1)=txm1(i,1,1,e)*s11+tym1(i,1,1,e)*s12+tzm1(i,1,1,e)*s13
2095 ur(i,1,2)=rxm1(i,1,1,e)*s21+rym1(i,1,1,e)*s22+rzm1(i,1,1,e)*s23
2096 ur(i,2,2)=sxm1(i,1,1,e)*s21+sym1(i,1,1,e)*s22+szm1(i,1,1,e)*s23
2097 ur(i,3,2)=txm1(i,1,1,e)*s21+tym1(i,1,1,e)*s22+tzm1(i,1,1,e)*s23
2099 ur(i,1,3)=rxm1(i,1,1,e)*s31+rym1(i,1,1,e)*s32+rzm1(i,1,1,e)*s33
2100 ur(i,2,3)=sxm1(i,1,1,e)*s31+sym1(i,1,1,e)*s32+szm1(i,1,1,e)*s33
2101 ur(i,3,3)=txm1(i,1,1,e)*s31+tym1(i,1,1,e)*s32+tzm1(i,1,1,e)*s33
2105 $ (au,ur(1,1,1),ur(1,2,1),ur(1,3,1),p,1,dxm1,dxtm1,av)
2107 $ (av,ur(1,1,2),ur(1,2,2),ur(1,3,2),p,1,dxm1,dxtm1,ur)
2109 $ (aw,ur(1,1,3),ur(1,2,3),ur(1,3,3),p,1,dxm1,dxtm1,ur)
2112 au(i)=au(i) + h2(i)*bm1(i,1,1,e)*u(i)
2113 av(i)=av(i) + h2(i)*bm1(i,1,1,e)*v(i)
2114 aw(i)=aw(i) + h2(i)*bm1(i,1,1,e)*w(i)
2129 real au(1),av(1),u(1),v(1),h1(1),h2(1)
2131 parameter(l=lx1*ly1*lz1)
2132 real ur(l,ldim,ldim)
2140 call local_grad2(ur(1,1,1),ur(1,2,1),u,p,1,dxm1,dxtm1)
2141 call local_grad2(ur(1,1,2),ur(1,2,2),v,p,1,dxm1,dxtm1)
2144 dj = h1(i)*w3m1(i,1,1)*jacmi(i,e)
2146 u1 = ur(i,1,1)*rxm1(i,1,1,e) + ur(i,2,1)*sxm1(i,1,1,e)
2147 u2 = ur(i,1,1)*rym1(i,1,1,e) + ur(i,2,1)*sym1(i,1,1,e)
2148 v1 = ur(i,1,2)*rxm1(i,1,1,e) + ur(i,2,2)*sxm1(i,1,1,e)
2149 v2 = ur(i,1,2)*rym1(i,1,1,e) + ur(i,2,2)*sym1(i,1,1,e)
2151 s11 = dj*( u1 + u1 )
2152 s12 = dj*( u2 + v1 )
2153 s21 = dj*( v1 + u2 )
2154 s22 = dj*( v2 + v2 )
2158 ur(i,1,1)=rxm1(i,1,1,e)*s11+rym1(i,1,1,e)*s12
2159 ur(i,2,1)=sxm1(i,1,1,e)*s11+sym1(i,1,1,e)*s12
2161 ur(i,1,2)=rxm1(i,1,1,e)*s21+rym1(i,1,1,e)*s22
2162 ur(i,2,2)=sxm1(i,1,1,e)*s21+sym1(i,1,1,e)*s22
2166 call local_grad2_t(au,ur(1,1,1),ur(1,2,1),p,1,dxm1,dxtm1,av)
2167 call local_grad2_t(av,ur(1,1,2),ur(1,2,2),p,1,dxm1,dxtm1,ur)
2170 au(i)=au(i) + h2(i)*bm1(i,1,1,e)*u(i)
2171 av(i)=av(i) + h2(i)*bm1(i,1,1,e)*v(i)
2181 parameter(l=lx1*ly1*lz1)
2182 real au(l,1),av(l,1),aw(l,1),u(l,1),v(l,1),w(l,1),h1(l,1),h2(l,1)
2184 common /btmp0/ ur(l,ldim,ldim)
2192 call axsf_e_3d(au(1,e),av(1,e),aw(1,e),u(1,e),v(1,e),w(1,e)
2193 $ ,h1(1,e),h2(1,e),ur,e)
2197 call axsf_e_2d(au(1,e),av(1,e),u(1,e),v(1,e)
2198 $ ,h1(1,e),h2(1,e),ur,e)
2214 dimension tx(lx1,ly1,lz1,1)
2215 $ , ty(lx1,ly1,lz1,1)
2216 $ , tz(lx1,ly1,lz1,1)
2217 $ , ff(lx1*ly1*lz1,1)
2219 common /scrsf/ fr(lx1*ly1*lz1,lelt)
2220 $ , fs(lx1*ly1*lz1,lelt)
2221 $ , ft(lx1*ly1*lz1,lelt)
2222 real wa(lx1,ly1,lz1,lelt)
2229 CALL col3 (fr,rxm1,tx,ntot1)
2230 CALL addcol3 (fr,rym1,ty,ntot1)
2231 CALL col3 (fs,sxm1,tx,ntot1)
2232 CALL addcol3 (fs,sym1,ty,ntot1)
2235 CALL addcol3 (fr,rzm1,tz,ntot1)
2236 CALL addcol3 (fs,szm1,tz,ntot1)
2237 CALL col3 (ft,txm1,tx,ntot1)
2238 CALL addcol3 (ft,tym1,ty,ntot1)
2239 CALL addcol3 (ft,tzm1,tz,ntot1)
2244 IF ( ifrzer(iel) )
THEN
2245 CALL mxm (ym1(1,1,1,iel),lx1,datm1,ly1,ys,1)
2248 wa(ix,iy,1,iel)=ys(ix)*w2am1(ix,iy)
2250 dnr = 1.0 + zam1(iy)
2251 wa(ix,iy,1,iel)=ym1(ix,iy,1,iel)*w2am1(ix,iy)/dnr
2254 CALL col3 (wa(1,1,1,iel),ym1(1,1,1,iel),w2cm1,nxyz1)
2257 CALL col2 (fr,wa,ntot1)
2258 CALL col2 (fs,wa,ntot1)
2261 call col2(fr(1,iel),w3m1,nxyz1)
2262 call col2(fs(1,iel),w3m1,nxyz1)
2263 call col2(ft(1,iel),w3m1,nxyz1)
2269 IF (ifaxis)
CALL setaxdy ( ifrzer(iel) )
2270 CALL ttrst (ff(1,iel),fr(1,iel),fs(1,iel),
2271 $ ft(1,iel),fr(1,iel))
2283 dimension ff(lx1,ly1,lz1)
2293 CALL mxm (dxtm1,lx1,fr,lx1,ff,nyz1)
2295 CALL mxm (fs,lx1,dym1,ly1,ta,ly1)
2296 CALL add2 (ff,ta,nxyz1)
2299 CALL mxm (fs(1,1,iz),lx1,dym1,ly1,ta(1,1,iz),ly1)
2301 CALL add2 (ff,ta,nxyz1)
2302 CALL mxm (ft,nxy1,dzm1,lz1,ta,lz1)
2303 CALL add2 (ff,ta,nxyz1)
2315 common /ctmp0/ phi(lx1,ly1)
2317 dimension vfy(lx1,ly1,lz1,1)
2318 $ , tzz(lx1,ly1,lz1,1)
2324 CALL col4 (phi,tzz(1,1,1,iel),jacm1(1,1,1,iel),w3m1,nxyz1)
2325 IF ( ifrzer(iel) )
THEN
2328 dnr = phi(ix,iy)/( 1.0 + zam1(iy) )
2329 dds = wxm1(ix) * wam1(1) * datm1(iy,1) *
2330 $ jacm1(ix,1,1,iel) * tzz(ix,1,1,iel)
2331 vfy(ix,iy,1,iel)=vfy(ix,iy,1,iel) + dnr + dds
2334 CALL add2 (vfy(1,1,1,iel),phi,nxyz1)
2349 CALL copy (dym1 ,dam1 ,ly1*ly1)
2350 CALL copy (dytm1,datm1,ly1*ly1)
2352 CALL copy (dym1 ,dcm1 ,ly1*ly1)
2353 CALL copy (dytm1,dctm1,ly1*ly1)
2363 real v1(1) , v2(1), v3(1), w(1)
2367 if(if3d) s=s+
vlsc3(v3,w,v3,n)
2370 if (s.gt.0) s=sqrt(s/volvm1)
2385 real b1(1),b2(1),b3(1),h1(1),h2(1),wt(1)
2386 common /ctmp1/ w(lx1*ly1*lz1*lelt,ldim)
2389 kmax = napproxstrs(1)
2391 n = lx1*ly1*lz1*nelv
2394 if (k.eq.0.or.kmax.eq.0)
return
2402 dh1max=
difmax(bstrs(1 ),h1,n)
2403 call col3(bstrs,h2,bm1,n)
2404 dh2max=
difmax(bstrs(1+n),bstrs,n)
2406 if (dh1max.gt.0.or.dh2max.gt.0)
then
2416 call opcopy(bstrs(1),bstrs(1+n),bstrs(1+2*n),b1,b2,b3)
2417 call opzero(xstrs(1),xstrs(1+n),xstrs(1+2*n))
2420 i1 = 1 + 0*n + (i-1)*m + m
2421 i2 = 1 + 1*n + (i-1)*m + m
2422 i3 = 1 + 2*n + (i-1)*m + m
2423 alpha=
op_glsc2_wt(bstrs(1),bstrs(1+n),bstrs(1+2*n)
2424 $ ,xstrs(i1),xstrs(i2),xstrs(i3),wt)
2427 call opadds(bstrs(1),bstrs(1+n),bstrs(1+2*n)
2428 $ ,bstrs(i1),bstrs(i2),bstrs(i3),alphm,n,2)
2430 call opadds(xstrs(1),xstrs(1+n),xstrs(1+2*n)
2431 $ ,xstrs(i1),xstrs(i2),xstrs(i3),alpha,n,2)
2436 call opcopy(b1,b2,b3,bstrs(1),bstrs(1+n),bstrs(1+2*n))
2439 call copy(bstrs(1 ),h1,n)
2440 call col3(bstrs(1+n),bm1,h2,n)
2443 if (nio.eq.0)
write(6,1) istep,
' Project ' //
'HELM3 ',
2444 $ l2a,l2b,ratio,k,kmax
2445 1
format(i11,a,6x,1p3e13.4,i4,i4)
2463 real x1(1),x2(1),x3(1),h1(1),h2(1),wt(1)
2464 common /cptst/ xs(lx1*ly1*lz1*lelt*ldim)
2466 kmax = napproxstrs(1)
2468 n = lx1*ly1*lz1*nelv
2471 if (kmax.eq.0)
return
2476 call opadd2(x1,x2,x3,xstrs(1),xstrs(1+n),xstrs(1+2*n))
2478 k1 = 1 + 0*n + (k-1)*m + m
2479 k2 = 1 + 1*n + (k-1)*m + m
2480 k3 = 1 + 2*n + (k-1)*m + m
2481 call opcopy(xstrs(k1),xstrs(k2),xstrs(k3),x1,x2,x3)
2482 elseif (k.eq.kmax)
then
2483 call opadd2(x1,x2,x3,xstrs(1),xstrs(1+n),xstrs(1+2*n))
2485 k1 = 1 + 0*n + (k-1)*m + m
2486 k2 = 1 + 1*n + (k-1)*m + m
2487 k3 = 1 + 2*n + (k-1)*m + m
2488 call opcopy(xstrs(k1),xstrs(k2),xstrs(k3),x1,x2,x3)
2496 k1 = 1 + 0*n + (k-1)*m + m
2497 k2 = 1 + 1*n + (k-1)*m + m
2498 k3 = 1 + 2*n + (k-1)*m + m
2499 call opcopy(xstrs(k1),xstrs(k2),xstrs(k3),x1,x2,x3)
2500 call opadd2(x1,x2,x3,xstrs(1),xstrs(1+n),xstrs(1+2*n))
2512 subroutine strs_orthok(x,b,n,k,h1,h2,wt,ifld,w,ierr,matmod)
2519 real x(n,ldim,k),b(n,ldim,k),h1(n),h2(n),wt(n),w(n,ldim)
2520 real al(mxprev),bt(mxprev)
2525 call axhmsf (b(1,1,k),b(1,2,k),b(1,3,k)
2526 $ ,x(1,1,k),x(1,2,k),x(1,3,k),h1,h2,matmod)
2527 call rmask (b(1,1,k),b(1,2,k),b(1,3,k),nel)
2528 call opdssum (b(1,1,k),b(1,2,k),b(1,3,k))
2531 $ ,x(1,1,k),x(1,2,k),x(1,3,k),wt)
2534 if (xax0.le.0.and.nio.eq.0)
write(6,*)istep,ierr,k,xax0,
'Proj3 ERR'
2535 if (xax0.le.0)
return
2541 $ ,x(1,1,k),x(1,2,k),x(1,3,k),wt)
2543 $ ,x(1,1,j),x(1,2,j),x(1,3,j),wt))/2.
2544 betam = -
glsum(betaj,1)
2545 call add2s2 (x(1,1,k),x(1,1,j),betam,m)
2546 call add2s2 (b(1,1,k),b(1,1,j),betam,m)
2554 $ ,x(1,1,k),x(1,2,k),x(1,3,k),wt)
2559 if (
scale/xax0.lt.eps) ierr=1
2566 if (
scale.gt.0)
then
2577 subroutine strs_ortho_one(x,b,n,k,h1,h2,wt,ifld,w,ierr,matmod)
2582 real x(n,ldim,k),b(n,ldim,k),h1(n),h2(n),wt(n),w(n,ldim)
2588 if (js.lt.j)
call copy(x(1,1,js),x(1,1,j),m)
2589 call strs_orthok(x,b,n,js,h1,h2,wt,ifld,w,ierr,matmod)
2590 if (ierr.eq.0) js=js+1
2597 subroutine strs_ortho_all(x,b,n,k,h1,h2,wt,ifld,w,ierr,matmod)
2602 real x(n,ldim,k),b(n,ldim,k),h1(n),h2(n),wt(n),w(n,ldim)
2608 if (js.lt.j)
call copy(x(1,1,js),x(1,1,j),m)
2609 call strs_orthok(x,b,n,js,h1,h2,wt,ifld,w,ierr,matmod)
2610 if (ierr.eq.0) js=js+1
2630 common /screv/ sii(lx1,ly1,lz1,lelt),siii(lx1,ly1,lz1,lelt)
2632 if (nio.eq.0.and.loglevel.gt.2)
2633 $
write(6,*)
'setprop'
2636 if (icalld.eq.0) tspro=0.0
2644 IF (ifflow) mfield=1
2646 if (ifmhd) nfldt = nfield+1
2650 do ifield=mfield,nfldt
2651 if (idpss(ifield-1).eq.-1)
goto 100
subroutine setdrs(DRM1, DRTM1, DSM1, DSTM1, IFC)
subroutine faceis(CB, S, IEL, IFACE, NX, NY, NZ)
subroutine bcdirvc(V1, V2, V3, mask1, mask2, mask3)
subroutine nekasgn(ix, iy, iz, e)
subroutine rzero3(A, B, C, N)
subroutine facec2(A1, A2, B1, B2, IFC)
real *8 function dnekclock()
subroutine dsset(nx, ny, nz)
subroutine scale(xyzl, nl)
subroutine dssum(u, nx, ny, nz)
subroutine setfast(helm1, helm2, imesh)
subroutine axhelm(au, u, helm1, helm2, imesh, isd)
subroutine set_fdm_prec_h1b(d, h1, h2, nel)
subroutine set_fdm_prec_h1a
subroutine setprec(dpcm1, helm1, helm2, imsh, isd)
subroutine opzero(ux, uy, uz)
subroutine compute_cfl(cfl, u, v, w, dt)
subroutine col3(a, b, c, n)
subroutine invcol2(a, b, n)
real function difmax(a, b, n)
subroutine addcol3(a, b, c, n)
function glsc3(a, b, mult, n)
subroutine add2s2(a, b, c1, n)
real function vlmax(vec, n)
subroutine addcol4(a, b, c, d, n)
subroutine add3(a, b, c, n)
subroutine col4(a, b, c, d, n)
subroutine add4(a, b, c, d, n)
real function vlsc2(x, y, n)
subroutine cmult(a, const, n)
subroutine cfill(a, b, n)
subroutine invcol3(a, b, c, n)
real function vlmin(vec, n)
subroutine mxm(a, n1, b, n2, c, n3)
subroutine opdssum(a, b, c)
subroutine local_grad3_t(u, ur, us, ut, N, e, D, Dt, w)
subroutine opcopy(a1, a2, a3, b1, b2, b3)
subroutine opcolv(a1, a2, a3, c)
subroutine normvc(h1, semi, l2, linf, x1, x2, x3)
subroutine opadd2(a1, a2, a3, b1, b2, b3)
subroutine opsub3(a1, a2, a3, b1, b2, b3, c1, c2, c3)
subroutine local_grad2_t(u, ur, us, N, e, D, Dt, w)
subroutine normsc(h1, semi, l2, linf, x, imesh)
function vlsc3(X, Y, B, N)
subroutine local_grad2(ur, us, u, N, e, D, Dt)
subroutine local_grad3(ur, us, ut, u, N, e, D, Dt)
subroutine map_c_to_f_h1_bilin(uf, uc)
subroutine set_vert(glo_num, ngv, nx, nel, vertex, ifcenter)
subroutine map_f_to_c_h1_bilin(uc, uf)
subroutine gen_crs_basis(b, j)
subroutine set_mat_ij(ia, ja, n, ne)
subroutine set_jl_crs_mask(n, mask, se_to_gcrs)
subroutine faccl2(a, b, iface1)
subroutine strs_project_b(x1, x2, x3, h1, h2, wt, ifld, ierr)
subroutine ttrst(ff, fr, fs, ft, ta)
subroutine ddrst(u, ur, us, ut)
subroutine chktcgs(r1, r2, r3, rmask1, rmask2, rmask3, rmult, binv, vol, tol, nel)
subroutine axitzz(vfy, tzz, nel)
subroutine faddcl3(a, b, c, iface1)
subroutine strs_project_a(b1, b2, b3, h1, h2, wt, ifld, ierr, matmod)
subroutine axsf_e_3d(au, av, aw, u, v, w, h1, h2, ur, e)
subroutine fcsum2(xsum, asum, x, e, f)
subroutine axhmsf(au1, au2, au3, u1, u2, u3, h1, h2, matmod)
subroutine set_up_h1_crs_strs(h1, h2, ifld, matmod)
subroutine cvgnlps(ifconv)
subroutine cdxmin2(dtst, rhosig, iel, ifc, ifaxis)
subroutine get_strs_mask(mask, nxc, nzc, nel)
subroutine fcaver(xaver, a, iel, iface1)
subroutine axsf_e_2d(au, av, u, v, h1, h2, ur, e)
subroutine crs_strs(u1, u2, u3, v1, v2, v3)
function surf_mean(u, ifld, bc_in, ierr)
subroutine setaxdy(ifaxdy)
subroutine axstrs(a1, a2, a3, p1, p2, p3, h1, h2, matmod, nel)
subroutine chktmg(tol, res, w1, w2, mult, mask, imesh)
function facdot(A, B, IFACE1)
subroutine strs_orthok(x, b, n, k, h1, h2, wt, ifld, w, ierr, matmod)
subroutine axsf_fast(au, av, aw, u, v, w, h1, h2, ifld)
subroutine axstrs_nds(a1, a2, a3, p1, p2, p3, h1, h2, matmod, nel)
subroutine hmhzsf(name, u1, u2, u3, r1, r2, r3, h1, h2, rmask1, rmask2, rmask3, rmult, tol, maxit, matmod)
subroutine strs_ortho_one(x, b, n, k, h1, h2, wt, ifld, w, ierr, matmod)
function opnorm2w(v1, v2, v3, w)
subroutine stnrate(u1, u2, u3, nel, matmod)
subroutine get_local_crs_galerkin_strs(a, ncl, nxc, h1, h2, matmod)
subroutine faccl3(a, b, c, iface1)
subroutine aijuj(au1, au2, au3, nel, ifaxis)
subroutine uxyz(u, ex, ey, ez, nel)
subroutine strs_ortho_all(x, b, n, k, h1, h2, wt, ifld, w, ierr, matmod)
subroutine set_vert_strs(glo_num, ngv, nx, nel, vertex, ifcenter)
subroutine axiezz(u2, eyy, ezz, nel)
subroutine sethlm(h1, h2, intloc)
subroutine cdxmin3(dtst, rhosig, iel, ifc)
subroutine ttxyz(ff, tx, ty, tz, nel)
subroutine stress(h1, h2, nel, matmod, ifaxis)
subroutine fdm_h1a(z, r, d, nel, kt, rr)
subroutine cggosf(u1, u2, u3, r1, r2, r3, h1, h2, rmult, binv, vol, tin, maxit, matmod)
subroutine urst(u, ur, us, ut, nel)
subroutine cmult2(A, B, CONST, N)
subroutine opadds(A1, A2, A3, B1, B2, B3, CONST, N, ISC)
function op_glsc2_wt(b1, b2, b3, x1, x2, x3, wt)
subroutine facexv(A1, A2, A3, B1, B2, B3, IFACE1, IOP)
subroutine opdot(DP, A1, A2, A3, B1, B2, B3, N)
subroutine add3s(A, B, C, CONST, N)
function op_vlsc2_wt(b1, b2, b3, x1, x2, x3, wt)
subroutine setaxw1(IFAXWG)
subroutine facexs(A, B, IFACE1, IOP)
subroutine rmask(R1, R2, R3, NEL)