[petsc-users] How to obtain the local matrix from a global matrix in DMDA?

Mark Adams mfadams at lbl.gov
Mon Mar 14 09:49:47 CDT 2022


You might want to explain what you want to do.
A local vector has ghost values that you can use to compute local
residuals. You don't usually want a matrix that conforms with this local
vector.
You could get the global equations of the local vector and use
MatCreateSubMatrix, but I think there is a better way to do what you want.

OK, Matt and Jed beat me

On Mon, Mar 14, 2022 at 10:35 AM liluo <liluo at um.edu.mo> wrote:

> Dear developers,
>
>
> I created a DMDA object and obtain the local vector from a global
> vector by using DMGlobalToLocalBegin/End.
>
> How can I obtain the corresponding local matrix from the global matrix?
>
> In my case, the global matrix is of MPIBAIJ type created by
> DMCreateMatrix(da,MATBAIJ,&A);
>
>
> Bests,
>
> LI
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220314/9d1e529c/attachment.html>


More information about the petsc-users mailing list