Hi Matt,<br>Thanks for the pointer.<br><br>Yan<br><br><div class="gmail_quote">On Mon, Sep 21, 2009 at 2:40 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">You can use KSPBuildResidual().<br><br> Matt<div><div></div><div class="h5"><br><br><div class="gmail_quote">
On Mon, Sep 21, 2009 at 12:44 PM, Ryan Yan <span dir="ltr"><<a href="mailto:vyan2000@gmail.com" target="_blank">vyan2000@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi All,<br>The following question is only for test and comparison reason.<br><br>Is there a command line option to set up using 1-Norm(sum of absolute value of residuals) as convergence monitor and test.<br><br>Alternatively, if I can get the residual "r" out at the end of each
iteration, then it is going to be much simpler, since I can just call
VecNorm(r, NORM_1, &r_ell1) and pass the r_ell1 into the convergence monitor and test. Can anyone inform me if PETSc has an interface for the resuidual r?<br><br>Or one has to call the convergence test:<br>MyKSPConverged(ksp,n,rnorm,flag,dummy);<br>
and following the steps:<br>1. fetch the exact solution:<br><br>KSPBuildSolution(ksp,PETSC_NULL_OBJECT,x,ierr)<br><br>2. calculate the residual:<br><br>pass the Right Hand side and the Matrix in to calculate the 1-Norm. But this step is *not* obvious, since the matrix and rhs is already distributed over each processes.<br>
<br>3. set up the convergence test based on the 1_Norm residual.<br><br><br>Thank you very much,<br><font color="#888888"><br><br>Yan<br>
</font></blockquote></div><br><br clear="all"><br></div></div><font color="#888888">-- <br>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<br>
</font></blockquote></div><br>