! ! ! This example demonstrates use of PetscDrawZoom() ! ! This function is called repeatedly by PetscDrawZoom() to ! redraw the figure ! #include #include subroutine zoomfunction(draw, dummy, ierr) use petscsys use petscdraw implicit none PetscReal zero, one, value, max PetscDraw draw integer dummy PetscErrorCode ierr PetscInt32 i zero = 0 one = 1 max = 256.0 do i = 0, 255 value = i/max PetscCall(PetscDrawLine(draw, zero, value, one, value, i, ierr)) end do end program main use petscsys use petscdraw implicit none PetscDraw draw PetscErrorCode ierr integer4 x, y, width, height external zoomfunction x = 0 y = 0 width = 256 height = 256 PetscCallA(PetscInitialize(ierr)) PetscCallA(PetscDrawCreate(PETSC_COMM_WORLD, PETSC_NULL_CHARACTER, 'Title', x, y, width, height, draw, ierr)) PetscCallA(PetscDrawSetFromOptions(draw, ierr)) PetscCallA(PetscDrawZoom(draw, zoomfunction, PETSC_NULL_INTEGER, ierr)) PetscCallA(PetscDrawDestroy(draw, ierr)) PetscCallA(PetscFinalize(ierr)) end !/*TEST ! ! build: ! requires: x ! ! test: ! output_file: output/empty.out ! !TEST*/