On Tue, Jun 27, 2023 at 2:20 PM Duan Junming via petsc-users < petsc-users@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/>