Feras,

      You are in luck, we do have a mechanism that automatically save PETSc X 
images as Gif files.  I delayed responding so I could clean up the code for you 
to use.

   1) It is only in petsc-dev http://www.mcs.anl.gov/petsc/developers/index.html

    2) you must first install afterimage (easy) which installs in /usr/local 

     3) ./configure PETSc with the additional option --with-afterimage

    4) when running your program just use the extra command line option 
-draw_save  or use the function PetscDrawSetSave() on the draw object you 
create before using it 

    5) If you want to generate a movie of all the images once the problem is 
complete also install ffmpeg  and also use the run time option -draw_save_movie

     6) When generating your images make sure they are all open and fulling 
displayed on the screen, afterimage will not function if the window is not 
fully visible.

     7) Report all problems to petsc-maint at mcs.anl.gov

     8) Have fun

     9) Like all PETSc graphics this is a useful tool for debugging and 
algorithmic development etc, it is not intended to produce publication quality 
graphics

    Barry

On Mar 21, 2012, at 6:02 PM, Habbal, Feras (353G-Affiliate) wrote:

> Ok, no problem. Thank you for your assistance!
> 
> From: Matthew Knepley <knepley at gmail.com>
> Reply-To: PETSc users list <petsc-users at mcs.anl.gov>
> Date: Wed, 21 Mar 2012 15:43:07 -0700
> To: PETSc users list <petsc-users at mcs.anl.gov>
> Subject: Re: [petsc-users] Saving graphical matrix structure to a file
> 
> On Wed, Mar 21, 2012 at 5:31 PM, Habbal, Feras (353G-Affiliate) 
> <Feras.A.Habbal at jpl.nasa.gov> wrote:
>> I tried using the commands from the previous post:
>> xwd | xpr -device ps > foo.ps
> 
> That worked fine for me when I made movies this way. I'm not sure what else 
> to recommend.
> 
>    Matt
>  
>> But the output was bizarre: reversed and had some artifacts.
>> 
>> I can certainly use the mac screen capture tools, but I am needing an 
>> automated capability to capture the structure of several matrices (~1000) 
>> during a run.
>> 
>> Feras
>> 
>> From: Matthew Knepley <knepley at gmail.com>
>> Reply-To: PETSc users list <petsc-users at mcs.anl.gov>
>> Date: Wed, 21 Mar 2012 15:14:39 -0700
>> To: PETSc users list <petsc-users at mcs.anl.gov>
>> Subject: Re: [petsc-users] Saving graphical matrix structure to a file
>> 
>> On Wed, Mar 21, 2012 at 5:11 PM, Habbal, Feras (353G-Affiliate) 
>> <Feras.A.Habbal at jpl.nasa.gov> wrote:
>>> Hello,
>>> 
>>> I am trying to save the matrix structure visualization from 
>>> (-mat_view_draw) to a file (jpeg, ps, or anything else). 
>>> I saw the post: "help in capturing matrix patterns to files,"
>> 
>> The easiest thing to do is use screen capture for that window.
>> 
>>     Matt
>>  
>>> but adding the options did not work for me:
>>>  ?mat_view_draw ?draw_type ps 
>>>  
>>> I have been trying to do this with the example file: 
>>> ksp/examples/tutorials/ex1.c
>>> 
>>> I included "petscdraw.h"
>>> 
>>> $ mpiexec ex1 -mat_view_draw -draw_type ps
>>> [0]PETSC ERROR: --------------------- Error Message 
>>> ------------------------------------
>>> [0]PETSC ERROR: Unknown type. Check for miss-spelling or missing external 
>>> package needed for type
>>>  
>>> seehttp://www.mcs.anl.gov/petsc/petsc-as/documentation/installation.html#external!
>>> [0]PETSC ERROR: Unknown PetscDraw type given: ps!
>>> [0]PETSC ERROR: 
>>> ------------------------------------------------------------------------
>>> [0]PETSC ERROR: Petsc Release Version 3.2.0, Patch 3, Fri Sep 30 10:28:33 
>>> CDT 2011 
>>> [0]PETSC ERROR: See docs/changes/index.html for recent updates.
>>> [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
>>> [0]PETSC ERROR: See docs/index.html for manual pages.
>>> [0]PETSC ERROR: 
>>> ------------------------------------------------------------------------
>>> [0]PETSC ERROR: ex1 on a macosx-gn named habbalf.jpl.nasa.gov by habbalf 
>>> Wed Mar 21 14:56:30 2012
>>> [0]PETSC ERROR: Libraries linked from 
>>> /Users/habbalf/issm/trunk-jpl/externalpackages/petsc/install/lib
>>> [0]PETSC ERROR: Configure run at Tue Mar  6 11:39:23 2012
>>> [0]PETSC ERROR: Configure options 
>>> --prefix=/Users/habbalf/issm/trunk-jpl/externalpackages/petsc/install 
>>> --PETSC_DIR=/Users/habbalf/issm/trunk-jpl/externalpackages/petsc/src 
>>> --PETSC_ARCH=macosx-gnu 
>>> --with-mpi-dir=/Users/habbalf/issm/trunk-jpl/externalpackages/mpich2/install
>>>  --with-debugging=1 --download-c2html=1 --with-shared-libraries=0 
>>> --download-mumps=yes --download-scalapack=yes --download-blacs=yes 
>>> --download-blas=yes --download-plapack=yes --download-parmetis=yes 
>>> --download-f-blas-lapack=yes
>>> [0]PETSC ERROR: 
>>> ------------------------------------------------------------------------
>>> [0]PETSC ERROR: PetscDrawSetType() line 147 in 
>>> src/sys/draw/interface/drawreg.c
>>> [0]PETSC ERROR: PetscDrawSetFromOptions() line 278 in 
>>> src/sys/draw/interface/drawreg.c
>>> [0]PETSC ERROR: PetscViewerDrawGetDraw() line 109 in 
>>> src/sys/viewer/impls/draw/drawv.c
>>> [0]PETSC ERROR: MatView_SeqAIJ_Draw() line 752 in 
>>> src/mat/impls/aij/seq/aij.c
>>> [0]PETSC ERROR: MatView_SeqAIJ() line 781 in src/mat/impls/aij/seq/aij.c
>>> [0]PETSC ERROR: MatView() line 757 in src/mat/interface/matrix.c
>>> [0]PETSC ERROR: MatView_Private() line 4881 in src/mat/interface/matrix.c
>>> [0]PETSC ERROR: MatAssemblyEnd() line 4965 in src/mat/interface/matrix.c
>>> [0]PETSC ERROR: main() line 89 in src/ksp/ksp/examples/tutorials/ex1.c
>>> application called MPI_Abort(MPI_COMM_WORLD, 86) - process 0
>>> 
>>> Thank you for your assistance,
>>> 
>>> Feras
>> 
>> 
>> 
>> -- 
>> 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
> 
> 
> 
> -- 
> 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

Reply via email to