[petsc-users] Question about MatCreateSubMatrix

Manav Bhatia bhatiamanav at gmail.com
Thu Mar 29 16:02:24 CDT 2018


Thanks, Matt. 

I also read page 72 in the manual about creating and assembling matrices. 

Just so that I understand correctly, MatGetLocalSubMatrix is a generic call to create submatrices in the split-local or split-global space? So, it is primarily a matter of the isrow and iscol? 

The manual says that this provides a “view” matrix, so any updates to this submatrix should show up in the global? 

How is MatCreateSubMatrixVirtual different? Is this different from a “view” matrix? 


> On Mar 29, 2018, at 3:10 PM, Matthew Knepley <knepley at gmail.com> wrote:
> 
> On Thu, Mar 29, 2018 at 3:28 PM, Manav Bhatia <bhatiamanav at gmail.com <mailto: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 <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/10681255/attachment.html>


More information about the petsc-users mailing list