2 subroutine arcsrf(xml,yml,zml,nxl,nyl,nzl,ie,isid)
11 COMMON /ctmp1/ h(lx1,3,2),xcrved(lx1),ycrved(ly1),zcrved(lz1)
12 $ , zgml(lx1,3),work(3,lx1,lz1)
13 dimension xml(nxl,nyl,nzl,1),yml(nxl,nyl,nzl,1),zml(nxl,nyl,nzl,1)
17 IF (ifaxis .AND. ifrzer(ie) .AND. (isid.EQ.2 .OR. isid.EQ.4))
25 ELSE IF(isid.EQ.8)
THEN
34 radius=curve(1,isid,ie)
35 gap=sqrt( (pt1x-pt2x)**2 + (pt1y-pt2y)**2 )
36 IF (abs(2.0*radius).LE.gap*1.00001)
THEN
37 write(6,10) radius,isid,ie,gap
38 10
FORMAT(//,2x,
'ERROR: Too small a radius (',g11.3
39 $ ,
') specified for side',i2,
' of element',i4,
': '
40 $ ,g11.3,/,2x,
'ABORTING during mesh generation.')
48 dtheta = abs(asin(0.5*gap/radius))
49 pt12x = (pt1x + pt2x)/2.0
50 pt12y = (pt1y + pt2y)/2.0
51 xcenn = pt12x - xs/xys * radius*cos(dtheta)
52 ycenn = pt12y - ys/xys * radius*cos(dtheta)
53 theta0 = atan2((pt12y-ycenn),(pt12x-xcenn))
55 fac = sign(1.0,radius)
56 theta1 = theta0 - fac*dtheta
57 theta2 = theta0 + fac*dtheta
65 ang = h(iy,2,i1)*theta1 + h(iy,2,i2)*theta2
66 xcrved(iy)=xcenn + abs(radius)*cos(ang)
67 $ - (h(iy,2,i1)*pt1x + h(iy,2,i2)*pt2x)
68 ycrved(iy)=ycenn + abs(radius) * sin(ang)
69 $ - (h(iy,2,i1)*pt1y + h(iy,2,i2)*pt2y)
74 IF (isid1.GT.2) ixt=nxl+1-ix
76 IF (radius.LT.0.0) r=-r
77 xcrved(ixt) = xcenn + abs(radius) * cos(theta0 + r*dtheta)
78 $ - ( h(ix,1,1)*pt1x + h(ix,1,2)*pt2x )
79 ycrved(ixt) = ycenn + abs(radius) * sin(theta0 + r*dtheta)
80 $ - ( h(ix,1,1)*pt1y + h(ix,1,2)*pt2y )
90 CALL addtnsr(xml(1,1,1,ie),h(1,1,ixt),xcrved,h(1,3,izt)
92 CALL addtnsr(yml(1,1,1,ie),h(1,1,ixt),ycrved,h(1,3,izt)
95 CALL addtnsr(xml(1,1,1,ie),xcrved,h(1,2,iyt),h(1,3,izt)
97 CALL addtnsr(yml(1,1,1,ie),ycrved,h(1,2,iyt),h(1,3,izt)
103 subroutine defsrf(xml,yml,zml,nxl,nyl,nzl,ie,iface1,ccv)
108 COMMON /ctmp1/ h(lx1,3,2),xcrved(lx1),ycrved(ly1),zcrved(lz1)
109 $ , zgml(lx1,3),work(3,lx1,lz1)
111 dimension xml(nxl,nyl,nzl,1),yml(nxl,nyl,nzl,1),zml(nxl,nyl,nzl,1)
112 dimension x1(3),x2(3),x3(3),dx(3)
113 dimension iopp(3),nxx(3)
116 CALL dsset(nxl,nyl,nzl)
117 iface = eface1(iface1)
118 js1 = skpdat(1,iface)
119 jf1 = skpdat(2,iface)
120 jskip1 = skpdat(3,iface)
121 js2 = skpdat(4,iface)
122 jf2 = skpdat(5,iface)
123 jskip2 = skpdat(6,iface)
126 iopp(2) = nxl*(nyl-1)
127 iopp(3) = nxl*nyl*(nzl-1)
131 idir = 2*mod(iface,2) - 1
138 DO 200 j2=js2,jf2,jskip2
139 DO 200 j1=js1,jf1,jskip1
140 jopp = j1 + iopp(ifc2)*idir
141 x2(1) = xml(j1,j2,1,ie)
142 x2(2) = yml(j1,j2,1,ie)
143 x2(3) = zml(j1,j2,1,ie)
144 x1(1) = xml(jopp,j2,1,ie)
145 x1(2) = yml(jopp,j2,1,ie)
146 x1(3) = zml(jopp,j2,1,ie)
147 CALL intrsc(x3,x2,x1,delt,ie,iface1)
154 joff = (j1-jopp)/(nxs-1)
156 j = jopp + joff*(ix-1)
157 zeta = 0.5*(zgml(ix,ifc2) + 1.0)
158 xml(j,j2,1,ie) = xml(j,j2,1,ie)+dx(1)*zeta
159 yml(j,j2,1,ie) = yml(j,j2,1,ie)+dx(2)*zeta
160 zml(j,j2,1,ie) = zml(j,j2,1,ie)+dx(3)*zeta
167 subroutine intrsc(x3,x2,x1,delt,ie,iface)
169 dimension x1(3),x2(3),x3(3)
170 COMMON /srfcei/ iel,ifce
171 COMMON /srfcer/ x0(3),dx(3)
172 COMMON /srfcel/ succes
186 dist = sqrt( dx(1)**2 + dx(2)**2 + dx(3)**2 )
191 eta1 = eta2 - delt/dist
193 CALL zbrac(eta1,eta2,succes)
196 tolsrf = tol*(eta2-eta1)
197 IF (succes) eta3 =
zbrent(eta1,eta2,tolsrf)
199 x3(1) = x0(1) + dx(1)*eta3
200 x3(2) = x0(2) + dx(2)*eta3
201 x3(3) = x0(3) + dx(3)*eta3
214 parameter(factor=1.08,ntry=50)
219 IF (x1.EQ.x2) x1 = .99*x1
220 IF (x1.EQ.0.0) x1 = 1.0e-04
225 IF (f1*f2.LT.0.0)
return
226 IF (abs(f1).LT.abs(f2))
THEN
227 x1 = x1 + factor*(x1-x2)
230 x2 = x2 + factor*(x2-x1)
243 parameter(itmax=100,eps=3.0e-8)
249 IF (fb*fa.GT.0.0)
GOTO 9000
253 IF (fb*fc.GT.0.0)
THEN
259 IF (abs(fc).LT.abs(fb))
THEN
267 tol1 = 2.0*eps*abs(b)+0.5*tol
269 IF (abs(xm).LE.tol1.OR.fb.EQ.0.0)
THEN
273 IF (abs(e).GT.tol1.AND. abs(fa).GT.abs(fb))
THEN
284 p=s*( 2.0*xm*q*(q-r) - (b-a)*(r-1.0) )
285 q=(q-1.0)*(r-1.0)*(s-1.0)
292 IF (2.0*p.LT.min(3.0*xm*q-abs(tol1*q),abs(e*q)))
THEN
308 IF (abs(d).GT.tol1)
THEN
319 write(6 ,*)
'Exceeding maximum number of iterations.'
327 COMMON /srfcei/ iel,ifce
328 COMMON /srfcer/ x0(3),dx(3)
329 COMMON /srfcel/ succes
335 IF (ccurve(ifce,iel).EQ.
's')
THEN
336 xctr = curve(1,ifce,iel)
337 yctr = curve(2,ifce,iel)
338 zctr = curve(3,ifce,iel)
339 radius = curve(4,ifce,iel)
340 x = x0(1) + dx(1)*eta - xctr
341 y = x0(2) + dx(2)*eta - yctr
342 z = x0(3) + dx(3)*eta - zctr
344 fnc = (radius**2 - (x**2+y**2+z**2))/(radius**2)
359 dimension xcc(8),ycc(8),zcc(8)
364 COMMON /fastmd/ ifdfrm(lelt), iffast(lelt), ifh2, ifsolv
365 LOGICAL IFDFRM, IFFAST, IFH2, IFSOLV
386 IF (param(59).ne.0.and.nio.eq.0)
387 $
write(6,*)
'NOTE: All elements deformed , param(59) ^=0'
388 IF (param(59).ne.0)
return
408 IF(ccurve(iedg,ie).NE.
' ')
THEN
415 xcc(i)=xc(indx(i),ie)
416 ycc(i)=yc(indx(i),ie)
417 zcc(i)=zc(indx(i),ie)
421 vec(1,i)=xcc(2*i)-xcc(2*i-1)
422 vec(2,i)=ycc(2*i)-ycc(2*i-1)
423 vec(3,i)=zcc(2*i)-zcc(2*i-1)
431 vec(1,i1)=xcc(i2)-xcc(i2-2)
432 vec(2,i1)=ycc(i2)-ycc(i2-2)
433 vec(3,i1)=zcc(i2)-zcc(i2-2)
439 vec(1,i1)=xcc(i)-xcc(i-4)
440 vec(2,i1)=ycc(i)-ycc(i-4)
441 vec(3,i1)=zcc(i)-zcc(i-4)
445 veclen = vec(1,i)**2 + vec(2,i)**2 + vec(3,i)**2
446 veclen = sqrt(veclen)
447 vec(1,i)=vec(1,i)/veclen
448 vec(2,i)=vec(2,i)/veclen
449 vec(3,i)=vec(3,i)/veclen
455 IF ( ifvchk(vec,1,5, 9) ) ifdfrm(ie)=.true.
456 IF ( ifvchk(vec,1,6,10) ) ifdfrm(ie)=.true.
457 IF ( ifvchk(vec,2,5,11) ) ifdfrm(ie)=.true.
458 IF ( ifvchk(vec,2,6,12) ) ifdfrm(ie)=.true.
459 IF ( ifvchk(vec,3,7, 9) ) ifdfrm(ie)=.true.
460 IF ( ifvchk(vec,3,8,10) ) ifdfrm(ie)=.true.
461 IF ( ifvchk(vec,4,7,11) ) ifdfrm(ie)=.true.
462 IF ( ifvchk(vec,4,8,12) ) ifdfrm(ie)=.true.
469 IF(ccurve(iedg,ie).NE.
' ')
THEN
476 xcc(i)=xc(indx(i),ie)
477 ycc(i)=yc(indx(i),ie)
480 vec(1,1)=xcc(2)-xcc(1)
481 vec(1,2)=xcc(4)-xcc(3)
482 vec(1,3)=xcc(3)-xcc(1)
483 vec(1,4)=xcc(4)-xcc(2)
485 vec(2,1)=ycc(2)-ycc(1)
486 vec(2,2)=ycc(4)-ycc(3)
487 vec(2,3)=ycc(3)-ycc(1)
488 vec(2,4)=ycc(4)-ycc(2)
492 veclen = vec(1,i)**2 + vec(2,i)**2
493 veclen = sqrt(veclen)
494 vec(1,i)=vec(1,i)/veclen
495 vec(2,i)=vec(2,i)/veclen
501 IF ( ifvchk(vec,1,3,5) ) ifdfrm(ie)=.true.
502 IF ( ifvchk(vec,1,4,5) ) ifdfrm(ie)=.true.
503 IF ( ifvchk(vec,2,3,5) ) ifdfrm(ie)=.true.
504 IF ( ifvchk(vec,2,4,5) ) ifdfrm(ie)=.true.
519 dot1=vec(1,i1)*vec(1,i2)+vec(2,i1)*vec(2,i2)+vec(3,i1)*vec(3,i2)
520 dot2=vec(1,i2)*vec(1,i3)+vec(2,i2)*vec(2,i3)+vec(3,i2)*vec(3,i3)
521 dot3=vec(1,i1)*vec(1,i3)+vec(2,i1)*vec(2,i3)+vec(3,i1)*vec(3,i3)
527 IF (
dot.GT.epsm) iftmp=.true.
544 dimension xm3(lx3,ly3,lz3,1),ym3(lx3,ly3,lz3,1),zm3(lx3,ly3,lz3,1)
549 CALL genxyz (xm3,ym3,zm3,lx3,ly3,lz3)
551 CALL genxyz (xm1,ym1,zm1,lx1,ly1,lz1)
557 subroutine genxyz (xml,yml,zml,nxl,nyl,nzl)
566 real xml(nxl,nyl,nzl,1),yml(nxl,nyl,nzl,1),zml(nxl,nyl,nzl,1)
569 common /ctmp1/ h(lx1,3,2),xcrved(lx1),ycrved(ly1),zcrved(lz1)
570 $ , zgml(lx1,3),work(3,lx1,lz1)
572 parameter(ldw=2*lx1*ly1*lz1)
573 common /ctmp0/ w(ldw)
578 call linquad(xml,yml,zml,nxl,nyl,nzl)
583 call setzgml (zgml,ie,nxl,nyl,nzl,ifaxis)
584 call sethmat (h,zgml,nxl,nyl,nzl)
590 ccv = ccurve(iface,ie)
592 $
call sphsrf(xml,yml,zml,iface,ie,nxl,nyl,nzl,work)
594 $
call gensrf(xml,yml,zml,iface,ie,nxl,nyl,nzl,zgml)
598 ccv = ccurve(isid,ie)
599 if (ccv.eq.
'C')
call arcsrf(xml,yml,zml,nxl,nyl,nzl,ie,isid)
617 real h(lx1,3,2),zgml(lx1,3)
620 h(ix,1,1)=(1.0-zgml(ix,1))*0.5
621 h(ix,1,2)=(1.0+zgml(ix,1))*0.5
624 h(iy,2,1)=(1.0-zgml(iy,2))*0.5
625 h(iy,2,2)=(1.0+zgml(iy,2))*0.5
629 h(iz,3,1)=(1.0-zgml(iz,3))*0.5
630 h(iz,3,2)=(1.0+zgml(iz,3))*0.5
633 call rone(h(1,3,1),nzl)
634 call rone(h(1,3,2),nzl)
650 call rzero (zgml,3*lx1)
653 if (nxl.eq.3 .and. .not. ifaxl)
then
659 elseif (ifgmsh3.and.nxl.eq.lx3)
then
660 call copy(zgml(1,1),zgm3(1,1),lx3)
661 call copy(zgml(1,2),zgm3(1,2),ly3)
662 call copy(zgml(1,3),zgm3(1,3),lz3)
663 if (ifaxl .and. ifrzer(e))
call copy(zgml(1,2),zam3,ly3)
664 elseif (nxl.eq.lx1)
then
665 call copy(zgml(1,1),zgm1(1,1),lx1)
666 call copy(zgml(1,2),zgm1(1,2),ly1)
667 call copy(zgml(1,3),zgm1(1,3),lz1)
668 if (ifaxl .and. ifrzer(e))
call copy(zgml(1,2),zam1,ly1)
670 call exitti(
'ABORT setzgml! $',nxl)
676 subroutine sphsrf(xml,yml,zml,ifce,ie,nx,ny,nz,xysrf)
687 dimension xml(nx,ny,nz,1),yml(nx,ny,nz,1),zml(nx,ny,nz,1)
688 dimension xysrf(3,nx,nz)
690 COMMON /ctmp1/ h(lx1,3,2),xcrved(lx1),ycrved(ly1),zcrved(lz1)
691 $ , zgml(lx1,3),work(3,lx1,lz1)
692 COMMON /ctmp0/ xcv(3,2,2),vn1(3),vn2(3)
693 $ ,x1(3),x2(3),x3(3),dx(3)
694 dimension iopp(3),nxx(3)
701 data cface / 1,4 , 2,1 , 3,2 , 4,3 , 1,5 , 5,1 /
712 xctr = curve(1,ifce,ie)
713 yctr = curve(2,ifce,ie)
714 zctr = curve(3,ifce,ie)
715 radius = curve(4,ifce,ie)
720 CALL crn3d(xcv,xc(1,ie),yc(1,ie),zc(1,ie),curve(1,ifce,ie),iface)
725 CALL edg3d(xysrf,xcv(1,1,1),xcv(1,1,2), 1, 1, 1,ny,nx,ny)
726 CALL edg3d(xysrf,xcv(1,2,1),xcv(1,2,2),nx,nx, 1,ny,nx,ny)
727 CALL edg3d(xysrf,xcv(1,1,1),xcv(1,2,1), 1,nx, 1, 1,nx,ny)
728 CALL edg3d(xysrf,xcv(1,1,2),xcv(1,2,2), 1,nx,ny,ny,nx,ny)
737 vout(1) = xc(ivtx,ie)-xc(ivto,ie)
738 vout(2) = yc(ivtx,ie)-yc(ivto,ie)
739 vout(3) = zc(ivtx,ie)-zc(ivto,ie)
741 vsph(1) = xc(ivtx,ie)-xctr
742 vsph(2) = yc(ivtx,ie)-yctr
743 vsph(3) = zc(ivtx,ie)-zctr
745 sign =
dot(vsph,vout,3)
746 if (sign.gt.0) ifconcv = .false.
750 CALL cross(vn1,xysrf(1,1,j),xysrf(1,nx,j))
752 CALL cross(vn2,xysrf(1,i,1),xysrf(1,i,ny))
755 CALL cross(xysrf(1,i,j),vn2,vn1)
757 CALL cross(xysrf(1,i,j),vn1,vn2)
769 CALL cmult(xysrf,radius,nxy3)
774 xysrf(1,i,1)=xysrf(1,i,1)+xctr
775 xysrf(2,i,1)=xysrf(2,i,1)+yctr
776 xysrf(3,i,1)=xysrf(3,i,1)+zctr
782 IF (iface.EQ.1.OR.iface.EQ.4.OR.iface.EQ.5)
THEN
786 xysrf(1,i,j)=xysrf(1,j,i)
789 xysrf(2,i,j)=xysrf(2,j,i)
792 xysrf(3,i,j)=xysrf(3,j,i)
800 js1 = skpdat(1,iface)
801 jf1 = skpdat(2,iface)
802 jskip1 = skpdat(3,iface)
803 js2 = skpdat(4,iface)
804 jf2 = skpdat(5,iface)
805 jskip2 = skpdat(6,iface)
809 iopp(3) = nx*ny*(nz-1)
813 idir = 2*mod(iface,2) - 1
817 DO 700 j2=js2,jf2,jskip2
818 DO 700 j1=js1,jf1,jskip1
820 jopp = j1 + iopp(ifc2)*idir
821 x2(1) = xml(j1,j2,1,ie)
822 x2(2) = yml(j1,j2,1,ie)
823 x2(3) = zml(j1,j2,1,ie)
825 dx(1) = xysrf(1,i,1)-x2(1)
826 dx(2) = xysrf(2,i,1)-x2(2)
827 dx(3) = xysrf(3,i,1)-x2(3)
830 joff = (j1-jopp)/(nxs-1)
832 j = jopp + joff*(ix-1)
833 zeta = 0.5*(zgml(ix,ifc2) + 1.0)
834 xml(j,j2,1,ie) = xml(j,j2,1,ie)+dx(1)*zeta
835 yml(j,j2,1,ie) = yml(j,j2,1,ie)+dx(2)*zeta
836 zml(j,j2,1,ie) = zml(j,j2,1,ie)+dx(3)*zeta
843 subroutine edg3d(xysrf,x1,x2,i1,i2,j1,j2,nx,ny)
848 COMMON /ctmp1/ h(lx1,3,2),xcrved(lx1),ycrved(ly1),zcrved(lz1)
849 $ , zgml(lx1,3),work(3,lx1,lz1)
851 dimension xysrf(3,nx,ny)
852 dimension x1(3),x2(3)
853 REAL U1(3),U2(3),VN(3),B(3)
869 ctheta =
dot(u1,u2,3)
876 thetap = 0.5*theta*(zgml(ij,1)+1.0)
880 xysrf(iv,i,j) = ctp*u1(iv) + stp*b(iv)
884 REAL function
dot(v1,v2,n)
888 dimension v1(n),v2(n)
892 sum = sum + v1(i)*v2(i)
902 dimension v1(3),v2(3),v3(3)
904 v1(1) = v2(2)*v3(3) - v2(3)*v3(2)
905 v1(2) = v2(3)*v3(1) - v2(1)*v3(3)
906 v1(3) = v2(1)*v3(2) - v2(2)*v3(1)
917 vlngth =
dot(v1,v1,3)
918 vlngth = sqrt(vlngth)
919 if (vlngth.gt.0)
then
920 v1(1) = v1(1) / vlngth
921 v1(2) = v1(2) / vlngth
922 v1(3) = v1(3) / vlngth
928 subroutine crn3d(xcv,xc,yc,zc,curve,iface)
931 dimension xcv(3,2,2),xc(8),yc(8),zc(8),curve(4)
932 dimension indvtx(4,6)
934 DATA indvtx / 1,5,3,7 , 2,4,6,8 , 1,2,5,6
935 $ , 3,7,4,8 , 1,3,2,4 , 5,6,7,8 /
946 xcv(1,i,1)=xc(k)-xctr
947 xcv(2,i,1)=yc(k)-yctr
948 xcv(3,i,1)=zc(k)-zctr
953 IF (radius.LE.0.0)
THEN
954 write(6,20) nid,xctr,yctr,zctr,iface
955 20
FORMAT(i5,
'ERROR: Sphere of radius zero requested.'
956 $ ,/,5x,
'EXITING in CRN3D',3e12.4,i3)
960 radt=xcv(1,i,1)**2+xcv(2,i,1)**2+xcv(3,i,1)**2
962 test=abs(radt-radius)/radius
963 IF (test.GT.eps)
THEN
965 $ ,radt,radius,xcv(1,i,1),xcv(2,i,1),xcv(3,i,1)
966 30
FORMAT(i5,
'ERROR: Element vertex not on requested sphere.'
967 $ ,/,5x,
'EXITING in CRN3D',5e12.4)
988 COMMON /fastmd/ ifdfrm(lelt), iffast(lelt), ifh2, ifsolv
989 LOGICAL IFDFRM, IFFAST, IFH2, IFSOLV
992 IF (ldim.EQ.3)
return
998 IF (.NOT.ifdfrm(iel))
THEN
999 rxaver =
vlsum(rxm1(1,1,1,iel),nxyz1)/(nxyz1)
1000 sxaver =
vlsum(sxm1(1,1,1,iel),nxyz1)/(nxyz1)
1001 IF (sxaver.NE.0.)
THEN
1002 rotxy = abs(sxaver/rxaver)
1003 IF (rotxy.LT.eps)
THEN
1004 ifalgn(iel) = .true.
1005 ifrsxy(iel) = .true.
1006 ELSEIF (rotxy.GT.epsinv)
THEN
1007 ifalgn(iel) = .true.
1008 ifrsxy(iel) = .false.
1010 ifalgn(iel) = .false.
1011 ifrsxy(iel) = .false.
1014 ifalgn(iel) = .true.
1015 ifrsxy(iel) = .true.
1022 subroutine gensrf(XML,YML,ZML,IFCE,IE,MX,MY,MZ,zgml)
1035 dimension xml(mx,my,mz,1),yml(mx,my,mz,1),zml(mx,my,mz,1)
1038 real IOPP(3),MXX(3),X0(3),DX(3)
1046 CALL dsset(mx,my,mz)
1048 iface = eface1(ifce)
1052 js1 = skpdat(1,iface)
1053 jf1 = skpdat(2,iface)
1054 jskip1 = skpdat(3,iface)
1055 js2 = skpdat(4,iface)
1056 jf2 = skpdat(5,iface)
1057 jskip2 = skpdat(6,iface)
1061 iopp(3) = mx*my*(mz-1)
1065 idir = 2*mod(iface,2) - 1
1071 x0(1) = xml(js1,js2,1,ie)
1072 x0(2) = yml(js1,js2,1,ie)
1073 x0(3) = zml(js1,js2,1,ie)
1078 DO 100 j2=js2,jf2,jskip2
1079 DO 100 j1=js1,jf1,jskip1
1080 if (j1.ne.js1.or.j2.ne.js2)
then
1081 r2 = (x0(1) - xml(j1,j2,1,ie))**2
1082 $ + (x0(2) - yml(j1,j2,1,ie))**2
1083 $ + (x0(3) - zml(j1,j2,1,ie))**2
1087 dxc = 0.05*sqrt(rmin)
1091 DO 300 j2=js2,jf2,jskip2
1092 DO 300 j1=js1,jf1,jskip1
1094 jopp = j1 + iopp(ifc2)*idir
1095 x0(1) = xml(j1,j2,1,ie)
1096 x0(2) = yml(j1,j2,1,ie)
1097 x0(3) = zml(j1,j2,1,ie)
1099 call prjects(x0,dxc,curve(1,ifce,ie),ccurve(ifce,ie))
1100 dx(1) = x0(1)-xml(j1,j2,1,ie)
1101 dx(2) = x0(2)-yml(j1,j2,1,ie)
1102 dx(3) = x0(3)-zml(j1,j2,1,ie)
1104 joff = (j1-jopp)/(mxs-1)
1106 j = jopp + joff*(ix-1)
1107 zeta = 0.5*(zgml(ix,1) + 1.0)
1108 xml(j,j2,1,ie) = xml(j,j2,1,ie)+dx(1)*zeta
1109 yml(j,j2,1,ie) = yml(j,j2,1,ie)+dx(2)*zeta
1110 zml(j,j2,1,ie) = zml(j,j2,1,ie)+dx(3)*zeta
1131 if (dxc.le.0.0)
then
1132 write(6,*)
'invalid dxc',dxc,x0
1133 write(6,*)
'Abandoning prjects'
1148 rx = 0.5*(r2-r1)/dxc
1155 ry = 0.5*(r2-r1)/dxc
1162 rz = 0.5*(r2-r1)/dxc
1164 rnorm2 = rx**2 + ry**2 + rz**2
1169 x1(1) = x0(1) + 2.0*rx * alpha
1170 x1(2) = x0(2) + 2.0*ry * alpha
1171 x1(3) = x0(3) + 2.0*rz * alpha
1205 da = r1*(a1-a0)/(r1-r0)
1210 x1(1) = x0(1) + a1*dx
1211 x1(2) = x0(2) + a1*dy
1212 x1(3) = x0(3) + a1*dz
1227 ressrf = 1.0 - (x(1)/a)**2 - (x(2)/b)**2 - (x(3)/b)**2
1243 real xl(nxl*nyl*nzl,1),yl(nxl*nyl*nzl,1),zl(nxl*nyl*nzl,1)
1248 nedge = 4 + 8*(ldim-2)
1254 if (ccurve(k,e).eq.
'm') ifmid = .true.
1257 if (lx1.eq.2) ifmid = .false.
1259 call xyzquad(xl(1,e),yl(1,e),zl(1,e),nxl,nyl,nzl,e)
1261 call xyzlin (xl(1,e),yl(1,e),zl(1,e),nxl,nyl,nzl,e,ifaxis)
1268 subroutine xyzlin(xl,yl,zl,nxl,nyl,nzl,e,ifaxl)
1274 real xl(nxl,nyl,nzl),yl(nxl,nyl,nzl),zl(nxl,nyl,nzl)
1290 data indx / 1,2,4,3,5,6,8,7 /
1292 parameter(ldw=4*lx1*ly1*lz1)
1293 common /ctmp0/ xcb(2,2,2),ycb(2,2,2),zcb(2,2,2),w(ldw)
1295 common /cxyzl/ zgml(lx1,3),jx(lx1*2),jy(lx1*2),jz(lx1*2)
1296 $ ,jxt(lx1*2),jyt(lx1*2),jzt(lx1*2)
1298 real jx,jy,jz,jxt,jyt,jzt
1300 call setzgml (zgml,e,nxl,nyl,nzl,ifaxl)
1326 call tensr3(xl,nxl,xcb,2,jx,jyt,jzt,w)
1327 call tensr3(yl,nxl,ycb,2,jx,jyt,jzt,w)
1328 call tensr3(zl,nxl,zcb,2,jx,jyt,jzt,w)
1339 real xl(nxl,nyl,nzl),yl(nxl,nyl,nzl),zl(nxl,nyl,nzl)
1340 real xq(27),yq(27),zq(27)
1343 parameter(ldw=4*lx1*ly1*lz1)
1344 common /ctmp0/ w(ldw,2),zg(3)
1350 data eindx / 2 , 6 , 8 , 4
1351 $ , 20 , 24 , 26 , 22
1352 $ , 10 , 12 , 18 , 16 /
1354 common /cxyzl/ zgml(lx1,3),jx(lx1*3),jy(lx1*3),jz(lx1*3)
1355 $ ,jxt(lx1*3),jyt(lx1*3),jzt(lx1*3)
1357 real jx,jy,jz,jxt,jyt,jzt
1359 call xyzlin(xq,yq,zq,3,3,3,e,.false.)
1361 nedge = 4 + 8*(ldim-2)
1364 if (ccurve(k,e).eq.
'm')
then
1366 xq(j) = curve(1,k,e)
1367 yq(j) = curve(2,k,e)
1368 zq(j) = curve(3,k,e)
1394 call setzgml (zgml,e,nxl,nyl,nzl,ifaxis)
1405 call tensr3(xl,nxl,xq,3,jx,jyt,jzt,w)
1406 call tensr3(yl,nxl,yq,3,jx,jyt,jzt,w)
1407 call tensr3(zl,nxl,zq,3,jx,jyt,jzt,w)
1414 real x(3,3,3),y(3,3,3),z(3,3,3)
1419 data eindx / 2 , 6 , 8 , 4
1420 $ , 20 , 24 , 26 , 22
1421 $ , 10 , 12 , 18 , 16 /
1440 parameter(nedge = 4 + 8*(ldim-2))
1468 ddmin = min(ddmin,dratio)
1469 ddmax = max(ddmax,dratio)
1470 ddavg = ddavg + dratio
1472 darmin =
glmin(ddmin,1)
1473 darmax =
glmax(ddmax,1)
1474 daravg =
glsum(ddavg,1)/nelgt
1481 dratio =
vlmin(jacm1(1,1,1,ie),nxyz)/
1482 $
vlmax(jacm1(1,1,1,ie),nxyz)
1483 ddmin = min(ddmin,dratio)
1484 ddmax = max(ddmax,dratio)
1485 ddavg = ddavg + dratio
1487 dsjmin =
glmin(ddmin,1)
1488 dsjmax =
glmax(ddmax,1)
1489 dsjavg =
glsum(ddavg,1)/nelgt
1496 ddmin = min(ddmin,
dxmin_e(ie))
1497 ddmax = max(ddmax,
dxmax_e(ie))
1498 dtmp =
vlsum(jacm1(1,1,1,ie),nxyz)**1./3
1499 ddavg = ddavg + dtmp/(lx1-1)
1501 dxmin =
glmin(ddmin,1)
1502 dxmax =
glmax(ddmax,1)
1503 dxavg =
glsum(ddavg,1)/nelgt
1506 write(6,*)
'mesh metrics:'
1507 write(6,
'(A,1p2E9.2)')
' GLL grid spacing min/max :',
1509 write(6,
'(A,1p3E9.2)')
' scaled Jacobian min/max/avg:',
1510 $ dsjmin,dsjmax,dsjavg
1511 write(6,
'(A,1p3E9.2)')
' aspect ratio min/max/avg:',
1512 $ darmin,darmax,daravg
1548 dx = xm1(i+1,j,k,e) - xm1(i,j,k,e)
1549 dy = ym1(i+1,j,k,e) - ym1(i,j,k,e)
1550 dz = zm1(i+1,j,k,e) - zm1(i,j,k,e)
1551 d2 = dx*dx + dy*dy + dz*dz
1554 dx = xm1(i,j+1,k,e) - xm1(i,j,k,e)
1555 dy = ym1(i,j+1,k,e) - ym1(i,j,k,e)
1556 dz = zm1(i,j+1,k,e) - zm1(i,j,k,e)
1557 d2 = dx*dx + dy*dy + dz*dz
1560 dx = xm1(i,j,k+1,e) - xm1(i,j,k,e)
1561 dy = ym1(i,j,k+1,e) - ym1(i,j,k,e)
1562 dz = zm1(i,j,k+1,e) - zm1(i,j,k,e)
1563 d2 = dx*dx + dy*dy + dz*dz
1571 dx = xm1(i+1,j,1,e) - xm1(i,j,1,e)
1572 dy = ym1(i+1,j,1,e) - ym1(i,j,1,e)
1576 dx = xm1(i,j+1,1,e) - xm1(i,j,1,e)
1577 dy = ym1(i,j+1,1,e) - ym1(i,j,1,e)
1603 dx = xm1(i+1,j,k,e) - xm1(i,j,k,e)
1604 dy = ym1(i+1,j,k,e) - ym1(i,j,k,e)
1605 dz = zm1(i+1,j,k,e) - zm1(i,j,k,e)
1606 d2 = dx*dx + dy*dy + dz*dz
1609 dx = xm1(i,j+1,k,e) - xm1(i,j,k,e)
1610 dy = ym1(i,j+1,k,e) - ym1(i,j,k,e)
1611 dz = zm1(i,j+1,k,e) - zm1(i,j,k,e)
1612 d2 = dx*dx + dy*dy + dz*dz
1615 dx = xm1(i,j,k+1,e) - xm1(i,j,k,e)
1616 dy = ym1(i,j,k+1,e) - ym1(i,j,k,e)
1617 dz = zm1(i,j,k+1,e) - zm1(i,j,k,e)
1618 d2 = dx*dx + dy*dy + dz*dz
1626 dx = xm1(i+1,j,1,e) - xm1(i,j,1,e)
1627 dy = ym1(i+1,j,1,e) - ym1(i,j,1,e)
1631 dx = xm1(i,j+1,1,e) - xm1(i,j,1,e)
1632 dy = ym1(i,j+1,1,e) - ym1(i,j,1,e)
subroutine exitti(stringi, idata)
subroutine dsset(nx, ny, nz)
subroutine fd_weights_full(xx, x, n, m, c)
subroutine tensr3(v, nv, u, nu, A, Bt, Ct, w)
real function dot(V1, V2, N)
real function dist_xyzc(i, j, ie)
subroutine genxyz(xml, yml, zml, nxl, nyl, nzl)
subroutine xyzlin(xl, yl, zl, nxl, nyl, nzl, e, ifaxl)
function ressrf(x, c, cc)
subroutine defsrf(xml, yml, zml, nxl, nyl, nzl, ie, iface1, ccv)
function zbrent(X1, X2, TOL)
subroutine arcsrf(xml, yml, zml, nxl, nyl, nzl, ie, isid)
subroutine crn3d(xcv, xc, yc, zc, curve, iface)
subroutine intrsc(x3, x2, x1, delt, ie, iface)
subroutine gensrf(XML, YML, ZML, IFCE, IE, MX, MY, MZ, zgml)
subroutine gencoor(xm3, ym3, zm3)
subroutine linquad(xl, yl, zl, nxl, nyl, nzl)
subroutine prjects(x0, dxc, c, cc)
subroutine edg3d(xysrf, x1, x2, i1, i2, j1, j2, nx, ny)
subroutine sphsrf(xml, yml, zml, ifce, ie, nx, ny, nz, xysrf)
subroutine xyzquad(xl, yl, zl, nxl, nyl, nzl, e)
subroutine setzgml(zgml, e, nxl, nyl, nzl, ifaxl)
logical function ifvchk(VEC, I1, I2, I3)
subroutine srfind(x1, x0, c, cc)
subroutine zbrac(x1, x2, succes)
subroutine cross(v1, v2, v3)
subroutine clean_xyzq(x, y, z, if3d)
subroutine sethmat(h, zgml, nxl, nyl, nzl)
subroutine transpose(a, lda, b, ldb)
real function vlmax(vec, n)
subroutine addtnsr(s, h1, h2, h3, nx, ny, nz)
real function vlsum(vec, n)
subroutine cmult(a, const, n)
real function vlmin(vec, n)
subroutine gh_face_extend_2d(x, zg, n, gh_type, e, v)
subroutine gh_face_extend(x, zg, n, gh_type, e, v)