[petsc-users] Viewer Draw just flickers

Matthew Knepley knepley at gmail.com
Fri Feb 12 06:31:28 CST 2016


On Fri, Feb 12, 2016 at 3:26 AM, Florian Lindner <mailinglists at xgm.de>
wrote:

> Hello,
>
> I have this code to draw the structure of a matrix:
>
>   PetscErrorCode ierr;
>   PetscViewer viewer;
>   ierr = PetscViewerCreate(communicator, &viewer); CHKERRV(ierr);
>   ierr = PetscViewerSetType(viewer, PETSCVIEWERDRAW); CHKERRV(ierr);
>   ierr = MatView(matrix, viewer); CHKERRV(ierr);
>   ierr = PetscViewerDestroy(&viewer); CHKERRV(ierr);
>
> The window just opens for a fraction of a second and closes again. How can
> I keep it open until the user closes it?
>
> -draw_pause -1 seems to do the trick, but I don't want to use a command
> line option every time.
>
> PetscDrawSetPause(PetscDraw draw,PetscReal lpause) and PetscDrawPause both
> need a PetscDraw object. Where do I get this from?
>

http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Viewer/PetscViewerDrawGetDraw.html#PetscViewerDrawGetDraw

   Matt


> Best,
> Florian
>



-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160212/f4288610/attachment.html>


More information about the petsc-users mailing list