<div dir="ltr">From <a href="https://petsc.org/release/docs/manualpages/Mat/MatSetOption.html">https://petsc.org/release/docs/manualpages/Mat/MatSetOption.html</a>,<div><br><a href="https://petsc.org/release/docs/manualpages/Mat/MatOption.html#MatOption" style="font-family:Times;font-size:medium">MAT_KEEP_NONZERO_PATTERN</a><span style="color:rgb(0,0,0);font-family:Times;font-size:medium"> indicates when </span><a href="https://petsc.org/release/docs/manualpages/Mat/MatZeroRows.html#MatZeroRows" style="font-family:Times;font-size:medium">MatZeroRows</a><span style="color:rgb(0,0,0);font-family:Times;font-size:medium">() is called the zeroed entries are kept in the nonzero structure</span></div><div><font color="#000000" face="Times" size="3"><br></font></div><div><font color="#000000" face="Times" size="3">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:medium">MAT_NEW_NONZERO_ALLOCATION_ERR</a><span style="color:rgb(0,0,0);font-family:Times;font-size:medium"> to be false to do so.</span><font color="#000000" face="Times" size="3"><br></font><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><br></div><div dir="ltr">--Junchao Zhang</div></div></div><br></div></div></div><br><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">aph@email.arizona.edu</a>> wrote:<br></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">Hello,<div><br></div><div><font face="arial, sans-serif">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><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">Thanks,</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">Anthony</font></div></div>
</blockquote></div>