[petsc-users] How to build compatible MPI matrix for dmplex

Matthew Knepley knepley at gmail.com
Tue Jun 27 13:28:10 CDT 2023


On Tue, Jun 27, 2023 at 2:20 PM Duan Junming via petsc-users <
petsc-users at mcs.anl.gov> wrote:

> Dear all,
>
>
> I try to create a compatible sparse MPI matrix A with dmplex global vector
> x, so I can do matrix-vector multiplication y = A*x.
>
> I think I can first get the local and global sizes of x on comm, say n and
> N, also sizes of y, m, M,
>
> then create A by using MatCreate(comm, &A), set the sizes using
> MatSetSizes(A, m, n, M, N), set the type using MatSetType(A, MATMPIAIJ). Is
> this process correct?
>

Yes.


> Another question is: Do the entries not filled automatically compressed
> out?
>

Yes.

  Thanks,

    Matt


> Thanks!
>
> Junming
>
>

-- 
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/20230627/78829645/attachment.html>


More information about the petsc-users mailing list