[petsc-users] Viewer Draw just flickers

Florian Lindner mailinglists at xgm.de
Fri Feb 12 03:26:24 CST 2016


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?

Best,
Florian


More information about the petsc-users mailing list