help in capturing matrix patterns to files

Mary Ann Leung mleung at u.washington.edu
Thu May 4 11:25:43 CDT 2006


One thing that I have done is use one of the PETSc MatViewers to write you 
the matrix nonzero structure and then create a graphic using Matlab's "spy" 
command.  It creates a nice visual representation of the nonzero patterns.

---Mary Ann

----- Original Message ----- 
From: "Harald Pfeiffer" <harald at tapir.caltech.edu>
To: <petsc-users at mcs.anl.gov>
Cc: <abdul-rahman at tu-harburg.de>
Sent: Thursday, May 04, 2006 8:59 AM
Subject: Re: help in capturing matrix patterns to files


> Hello,
>
> That's a pity that this is not implemented.  As soon as I saw Razi's 
> question, I thought that this would be a really useful feature.  I have 
> found myself many times saying in talks that my matrix is non-symmetric 
> for this-or-that reason.  Having a picture of the matrix to make the point 
> would be very powerful.
>
> I guess, outputting a picture with as many pixels as the matrix-size in a 
> non-compressed format (tiff?) should be straightforward: You iterate 
> through all matrix entries, if the entry is non-zero, you output "1", 
> otherwise "0".
> You could even output different colors depending on the size or sign of an 
> entry.  This will result in huge files, but any image-software should be 
> able to down-size and convert to more efficient formats.
>
> Harald
>
>
> Matthew Knepley wrote:
>> There is nothing built into PETSc to do this. It is also X-Windows
>> render commands inside. I used a screen capture program on
>> the Window it pops up.
>>
>>   Thanks,
>>
>>      Matt
>>
>> On 5/4/06, *abdul-rahman at tu-harburg.de 
>> <mailto:abdul-rahman at tu-harburg.de>* <abdul-rahman at tu-harburg.de 
>> <mailto:abdul-rahman at tu-harburg.de>> wrote:
>>
>>     Hi all,
>>
>>     I'd appreciate if anyone can point to a tutorial/example on how to
>>     direct
>>     the matrix pattern plot (one with -mat_view_draw) to a file
>>     (preferrably
>>     PNG for presentation and postscript for publications)
>>
>>     I want to be able to capture the patterns in monochrome and also
>>     resize
>>     the graphics size.
>>
>>     Thanks so much.
>>
>>
>>     Razi
>>
>>
>>
>>
>> -- 
>> "Failure has a thousand explanations. Success doesn't need one" -- Sir 
>> Alec Guiness
>
> -- 
> Harald P. Pfeiffer                harald at tapir.caltech.edu
> Theoretical Astrophysics          Phone (626) 395-8413
> Caltech 130-33                    Fax   (626) 796-5675
> Pasadena, CA 91125, USA
> 




More information about the petsc-users mailing list