[petsc-users] MatZeroRows and full assembly

Barry Smith bsmith at petsc.dev
Mon Sep 13 15:25:33 CDT 2021


  Sorry, my mistake. It is MatZeroRowsColumns() that ignores the MAT_KEEP_NONZERO_PATTERN <https://petsc.org/release/docs/manualpages/Mat/MatOption.html#MatOption>  option.

  Barry


> On Sep 13, 2021, at 4:04 PM, Junchao Zhang <junchao.zhang at gmail.com> wrote:
> 
> From https://petsc.org/release/docs/manualpages/Mat/MatSetOption.html <https://petsc.org/release/docs/manualpages/Mat/MatSetOption.html>,
> 
> MAT_KEEP_NONZERO_PATTERN <https://petsc.org/release/docs/manualpages/Mat/MatOption.html#MatOption> indicates when MatZeroRows <https://petsc.org/release/docs/manualpages/Mat/MatZeroRows.html#MatZeroRows>() is called the zeroed entries are kept in the nonzero structure
> 
> So, if you have this option  true and you set to a previous location, then it is fine, otherwise you also need MAT_NEW_NONZERO_ALLOCATION_ERR <https://petsc.org/release/docs/manualpages/Mat/MatOption.html#MatOption>  to be false to do so.
> 
> --Junchao Zhang
> 
> 
> On Mon, Sep 13, 2021 at 2:34 PM Anthony Paul Haas <aph at email.arizona.edu <mailto:aph at email.arizona.edu>> wrote:
> Hello,
> 
> Is it allowed after a MatZeroRows to insert more values in the row that was just zeroed with MatSetValues and then perform another full assembly of the matrix?
> 
> Thanks,
> 
> Anthony

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20210913/49b9c468/attachment.html>


More information about the petsc-users mailing list