changes in KSP convergence tests

Barry Smith bsmith at mcs.anl.gov
Sat Oct 20 14:38:40 CDT 2007


  I have added code to generate an error if KSP_NORM_NO is used in this 
case.

  Barry


On Fri, 19 Oct 2007, Lisandro Dalcin wrote:

> I've fixed KSPDestroy() to use user provided destroy routine for
> convergence context. Please review.
> 
> BTW, from some time ago in petsc4py I hack things to use the default
> convergence test as below. Does it make sense to use this on
> KSPDefaultConverged? If not, I thing an error should be generated if
> the norm type is KSP_NORM_NO. What do you think?
> 
> #undef __FUNCT__
> #define __FUNCT__ "KSPDefaultConverged_Safe"
> static PetscErrorCode
> KSPDefaultConverged_Safe(KSP ksp,
> 			 PetscInt its, PetscReal rnorm,
> 			 KSPConvergedReason* reason, void* ctx)
> {
>   KSPNormType    normtype;
>   PetscErrorCode ierr;
>   PetscFunctionBegin;
>   ierr = KSPGetNormType(ksp, &normtype); CHKERRQ(ierr);
>   if (normtype == KSP_NORM_NO) {
>     ierr = KSPSkipConverged(ksp,its,rnorm,reason,ctx);CHKERRQ(ierr);
>   } else {
>     ierr = KSPDefaultConverged(ksp,its,rnorm,reason,ctx);CHKERRQ(ierr);
>   }
>   PetscFunctionReturn(0);
> }
> 
> 
> 
> 




More information about the petsc-dev mailing list