[petsc-users] Possible bug in PETSc4py Mat().CreateAIJ with rectangular matrices?

Nidish nb25 at rice.edu
Sun Aug 16 23:21:54 CDT 2020


Hello,

I'm presently using the following to convert scipy.sparse csr matrices 
to petsc.

    pM = PETSc.Mat().createAIJ(size=M.shape, csr =(M.indptr, M.indices,
    M.data))

This however doesn't seem to work when M is rectangular. For this case I 
have to do

    pM = PETSc.Mat().createAIJ(size=M.T.shape, csr =(M.indptr,
    M.indices, M.data))

i.e., I need to use the shape of the transpose of the matrix.

Does this have something to do with the way the csr format is 
interpreted in the petsc4py wrappings or in PETSc itself?

-- 
Nidish
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200816/11487bb0/attachment.html>


More information about the petsc-users mailing list