<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Mar 22, 2016 at 8:25 AM, Norihiro Watanabe <span dir="ltr"><<a href="mailto:norihiro.w@gmail.com" target="_blank">norihiro.w@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thank you Matt!<br>
<br>
Actually I don't want to change a norm type used in a convergence<br>
check. I just want to output a relative error which PETSc actually<br>
used for a convergence check (for log output in my program without<br>
-ksp_*) and thought I need to have a norm of a preconditioned RHS to<br>
compute it by myself. Or is there any function available in PETSc<br>
which returns the relative error or the tolerance multiplied by the<br>
norm of a preconditioned RHS? I couldn't find it.<br></blockquote><div><br></div><div>If you want the action of the preconditioner, you can pull it out</div><div><br></div><div>  KSPGetPC()</div><div><br></div><div>and apply it</div><div><br></div><div>  PCApply()</div><div><br></div><div>but I still do not understand why you want this. Do you want to check the norms</div><div>yourself? The PCApply() could be expensive to calculate again.</div><div><br></div><div>  Thanks,</div><div><br></div><div>     Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Best,<br>
Nori<br>
<br>
<br>
On Tue, Mar 22, 2016 at 1:51 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>> wrote:<br>
> On Tue, Mar 22, 2016 at 2:50 AM, Norihiro Watanabe <<a href="mailto:norihiro.w@gmail.com">norihiro.w@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Hi,<br>
>><br>
>> Is it correct that a norm of a preconditioned RHS vector is used to<br>
>> compute a relative error in BCGS?<br>
><br>
><br>
> Yes, but you can verify this using -ksp_view<br>
><br>
>><br>
>> I'm testing BCGS + BoomerAMG. With "-info", PETSc says "initial right<br>
>> hand side norm" is 2.223619476717e+10 (see below) but an actual norm<br>
>> of the RHS I passed is 4.059007e-02. If yes, is there any way to get a<br>
>> norm of a preconditioned RHS?<br>
><br>
><br>
> Do you mean unpreconditioned? You can try<br>
><br>
><br>
> <a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/KSP/KSPSetNormType.html" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/KSP/KSPSetNormType.html</a><br>
><br>
> or use<br>
><br>
>   -ksp_monitor_true_residual<br>
><br>
>   Thanks,<br>
><br>
>     Matt<br>
><br>
>><br>
>> [0] KSPConvergedDefault(): Linear solver has converged. Residual norm<br>
>> 2.036064453512e-02 is less than relative tolerance 9.999999960042e-13<br>
>> times initial right hand side norm 2.223619476717e+10 at iteration 6<br>
>><br>
>><br>
>> Regards,<br>
>> Nori<br>
>><br>
>> --<br>
>> Norihiro Watanabe<br>
><br>
><br>
><br>
<span class="HOEnZb"><font color="#888888">><br>
> --<br>
> What most experimenters take for granted before they begin their experiments<br>
> is infinitely more interesting than any results to which their experiments<br>
> lead.<br>
> -- Norbert Wiener<br>
<br>
<br>
<br>
--<br>
Norihiro Watanabe<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">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></div>