Actual source code: ex4f.F
petsc-3.4.2 2013-07-02

      1: !
      2: !
      3: !  This example demonstrates use of PetscDrawZoom()
      4: !
      5: !          This function is called repeatedly by PetscDrawZoom() to
      6: !      redraw the figure
      7: !
      8:       subroutine zoomfunction(draw,dummy,ierr)
      9: #include <finclude/petscsys.h>
     10: #include <finclude/petscdraw.h>
     11:       PetscDraw    draw
     12:       integer dummy
     13:       PetscErrorCode ierr

     15:       integer i

     17:       do 10, i=0,255
     18:         call PetscDrawLine(draw,0.d0,i/256.d0,1.d0,i/256.d0,i,ierr)
     19:  10   continue
     20:       return
     21:       end

     23:       program main
     24: #include <finclude/petscsys.h>
     25: #include <finclude/petscdraw.h>
     26:       PetscDraw draw
     27:       PetscErrorCode ierr
     28:       integer  x,y,width,height
     29:       External zoomfunction
     30:       x      = 0
     31:       y      = 0
     32:       width  = 256
     33:       height = 256

     35:       call PetscInitialize(PETSC_NULL_CHARACTER,ierr)
     36:       call PetscDrawCreate(PETSC_COMM_SELF,PETSC_NULL_CHARACTER,        &
     37:      & 'Title',x,y,width,height,draw,ierr)
     38:       call PetscDrawSetFromOptions(draw,ierr)
     39:       call PetscDrawZoom(draw,zoomfunction,PETSC_NULL_INTEGER,ierr)
     40:       call PetscDrawDestroy(draw,ierr)
     41:       call PetscFinalize(ierr)
     42:       end