Re: [petsc-dev] [Fwd: Re: [petsc-users] PETSc recommended visualization packages]
pushed the patch to petsc-dev satish On Tue, 19 Jul 2011, Ethan Coon wrote:
Taking this to dev.
Attached is a patch for PetscBinaryRead, which now has been tested on Mat, IS, and Vec. Supports returning dense numpy.matrix, sparse CSR, and scipy.sparse matrices (all have been tested).
Also cc'ed Ata directly since I'm not sure he's on dev. Ata -- could you please test the attached PetscBinaryRead.py for me on your system to make sure I've correctly handled your version of numpy? Note that the return format has changed from what you have now. Thanks.
PetscBinaryWrite.py when I get to it...
Thanks,
Ethan
-------- Forwarded Message -------- From: Lisandro Dalcin <[email protected]> Reply-to: PETSc users list <[email protected]> To: PETSc users list <[email protected]> Subject: Re: [petsc-users] PETSc recommended visualization packages Date: Thu, 14 Jul 2011 19:34:42 -0300
On 14 July 2011 18:33, Ethan Coon <[email protected]> wrote:
On Thu, 2011-07-14 at 17:47 -0300, Lisandro Dalcin wrote:
1) readMatDense() is wrong. The I,J,V arrays are the CSR structure, not the COO (coordinate) format, Then you cannot simply:
Ok, thanks, I wasn't sure of which format you were using,
Well, PETSc's AIJ matrices are CSR in memory (but not in disk, binary files store row counts instead of row pointers)
2) It would be nice to provie a 'scipy' Mat format returning a 'scipy.sparse.csr_matrix' instance. A possible implementation would be:
Agreed, I considered doing that as the default for sparse, but wasn't sure what others would want. Providing both makes sense.
Note however that this would require a SciPy installation.
PS: Sorry for not being more helpful and contributing actual code, but I'm really busy.
participants (1)
-
Satish Balay