[petsc-users] How to set L1 norm as the converge test?

Barry Smith bsmith at mcs.anl.gov
Wed Sep 24 14:31:38 CDT 2014


  Brian,

    Your convergence test routine could call KSPBuildResidual() and then compute the 1-norm of the residual and make any decision it likes based on that norm.  See KSPSetConvergenceTest()

   Barry

On Sep 24, 2014, at 2:24 PM, Brian Yang <brianyang1106 at gmail.com> wrote:

> Thanks Mat and Barry,
> 
> Yes I want to use the L1 norm in the convergence test. For the ||Ax-b||, I always want to calculate L1 norm instead of L2. Is Mat's way gonna work on this?
> 
> On Wed, Sep 24, 2014 at 2:17 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
> 
>   Brian,
> 
>    Do you wish to monitor the convergence of the L1 norm, or do you wish to use the L1 norm in the convergence test?   Regardless you cannot change the LSQR or CG to be a different algorithm (with different convergence properties) with the L1 norm.
> 
> 
>   Barry
> 
> On Sep 24, 2014, at 2:08 PM, Brian Yang <brianyang1106 at gmail.com> wrote:
> 
> > Hi all,
> >
> > For example, I am using LSQR or CG to solve Ax=b.
> >
> > When we turn on the monitor option of solving the linear system, we could see iteration number and residual for each iteration. I believe it's L2 norm of the objective function?
> >
> > If yes, is there a way that I could set it to L1 norm for solving the system?
> >
> > Thanks.
> >
> > --
> > Brian Yang
> > U of Houston
> >
> >
> >
> 
> 
> 
> 
> -- 
> Brian Yang
> U of Houston
> 
> 
> 



More information about the petsc-users mailing list