<html><head></head><body><div class="ydpd123507yahoo-style-wrap" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 13px;"><div></div>
<div dir="ltr" data-setdir="false">Thanks for all your input!</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">How can I set these options in the program instead of as runtime options (in the .petsc file)? For example, which subroutine shall I call to set '<span style="color: rgb(38, 40, 42);">-pc_factor_nonzeros_along_diagonal", and what is corresponding argument value?</span></div><div dir="ltr" data-setdir="false"><span style="color: rgb(38, 40, 42);"><br></span></div><div dir="ltr" data-setdir="false"><span style="color: rgb(38, 40, 42);">Thanks,</span></div><div dir="ltr" data-setdir="false"><span style="color: rgb(38, 40, 42);">Qin</span></div><div><br></div><div><br></div>
</div><div id="ydp23091541yahoo_quoted_5010808152" class="ydp23091541yahoo_quoted">
<div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
<div>
On Wednesday, July 8, 2020, 02:15:11 PM CDT, Barry Smith <bsmith@petsc.dev> wrote:
</div>
<div><br></div>
<div><br></div>
<div><div id="ydp23091541yiv0981914330"><div><div class="ydp23091541yiv0981914330"><br clear="none" class="ydp23091541yiv0981914330"></div> There is also -pc_factor_nonzeros_along_diagonal which reorders to move the zeros off the diagonal before the numerical factorization<div class="ydp23091541yiv0981914330"><br clear="none" class="ydp23091541yiv0981914330"></div><div class="ydp23091541yiv0981914330"> But if having 0 leads to a factorization without error then it will produce the correct answer (this means that zero got filled in during the factorization)<br clear="none" class="ydp23091541yiv0981914330"><div class="ydp23091541yiv0981914330yqt6069125025" id="ydp23091541yiv0981914330yqt04274"><div><br clear="none" class="ydp23091541yiv0981914330"><blockquote class="ydp23091541yiv0981914330" type="cite"><div class="ydp23091541yiv0981914330">On Jul 8, 2020, at 2:11 PM, Mark Adams <<a shape="rect" class="ydp23091541yiv0981914330" href="mailto:mfadams@lbl.gov" rel="nofollow" target="_blank">mfadams@lbl.gov</a>> wrote:</div><br clear="none" class="ydp23091541yiv0981914330Apple-interchange-newline"><div class="ydp23091541yiv0981914330"><div class="ydp23091541yiv0981914330" dir="ltr"><div class="ydp23091541yiv0981914330" dir="ltr"><br clear="none" class="ydp23091541yiv0981914330"></div><br clear="none" class="ydp23091541yiv0981914330"><div class="ydp23091541yiv0981914330gmail_quote"><div class="ydp23091541yiv0981914330gmail_attr" dir="ltr">On Wed, Jul 8, 2020 at 2:43 PM Qin Lu via petsc-users <<a shape="rect" class="ydp23091541yiv0981914330" href="mailto:petsc-users@mcs.anl.gov" rel="nofollow" target="_blank">petsc-users@mcs.anl.gov</a>> wrote:<br clear="none" class="ydp23091541yiv0981914330"></div><blockquote class="ydp23091541yiv0981914330gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex;"><div class="ydp23091541yiv0981914330"><div class="ydp23091541yiv0981914330" style="font-family:Helvetica, Arial, sans-serif;font-size:13px;"><div class="ydp23091541yiv0981914330" dir="ltr">Hello,</div><div class="ydp23091541yiv0981914330" dir="ltr"><br clear="none" class="ydp23091541yiv0981914330"></div><div class="ydp23091541yiv0981914330" dir="ltr">I am using the Petsc native direct solver <font class="ydp23091541yiv0981914330" face="Helvetica, Arial, sans-serif">(with KSPPREONLY and PCLU) to solver a small Linear equation system. The matrix has a couple of diagonal terms with value 0, which makes the solver fail. Then I set a very small value (e.g., 1e-10) at these terms and the solver works. Can this cause noticeable errors in the solution? </font></div></div></div></blockquote><div class="ydp23091541yiv0981914330"><br clear="none" class="ydp23091541yiv0981914330"></div><div class="ydp23091541yiv0981914330">Can't say.</div><div class="ydp23091541yiv0981914330"> </div><blockquote class="ydp23091541yiv0981914330gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex;"><div class="ydp23091541yiv0981914330"><div class="ydp23091541yiv0981914330" style="font-family:Helvetica, Arial, sans-serif;font-size:13px;"><div class="ydp23091541yiv0981914330" dir="ltr"><font class="ydp23091541yiv0981914330" face="Helvetica, Arial, sans-serif">Are there any options in Petsc to make the direct solver do row/column pivoting so that all the diagonal terms are non-zero?</font></div></div></div></blockquote><div class="ydp23091541yiv0981914330"><br clear="none" class="ydp23091541yiv0981914330"></div><div class="ydp23091541yiv0981914330">I see:</div><br clear="none" class="ydp23091541yiv0981914330"><br clear="none" class="ydp23091541yiv0981914330">-pc_factor_pivot_in_blocks <true,false>- allow pivoting within the small blocks during factorization (may increase stability of factorization.<br clear="none" class="ydp23091541yiv0981914330"><br clear="none" class="ydp23091541yiv0981914330">and<br clear="none" class="ydp23091541yiv0981914330"><br clear="none" class="ydp23091541yiv0981914330"><br clear="none" class="ydp23091541yiv0981914330">-pc_factor_shift_type <shifttype>- Sets shift type or PETSC_DECIDE for the default; use '-help' for a list of available types<br clear="none" class="ydp23091541yiv0981914330">-pc_factor_shift_amount <shiftamount>- Sets shift amount or PETSC_DECIDE for the default<br clear="none" class="ydp23091541yiv0981914330"><br clear="none" class="ydp23091541yiv0981914330"> <blockquote class="ydp23091541yiv0981914330gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex;"><div class="ydp23091541yiv0981914330"><div class="ydp23091541yiv0981914330" style="font-family:Helvetica, Arial, sans-serif;font-size:13px;"><div class="ydp23091541yiv0981914330" dir="ltr"><font class="ydp23091541yiv0981914330" face="Helvetica, Arial, sans-serif"><br clear="none" class="ydp23091541yiv0981914330"></font></div><div class="ydp23091541yiv0981914330" dir="ltr"><font class="ydp23091541yiv0981914330" face="Helvetica, Arial, sans-serif">Thanks for any suggestions.</font></div><div class="ydp23091541yiv0981914330" dir="ltr"><font class="ydp23091541yiv0981914330" face="Helvetica, Arial, sans-serif"><br clear="none" class="ydp23091541yiv0981914330"></font></div><div class="ydp23091541yiv0981914330" dir="ltr"><font class="ydp23091541yiv0981914330" face="Helvetica, Arial, sans-serif">Regards,</font></div><div class="ydp23091541yiv0981914330" dir="ltr"><font class="ydp23091541yiv0981914330" face="Helvetica, Arial, sans-serif">Qin</font></div></div></div></blockquote></div></div>
</div></blockquote></div></div><br clear="none" class="ydp23091541yiv0981914330"></div></div></div></div>
</div>
</div></body></html>