ell1 norm convergence test
Matthew Knepley
knepley at gmail.com
Mon Sep 21 13:40:29 CDT 2009
You can use KSPBuildResidual().
Matt
On Mon, Sep 21, 2009 at 12:44 PM, Ryan Yan <vyan2000 at gmail.com> wrote:
> Hi All,
> The following question is only for test and comparison reason.
>
> Is there a command line option to set up using 1-Norm(sum of absolute value
> of residuals) as convergence monitor and test.
>
> Alternatively, if I can get the residual "r" out at the end of each
> iteration, then it is going to be much simpler, since I can just call
> VecNorm(r, NORM_1, &r_ell1) and pass the r_ell1 into the convergence monitor
> and test. Can anyone inform me if PETSc has an interface for the resuidual
> r?
>
> Or one has to call the convergence test:
> MyKSPConverged(ksp,n,rnorm,flag,dummy);
> and following the steps:
> 1. fetch the exact solution:
>
> KSPBuildSolution(ksp,PETSC_NULL_OBJECT,x,ierr)
>
> 2. calculate the residual:
>
> pass the Right Hand side and the Matrix in to calculate the 1-Norm. But
> this step is *not* obvious, since the matrix and rhs is already distributed
> over each processes.
>
> 3. set up the convergence test based on the 1_Norm residual.
>
>
> Thank you very much,
>
>
> Yan
>
--
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20090921/1a535518/attachment.htm>
More information about the petsc-users
mailing list