[petsc-users] Reshape a 3D array into Matrix?

Manuel Valera mvalera-w at sdsu.edu
Fri Jul 12 14:41:12 CDT 2019


Hi petsc devs and users,

Is there an analogue to reshape as in the fortran / matlab functions for
petsc arrays? i am looking into converting a 3D DMDA array of (nx,ny,nz)
sizes into a 2D MATMPI matrix of size (nx) x (ny) x (nz) by (nx) x (ny) x
(nz), that will be used as the laplacian matrix in a linear solver, which
will change in every iteration, so is easier to calculate in 3D and convert.

Thanks for your help,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190712/17c5b54a/attachment.html>


More information about the petsc-users mailing list