[petsc-users] Do we support to use NORM_X instead of NORM_2 to check the convergence of KSP and SNES?

Smith, Barry F. bsmith at mcs.anl.gov
Wed Nov 28 16:03:26 CST 2018



> On Nov 28, 2018, at 3:20 PM, Fande Kong via petsc-users <petsc-users at mcs.anl.gov> wrote:
> 
> Hi Developers,
> 
> I just checked into the SNES and KSP code. We always hard code the Vec Norm as NORM_2 when computing the linear and nonlinear residuals. 
> 
> Does this mean we have to use norm_2 to check the convergence for both SNES and KSP?

   No, you can in theory use some other norm in a custom convergence test. BUT you get the NORM_2 essentially "for free" while using some other norm requires you to compute that norm; for SNES it is no big deal, just the cost of a VecNorm(NORM_INFINITY) for example. But for GMRES it is very expensive (one must compute the current solution then compute the residual then compute the residual's norm; because GMRES uses a recursive formula for the NORM_2 and does not actually compute the solution or the residual at each iteration only at the end).

   Barry

> 
> 
> Fande,



More information about the petsc-users mailing list