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

Matthew Knepley knepley at gmail.com
Fri Jul 12 16:16:07 CDT 2019


On Fri, Jul 12, 2019 at 2:43 PM Manuel Valera via petsc-users <
petsc-users at mcs.anl.gov> wrote:

> 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.
>

I do not think this makes sense. A DMDA array is a Vec, or function on the
grid. A Mat is a linear operator between those functions.

   Thanks,

      Matt


> Thanks for your help,
>
>
>

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190712/1ca5d751/attachment.html>


More information about the petsc-users mailing list