> On Nov 28, 2018, at 3:20 PM, Fande Kong via petsc-users 
> <petsc-users@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,

Reply via email to