[petsc-users] Computing residual norm in KSPFGMRESCycle()

Matthew Knepley knepley at gmail.com
Thu Jul 4 19:55:32 CDT 2019


On Thu, Jul 4, 2019 at 7:30 PM Dave Lee via petsc-users <
petsc-users at mcs.anl.gov> wrote:

> Hi PETSc,
>
> 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.
>
> Currently this is done within:
> KSPFGMRESUpdateHessenberg(ksp,loc_it,hapend,&res_norm)
> as:
> *res = PetscAbsScalar(*RS(it+1));
>
> Firstly, I would like to make sure I can replicate the existing residual
> norm. I tried to do this as:
> KSPFGMRESUpdateHessenberg(ksp,loc_it,hapend,&res_norm);
> KSPFGMRESBuildSoln(fgmres->nrs,ksp >vec_sol,tmp_sol,ksp,loc_it);
> VecNorm(tmp_sol,NORM_2,&res_tmp);
> VecNorm(ksp->vec_rhs,NORM_2,&res_rhs);
> res_norm = fabs(res_tmp-res_rhs);
>
> But this doesn't match the norm that comes out of UpdateHessenberg.
>
> Any ideas on how I can re-create the norm derived from UpdateHessenberg as
> an expansion over the Kyrlov vectors in FGMRES?
>

Is there a reason you cannot just calculate the norm you want in a custom
convergence criterion?


https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/KSP/KSPSetConvergenceTest.html

  Thanks,

    Matt


> Cheers, Dave.
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190704/2d645344/attachment.html>


More information about the petsc-users mailing list