<div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 1, 2019 at 10:24 AM Matthew Knepley via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</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"><div dir="ltr">On Mon, Apr 1, 2019 at 10:22 AM Yingjie Wu via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>> wrote:<br></div><div class="gmail_quote"><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">Dear PETSc developers:<div>Hi,</div><div><p style="margin:0px;white-space:pre-wrap">I've been using -snes_mf_operator and I've customized a precondition matrix to solve my problem.I have two questions about the residuals of linear steps(KSP residual).</p><p style="margin:0px;white-space:pre-wrap"><br></p><p style="margin:0px;white-space:pre-wrap">1.Since I'm using a matrix-free method, how do we get KSP residuals in PETSc? </p><p style="margin:0px;white-space:pre-wrap"> r_m = b - A*x_m</p><p style="margin:0px;white-space:pre-wrap"> Is finite difference used to approximate "A*x_m" ?</p></div></div></blockquote><div><br></div><div>Yes.</div><div> </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"><div><p style="margin:0px;white-space:pre-wrap">2.What is the difference between instruction ' -ksp_monitor ' and ' -ksp_monitor_true_residual ' in how they are calculated? </p></div></div></blockquote><div><br></div><div>The true residual is the unpreconditioned residual.</div></div></div></blockquote><div><br></div><div>I actually have some specific understanding on "<span style="white-space:pre-wrap"> -ksp_monitor_true_residual</span>", but not sure it is right or not. If I am wrong, please correct me.</div><div><br></div><div>When the preconditioning matrix is super ill-conditioned, the ``true residual" is not necessary ``true" for the right preconditioning since an unwind process is applied. That is, <span style="white-space:pre-wrap"> "-ksp_monitor_true_residual" does not print ||b-Ax||, instead, it prints </span> the unpreconditioned residual by unpreconditioning the preconditioned residual.</div><div><br></div><div><br></div><div>Thanks,</div><div><br></div><div>Fande,</div><div><br></div><div> </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"><div class="gmail_quote"><div><br></div><div> Matt</div><div> </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"><div><p style="margin:0px;white-space:pre-wrap">Thanks,</p><p style="margin:0px;white-space:pre-wrap">Yingjie</p><p style="margin:0px;white-space:pre-wrap"><br></p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;text-align:justify;font-size:10.5pt;font-family:等线"><span lang="EN-US"></span></p><p style="margin:0px;white-space:pre-wrap"> <br></p></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail-m_-7239521809844990676gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>
</blockquote></div></div></div>