pro wave2d_45x180 ; ; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ; * PROGRAM WAVEG2D: PLOTS THE DEFORMED GRID OF A STRESS WAVE MOVING * ; * THRU A SQUARE QUADRILATERAL FINITE ELEMENT GRID WHERE A DEFORMED * ; * GRID IS DRAWN FROM NODAL DISPLACEMENTS WHICH ARE STORED IN A * ; * FILE WHERE DISPLACEMENTS ARE GROUPED WITH A SPECIFIC TIME. * ; * FORMAT(2I5,4F5.3) NUMBER OF NODES, NUMBER OF ELEMENTS, * ; * SCALE FOR HORIZ. COORDINATES H(I), SCALE VOR VERT. COORDINATES * ; * Z(I). COORDINATES OF THE ORIGIN OR THE FIRST NODE POINT WHICH * ; * IS ASSUMED TO BE LOCATED IN THE LOWER LEFT-HAND-CORNER OF THE * ; * GRID. WRITTEN BY R.D.KRIZ, SPRING 1988. BOULDER,COLORADO. * ; * Modified by R.D.Kriz spring 2000, VaTech to run on pse web server * ; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ; openr,5,'pltfl.dat' hi=fltarr(8326) zi=fltarr(8326) n1=intarr(8100) n2=intarr(8100) n3=intarr(8100) n4=intarr(8100) file=string('') f=string('') dh=fltarr(8326) dz=fltarr(8326) ; ; READ HEADING FROM INPUT FILE ; readf,5,f ; ; READ SECOND LINE OF INPUT FOR GRID INFO. ; ; NODES , NUMBER OF NODES ; NELEM , NUMBER OF ELEMENTS ; SCAH , SCALE OF HORIZ. COORDINATES ; SCAZ , SCALE OF VERTL. COORDINATES ; HOR , HORIZ. COORD. OF 1RST NODE ; ZOR , VERT. COORD. OF 1RST NODE ; readf,5,format='(2I6,4F8.0)',nodes,nelem,scah,scaz,hor,zor nodes=fix(nodes) nelem=fix(nelem) nodesm1=nodes-1 nelemm1=nelem-1 ; ; Define mins and maxs for X and Y coordinates ; min_y=-6.0 & max_y=55.0 min_x=-2.0 & max_x=205.0 ; ; Set X and Y data Scales as PV-Wave system variables !X.S = [-min_x, 1.]/(max_x-min_x) !Y.S = [-min_y, 1.]/(max_y-min_y) ; ; READ NODE POINT COORDINATES ; for ind=0,nodesm1 do begin readf,5,format='(12x,2F12.5)',z,h hi(ind)=h zi(ind)=z endfor ; ; READ ELEMENT AND ASSOCIATED NODE NO. TOPOLOGY ; for iel=0,nelemm1 do begin readf,5,format='(6x,4I6)',a,b,c,d n1(iel)=a n2(iel)=b n3(iel)=c n4(iel)=d endfor ; ; READ THE NUMBER OF TIME STEPS AND MULT. FACTOR FOR NODAL DISPL.S ; readf,5,format='(I3,E10.3)',nt,smult ; ; Setup Z buffer for making animations ; set_plot,'pm' TEK_COLOR openzbuff,1100,500 ; ; LOOP THRU DISPL.S FOR EACH TIME STEP ;nt=1 for it=1,nt do begin ; ; READ TIME FOR INCREMENT ; readf,5,format='(6x,e11.4)',time ; ; READ and SCALE NODAL DISPLACEMENTS ; for in=0,nodesm1 do begin readf,5,format='(7x,2(1x,e11.4))',a,b dh(in)=b*smult*5.0 dz(in)=a*smult*5.0 endfor ; ; OPEN WINDOW FOR EACH TIME STEP ; ; window,1,xsize=500,ysize=1100,xpos=30,ypos=300 erase,255 ; ; CALCULATE DISPLACED GLOBAL COORD.S FROM NODAL DISPLACEMENTS ; AND THEN PLOT ELEMENTS ; for ie=0,nelemm1 do begin plots, [hi(n1(ie)-1)+dh(n1(ie)-1),hi(n2(ie)-1)+dh(n2(ie)-1)],$ [zi(n1(ie)-1)+dz(n1(ie)-1),zi(n2(ie)-1)+dz(n2(ie)-1)],$ color=0 plots, [hi(n2(ie)-1)+dh(n2(ie)-1),hi(n3(ie)-1)+dh(n3(ie)-1)],$ [zi(n2(ie)-1)+dz(n2(ie)-1),zi(n3(ie)-1)+dz(n3(ie)-1)],$ color=0 plots, [hi(n3(ie)-1)+dh(n3(ie)-1),hi(n4(ie)-1)+dh(n4(ie)-1)],$ [zi(n3(ie)-1)+dz(n3(ie)-1),zi(n4(ie)-1)+dz(n4(ie)-1)],$ color=0 plots, [hi(n4(ie)-1)+dh(n4(ie)-1),hi(n1(ie)-1)+dh(n1(ie)-1)],$ [zi(n4(ie)-1)+dz(n4(ie)-1),zi(n1(ie)-1)+dz(n1(ie)-1)],$ color=0 endfor ; ; WRITE TIME ON EACH PLOT ; XYOUTS,hi(nodesm1-1)-115.0,zi(nodesm1-1)+3.0,' Time',SIZE=2 XYOUTS,hi(nodesm1-1)-103.0,zi(nodesm1-1)+3.0,' (seconds)',SIZE=1.5 XYOUTS,hi(nodesm1-1)-88.0,zi(nodesm1-1)+3.0,time,SIZE=1.2 empty ; ; Create series of GIF images for animation ; openw,4,'temp.dat' if (it lt 10) then printf,4,format='(i1)',it if ((it ge 10) and (it lt 100)) then printf,4,format='(i2)',it if (it ge 100) then printf,4,format='(i3)',it close,4 openr,4,'temp.dat' nn=string('') readf,4,nn if (it lt 10) then file="a00"+nn+".gif" if ((it ge 10) and (it lt 100)) then file="a0"+nn+".gif" if (it ge 100) then file="a"+nn+".gif" close,4 closezbuff,file ; endfor ; END ALL PLOTTING close,5 end