<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div>  Sorry, my mistake. It is MatZeroRowsColumns() that ignores the <a href="https://petsc.org/release/docs/manualpages/Mat/MatOption.html#MatOption" class="" style="font-family: Times; font-size: inherit;">MAT_KEEP_NONZERO_PATTERN</a><span class="" style="font-family: Times; font-size: inherit;">  option.</span><div class=""><font face="Times" class=""><br class=""></font></div><div class=""><font face="Times" class="">  Barry</font></div><div class=""><font face="Times" class=""><br class=""></font><div><br class=""><blockquote type="cite" class=""><div class="">On Sep 13, 2021, at 4:04 PM, Junchao Zhang <<a href="mailto:junchao.zhang@gmail.com" class="">junchao.zhang@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">From <a href="https://petsc.org/release/docs/manualpages/Mat/MatSetOption.html" class="">https://petsc.org/release/docs/manualpages/Mat/MatSetOption.html</a>,<div class=""><br class=""><a href="https://petsc.org/release/docs/manualpages/Mat/MatOption.html#MatOption" style="font-family: Times; font-size: inherit;" class="">MAT_KEEP_NONZERO_PATTERN</a><span style="font-family: Times; font-size: inherit;" class=""> indicates when </span><a href="https://petsc.org/release/docs/manualpages/Mat/MatZeroRows.html#MatZeroRows" style="font-family: Times; font-size: inherit;" class="">MatZeroRows</a><span style="font-family: Times; font-size: inherit;" class="">() is called the zeroed entries are kept in the nonzero structure</span></div><div class=""><font face="Times" size="3" class=""><br class=""></font></div><div class=""><font face="Times" size="3" class="">So, if you have this option  true and you set to a previous location, then it is fine, otherwise you also need </font><a href="https://petsc.org/release/docs/manualpages/Mat/MatOption.html#MatOption" style="font-family: Times; font-size: inherit;" class="">MAT_NEW_NONZERO_ALLOCATION_ERR</a><span style="font-family: Times; font-size: inherit;" class="">  to be false to do so.</span><font face="Times" size="3" class=""><br class=""></font><div class=""><div class=""><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><br class=""></div><div dir="ltr" class="">--Junchao Zhang</div></div></div><br class=""></div></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 13, 2021 at 2:34 PM Anthony Paul Haas <<a href="mailto:aph@email.arizona.edu" class="">aph@email.arizona.edu</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr" class="">Hello,<div class=""><br class=""></div><div class=""><font face="arial, sans-serif" class="">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?</font></div><div class=""><font face="arial, sans-serif" class=""><br class=""></font></div><div class=""><font face="arial, sans-serif" class="">Thanks,</font></div><div class=""><font face="arial, sans-serif" class=""><br class=""></font></div><div class=""><font face="arial, sans-serif" class="">Anthony</font></div></div>
</blockquote></div>
</div></blockquote></div><br class=""></div></body></html>