[petsc-users] petsc4py for numpy array <-> MATDENSE binary

Lisandro Dalcin dalcinl at gmail.com
Sun Feb 3 08:32:31 CST 2019


On Sat, 2 Feb 2019 at 02:12, Sajid Ali <sajidsyed2021 at u.northwestern.edu>
wrote:

> The vector is essentially snapshots in time of a data array. I should
> probably store this as a 2D dense matrix of dimensions (dim_x*dim_y) *
> dim_z. Now I can pick one column at a time and use it for my TS Jacobian.
> Apologies for being a little unclear.
>
>
m, n = dim_x*dim_y, dim_z
A = PETSc.Mat.createDense([m,n], array=your_array)

-- 
Lisandro Dalcin
============
Research Scientist
Computer, Electrical and Mathematical Sciences & Engineering (CEMSE)
Extreme Computing Research Center (ECRC)
King Abdullah University of Science and Technology (KAUST)
http://ecrc.kaust.edu.sa/

4700 King Abdullah University of Science and Technology
al-Khawarizmi Bldg (Bldg 1), Office # 0109
Thuwal 23955-6900, Kingdom of Saudi Arabia
http://www.kaust.edu.sa

Office Phone: +966 12 808-0459
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190203/9b7ff595/attachment.html>


More information about the petsc-users mailing list