nx=32 ny=32 nz=32 mx=nx+6 my=ny+6 mz=nz+6 dx=2*!pi/nx dy=2*!pi/ny dz=2*!pi/nz x=dx*(findgen(mx)-mx/2+1.5) y=dy*(findgen(my)-my/2+1.5) z=dz*(findgen(mz)-mz/2+1.5) l1=2 & l2=l1+nx-1 m1=2 & m2=l1+ny-1 n1=2 & n2=l1+nz-1 ;------------------------------------------------------------------------------ ; ; coordinates ; xx = spread(x, [1,2], [my,mz]) yy = spread(y, [0,2], [mx,mz]) zz = spread(z, [0,1], [mx,my]) uu=fltarr(mx,my,mz,3) ; ; ring parameters ; d=1.2 & rr0=1.5 & xx0=.5*rr0 & yy0=0. & file='uu.dat' d=0.7 & rr0=1.5 & xx0=.5*rr0 & yy0=0. & file='uu.dat' ;(imp_rring32a-c) d=0.5 & rr0=1.5 & xx0=.5*rr0 & yy0=0. & file='uu.dat' ;(imp_sring32a-c) d=0.5 & rr0=1.0 & xx0=.5*rr0 & yy0=0. & file='uu.dat' ;(imp_tring32a-c) ; ; 1st ring in xY-plane shifted to the right ; The Y-direction is in the yz-plane. ; degree=!pi/180. alpha=45*degree c=cos(alpha) & s=sin(alpha) xxx=xx-xx0 yyy=+yy*c+zz*s zzz=-yy*s+zz*c rr=sqrt(xxx^2+yyy^2) phi=atan(yyy,xxx) aphi=bump(((rr-rr0)^2+zzz^2)/d^2) uu(*,*,*,0)=+aphi*sin(phi) uu(*,*,*,1)=-aphi*cos(phi)*c uu(*,*,*,2)=-aphi*cos(phi)*s ; ; 2nd ring in xz-plane shifted to the left ; The Y-direction is in the yz-plane by another angle. ; alpha=-45*degree c=cos(alpha) & s=sin(alpha) xxx=xx+xx0 yyy=+yy*c+zz*s zzz=-yy*s+zz*c rr=sqrt(xxx^2+yyy^2) phi=atan(yyy,xxx) aphi=bump(((rr-rr0)^2+zzz^2)/d^2) uu(*,*,*,0)=uu(*,*,*,0)+aphi*sin(phi) uu(*,*,*,1)=uu(*,*,*,1)-aphi*cos(phi)*c uu(*,*,*,2)=uu(*,*,*,2)-aphi*cos(phi)*s ; spawn,'date',t3 & print,t3 ; uuu=uu(l1:l2,m1:m2,n1:n2,*) umax=sqrt(max(dot2(uu))) uuu=uuu/umax ;openw,1,'data/proc0/uu.dat',/f77 ;writeu,1,uuu ;close,1 stop ; ; kinetic helicity ; oo=curl(uu) ooo=oo(l1:l2,m1:m2,n1:n2,*) print,'=',mean(dot(ooo,uuu)) ; END