[petsc-users] Create 2 matrix with the same OwnershipRanges

Matthew Knepley knepley at gmail.com
Tue Jan 22 08:15:22 CST 2019


On Tue, Jan 22, 2019 at 4:57 AM NENNIG Benoit via petsc-users <
petsc-users at mcs.anl.gov> wrote:

> Hi,
>
> I would like to create a matrix aij with the same OwnershipRanges as an
> other existing matrix with petsc4py. The two matrices have not the same non
> zeros patern.
>
> Any ideas ?
>

MatSetSizes() can be used to determine the parallel layout of a matrix. So
you could call MatGetLocalSize() on the first Mat,
and then MatSetSizes() on the copy.

  Thanks,

    Matt


>
> Regards,
>
> Benoit
>


-- 
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/20190122/e66a0988/attachment.html>


More information about the petsc-users mailing list