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.zh...@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 <a...@email.arizona.edu > <mailto:a...@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