mirror of
https://github.com/sfilippone/psblas3.git
synced 2026-10-20 12:52:14 +00:00
New stop criteria
This commit is contained in:
@@ -104,7 +104,7 @@
|
||||
!
|
||||
!
|
||||
Subroutine psb_ccgstabl_vect(a,prec,b,x,eps,desc_a,info,&
|
||||
& itmax,iter,err,itrace,irst,istop)
|
||||
& itmax,iter,err,itrace,irst,istop,s1,s2)
|
||||
use psb_base_mod
|
||||
use psb_prec_mod
|
||||
use psb_c_linsolve_conv_mod
|
||||
@@ -120,6 +120,7 @@ Subroutine psb_ccgstabl_vect(a,prec,b,x,eps,desc_a,info,&
|
||||
integer(psb_ipk_), Optional, Intent(in) :: itmax, itrace, irst,istop
|
||||
integer(psb_ipk_), Optional, Intent(out) :: iter
|
||||
Real(psb_spk_), Optional, Intent(out) :: err
|
||||
type(psb_c_vect_type), intent(inout), optional :: s1, s2
|
||||
! = local data
|
||||
complex(psb_spk_), allocatable, target :: aux(:), gamma(:),&
|
||||
& gamma1(:), gamma2(:), taum(:,:), sigma(:)
|
||||
@@ -172,8 +173,29 @@ Subroutine psb_ccgstabl_vect(a,prec,b,x,eps,desc_a,info,&
|
||||
if (present(istop)) then
|
||||
istop_ = istop
|
||||
else
|
||||
istop_ = 2
|
||||
istop_ = psb_get_istop_default()
|
||||
endif
|
||||
if (.not.psb_is_valid_istop(istop_)) then
|
||||
info=psb_err_invalid_istop_
|
||||
err=info
|
||||
call psb_errpush(info,name,i_err=(/istop_/))
|
||||
goto 9999
|
||||
end if
|
||||
!
|
||||
! istop_ = 1: normwise backward error, infinity norm
|
||||
! istop_ = 2: ||r||/||b|| norm 2
|
||||
!
|
||||
select case(istop_)
|
||||
case(psb_istop_ani_,psb_istop_bn2_,&
|
||||
& psb_istop_rn2_abs_, psb_istop_rrn2_)
|
||||
! nothing needed
|
||||
case default
|
||||
! should never get here
|
||||
info=psb_err_internal_error_
|
||||
err=info
|
||||
call psb_errpush(info,name,a_err="invalid istop_")
|
||||
goto 9999
|
||||
end select
|
||||
|
||||
if (present(itmax)) then
|
||||
itmax_ = itmax
|
||||
@@ -246,7 +268,8 @@ Subroutine psb_ccgstabl_vect(a,prec,b,x,eps,desc_a,info,&
|
||||
rt0 => wwrk(10)
|
||||
|
||||
|
||||
call psb_init_conv(methdname,istop_,itrace_,itmax_,a,x,b,eps,desc_a,stopdat,info)
|
||||
call psb_init_conv(methdname,istop_,itrace_,itmax_,a,x,b,eps,&
|
||||
& desc_a,stopdat,info,s1=s1,s2=s2)
|
||||
if (info /= psb_success_) Then
|
||||
call psb_errpush(psb_err_from_subroutine_non_,name)
|
||||
goto 9999
|
||||
@@ -284,7 +307,7 @@ Subroutine psb_ccgstabl_vect(a,prec,b,x,eps,desc_a,info,&
|
||||
& write(debug_unit,*) me,' ',trim(name),&
|
||||
& ' on entry to amax: b: ',b%get_nrows()
|
||||
|
||||
if (psb_check_conv(methdname,itx,x,r,desc_a,stopdat,info)) exit restart
|
||||
if (psb_check_conv(methdname,itx,x,r,desc_a,stopdat,info,s1=s1)) exit restart
|
||||
if (info /= psb_success_) Then
|
||||
call psb_errpush(psb_err_from_subroutine_non_,name)
|
||||
goto 9999
|
||||
@@ -388,7 +411,7 @@ Subroutine psb_ccgstabl_vect(a,prec,b,x,eps,desc_a,info,&
|
||||
call psb_geaxpby(-gamma1(j),rh(j),cone,rh(0),desc_a,info)
|
||||
enddo
|
||||
|
||||
if (psb_check_conv(methdname,itx,x,rh(0),desc_a,stopdat,info)) exit restart
|
||||
if (psb_check_conv(methdname,itx,x,rh(0),desc_a,stopdat,info,s1=s1)) exit restart
|
||||
if (info /= psb_success_) Then
|
||||
call psb_errpush(psb_err_from_subroutine_non_,name)
|
||||
goto 9999
|
||||
|
||||
Reference in New Issue
Block a user