[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help in capturing matrix patterns to files



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@xxxxxxxxxxxxxxxxx>
To: <petsc-users@xxxxxxxxxxx>
Cc: <abdul-rahman@xxxxxxxxxxxxx>
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@xxxxxxxxxxxxx <mailto:abdul-rahman@xxxxxxxxxxxxx>* <abdul-rahman@xxxxxxxxxxxxx <mailto:abdul-rahman@xxxxxxxxxxxxx>> 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@xxxxxxxxxxxxxxxxx Theoretical Astrophysics Phone (626) 395-8413 Caltech 130-33 Fax (626) 796-5675 Pasadena, CA 91125, USA