[petsc-users] petsc4py
Cetinbas, Cankur Firat
ccetinbas at anl.gov
Wed Oct 25 13:52:55 CDT 2017
Hi,
We have a code in python to solve for 3D water transport in a nano scale pore geometry obtained by tomography image at APS.
The code generates a sparse matrix with csr_matrix method in Python and solve the corresponding linear system with linsolve in Python. For small domains our code runs well but we need to make these two steps (sparse matrix generation and solving the linear system) parallel to be able run the code on realistic size domains.
I know the diagonal values and the non-diagonal values with corresponding positions (positions are not regular, it is not like 5 point stencil). These values and locations change every time step and the matrix size grows (as water moves in pores).
I checked the attached presentation, I was wondering if there is an easy way to generate a parallel sparse matrix from row, column and corresponding values as in Python csr? Since my off diagonal locations are not generic for each processor, it is not so trivial to me as a beginner in petsc.
By the way, in the matrix generation example (in the attached pdf), when I use the "getOwnershipRange" comment both Istart and Iend returns 0. How can generate the same matrix with multiple nodes in petsc4py?
Thanks for your help in advance.
Regards,
Firat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20171025/d1f19b0b/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Lisandro-Dalcin-petsc4py.pdf
Type: application/pdf
Size: 218697 bytes
Desc: Lisandro-Dalcin-petsc4py.pdf
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20171025/d1f19b0b/attachment-0001.pdf>
More information about the petsc-users
mailing list