[petsc-users] How to obtain the local matrix from a global matrix in DMDA?
liluo
liluo at um.edu.mo
Mon Mar 14 10:05:30 CDT 2022
Dear developers,
I defined subdomain problems that have some layers of ghost points, which are exactly of the "local" size of a DA.
And I want to generate the corresponding submatrix in each subdomain which contains those layers of ghost points.
I know that MatGetSubMatrices can return a submatrix when determining the index set like PCASM, but how can I get the index set including those layers of ghost points? When a DA is setup, such IS for creating ltog mapping was already destroyed.
Or you may have some simpler way to get this?
Bests,
Li Luo
________________________________
From: Mark Adams <mfadams at lbl.gov>
Sent: Monday, 14 March, 2022 22:49:47
To: liluo
Cc: petsc-users at mcs.anl.gov
Subject: Re: [petsc-users] How to obtain the local matrix from a global matrix in DMDA?
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<mailto: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/5a3a1987/attachment-0001.html>
More information about the petsc-users
mailing list