[petsc-users] Question about MatCreateSubMatrix

Matthew Knepley knepley at gmail.com
Thu Mar 29 15:10:40 CDT 2018


On Thu, Mar 29, 2018 at 3:28 PM, Manav Bhatia <bhatiamanav at gmail.com> wrote:

> Hi,
>
>   I have quick questions about MatCreateSubMatrix:
>
> — Once the sub matrix is created, do I need to keep the IS (isrow and
> iscol) in memory till this matrix is active, or can I destroy it
> immediately after the creation of the matrix and continue to use the matrix?
>

You can destroy it.


> — Is the assembly begin/end supposed to be called on the submatrix or the
> original full matrix? Is it a problem is I call this on both?
>

The SubMatrix is not a view. Its a fully independent matrix.


> — If I modify values in the sub matrix, would these be reflected in the
> original matrix after assembly begin/end, or do I need to do something else
> for that to happen?
>

No. Do you want something like this


http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatGetLocalSubMatrix.html

  Thanks,

    Matt


> Thanks,
> Manav
>
>
>


-- 
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.caam.rice.edu/~mk51/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180329/a68b7a8a/attachment.html>


More information about the petsc-users mailing list