<div dir="ltr"><div dir="ltr">On Thu, Jul 4, 2019 at 7:30 PM Dave Lee via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">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">Hi PETSc,<br><div><br></div><div>I have a problem for which I need to exclude certain degrees of freedom from the evaluation of the norm as used to monitor the residual in FGMRES (don't ask!). Therefore I would like to replace the existing norm evaluation with my own version.</div><div><br></div><div>Currently this is done within:</div><div><font face="courier new, monospace">KSPFGMRESUpdateHessenberg(ksp,loc_it,hapend,&res_norm)</font></div><div>as:</div><div><font face="courier new, monospace">*res = PetscAbsScalar(*RS(it+1));</font><br></div><div><br></div><div>Firstly, I would like to make sure I can replicate the existing residual norm. I tried to do this as:</div><div><font face="courier new, monospace">KSPFGMRESUpdateHessenberg(ksp,loc_it,hapend,&res_norm);<br>KSPFGMRESBuildSoln(fgmres->nrs,ksp >vec_sol,tmp_sol,ksp,loc_it);<br>VecNorm(tmp_sol,NORM_2,&res_tmp);<br>VecNorm(ksp->vec_rhs,NORM_2,&res_rhs);<br></font></div><div><font face="courier new, monospace">res_norm = fabs(res_tmp-res_rhs);</font></div><div><br></div><div>But this doesn't match the norm that comes out of UpdateHessenberg.</div><div><br></div><div>Any ideas on how I can re-create the norm derived from UpdateHessenberg as an expansion over the Kyrlov vectors in FGMRES?</div></div></blockquote><div><br></div><div>Is there a reason you cannot just calculate the norm you want in a custom convergence criterion?</div><div><br></div><div>  <a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/KSP/KSPSetConvergenceTest.html">https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/KSP/KSPSetConvergenceTest.html</a></div><div><br></div><div>  Thanks,</div><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>Cheers, Dave.</div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_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>