<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br class="webkit-block-placeholder"></div> To calculate the true residual norm at each iteration of left preconditioned GMRES requires<div>actually forming b - A*x which means computing A*x which means computing x (which is not available</div><div>without additional calculations at each iteration). This is why we do not support left preconditioning with </div><div>true residual norm convergence test.</div><div><br class="webkit-block-placeholder"></div><div> You should use the KSP type of FGMRES, it is written using right preconditioning and for a standard PC</div><div>is identical to regular GMRES.</div><div><br class="webkit-block-placeholder"></div><div> Barry</div><div><br class="webkit-block-placeholder"></div><div><div><div>On Feb 2, 2008, at 10:09 AM, jiaxun hou wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Thank you, Dave. But there is still a question: how can I get the residual vector in each iteration? It seems difficult to get it without modifying the GMRES codes.<br><br>Best regards,<br>Jiaxun<br><b><i>Dave May <<a href="mailto:dave.mayhem23@gmail.com">dave.mayhem23@gmail.com</a>></i></b> дµÀ£º<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> Hi,<br> You can use the function<br><pre>PetscErrorCode PETSCKSP_DLLEXPORT KSPSetConvergenceTest(KSP ksp,PetscErrorCode (*converge)(KSP,PetscInt,PetscReal,KSPConvergedReason*,void*),void *cctx)</pre>to define your own convergence test.<br> <br>Cheers,<br> Dave.<br><br><br><br><br><br><div class="gmail_quote">2008/2/2 jiaxun hou <<a href="mailto:jiaxun_hou@yahoo.com.cn">jiaxun_hou@yahoo.com.cn</a>>:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Hi everyone,<br><br>I want to use the Left Preconditioned GMRES to solve a linear system, and the stopping criterion must be based on the actual residuals (b-Ax). But the GMRES codes of PETSc seems to use the preconditioned residuals (B^-1(b-Ax)) only. In addition, when I set KSPSetNormType(ksp,KSP_NORM_UNPRECONDITIONED), I receive the error message: "Currently can use GMRES with only preconditioned residual (right preconditioning not coded)". So, is there any way to set stopping criterion based on the actual residuals?<br> <br>Best regards,<br>Jiaxun<br> <div> </div><hr size="1"><a href="http://cn.mail.yahoo.com/gc/index.html?entry=5&souce=mail_mailletter_tagline" target="_blank">ÑÅ»¢ÓÊÏä´«µÝÐÂÄê×£¸££¬¸öÐԺؿ¨ËÍÇ×Åó£¡</a> </blockquote></div><br> </blockquote><br><div> <br class="webkit-block-placeholder"></div><hr size="1"><a href="http://cn.mail.yahoo.com/gc/index.html?entry=5&souce=mail_mailletter_tagline">ÑÅ»¢ÓÊÏä´«µÝÐÂÄê×£¸££¬¸öÐԺؿ¨ËÍÇ×Åó£¡</a> </blockquote></div><br></div></body></html>