petsc-3.6.2 2015-10-02
Report Typos and Errors


Saves images produced in a PetscDraw into a file as a Gif file using AfterImage


#include "petscdraw.h" 
#include "petscviewer.h" 
PetscErrorCode  PetscDrawSetSave(PetscDraw draw,const char *filename,PetscBool movie)
Collective on PetscDraw

Input Parameter

draw - the graphics context
filename - name of the file, if .ext then uses name of draw object plus .ext using .ext to determine the image type, if NULL use .Gif image type
movie - produce a movie of all the images

Options Database Command

-draw_save <filename> - filename could be name.ext or .ext (where .ext determines the type of graphics file to save, for example .Gif)
-draw_save_movie- . -draw_save_final_image [optional filename] - (X windows only) saves the final image displayed in a window
-draw_save_on_flush - saves an image on each flush in addition to each clear
-draw_save_single_file - saves each new image in the same file, normally each new image is saved in a new file with filename_%d

Notes: You should call this BEFORE calling PetscDrawClear() and creating your image.

Requires that PETSc be configured with the option --with-afterimage to save the images and ffmpeg must be in your path to make the movie

The .ext formats that are supported depend on what formats AfterImage was configured with; on the Apple Mac both .Gif and .Jpeg are supported.

If X windows generates an error message about X_CreateWindow() failing then Afterimage was installed without X windows. Reinstall Afterimage using the ./configure flags --x-includes=/pathtoXincludes --x-libraries=/pathtoXlibraries For example under Mac OS X Mountain Lion --x-includes=/opt/X11/include -x-libraries=/opt/X11/lib

See Also

PetscDrawSetFromOptions(), PetscDrawCreate(), PetscDrawDestroy(), PetscDrawSetSaveFinalImage()

Index of all Draw routines
Table of Contents for all manual pages
Index of all manual pages