|
|
@ -49,7 +49,7 @@ subroutine amg_d_poly_smoother_apply_vect(alpha,sm,x,beta,y,desc_data,trans,&
|
|
|
|
type(psb_d_vect_type),intent(inout) :: y
|
|
|
|
type(psb_d_vect_type),intent(inout) :: y
|
|
|
|
real(psb_dpk_),intent(in) :: alpha,beta
|
|
|
|
real(psb_dpk_),intent(in) :: alpha,beta
|
|
|
|
character(len=1),intent(in) :: trans
|
|
|
|
character(len=1),intent(in) :: trans
|
|
|
|
integer(psb_ipk_), intent(in) :: sweeps
|
|
|
|
integer(psb_ipk_), intent(in) :: sweeps ! this is ignored here, the polynomial degree dictates the value
|
|
|
|
real(psb_dpk_),target, intent(inout) :: work(:)
|
|
|
|
real(psb_dpk_),target, intent(inout) :: work(:)
|
|
|
|
type(psb_d_vect_type),intent(inout) :: wv(:)
|
|
|
|
type(psb_d_vect_type),intent(inout) :: wv(:)
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
@ -115,7 +115,7 @@ subroutine amg_d_poly_smoother_apply_vect(alpha,sm,x,beta,y,desc_data,trans,&
|
|
|
|
& a_err='invalid wv size in smoother_apply')
|
|
|
|
& a_err='invalid wv size in smoother_apply')
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
sm%pdegree = sweeps
|
|
|
|
|
|
|
|
associate(tx => wv(1), ty => wv(2), tz => wv(3), r => wv(4))
|
|
|
|
associate(tx => wv(1), ty => wv(2), tz => wv(3), r => wv(4))
|
|
|
|
|
|
|
|
|
|
|
|
call psb_geaxpby(done,x,dzero,r,desc_data,info)
|
|
|
|
call psb_geaxpby(done,x,dzero,r,desc_data,info)
|
|
|
@ -130,7 +130,7 @@ subroutine amg_d_poly_smoother_apply_vect(alpha,sm,x,beta,y,desc_data,trans,&
|
|
|
|
! b == x
|
|
|
|
! b == x
|
|
|
|
! x == tx
|
|
|
|
! x == tx
|
|
|
|
!
|
|
|
|
!
|
|
|
|
do i=1, sweeps
|
|
|
|
do i=1, sm%pdegree
|
|
|
|
! B r_{k-1}
|
|
|
|
! B r_{k-1}
|
|
|
|
call sm%sv%apply(done,r,dzero,ty,desc_data,trans_,aux,wv(5:),info,init='Z')
|
|
|
|
call sm%sv%apply(done,r,dzero,ty,desc_data,trans_,aux,wv(5:),info,init='Z')
|
|
|
|
cz = (2*i*done-3)/(2*i*done+done)
|
|
|
|
cz = (2*i*done-3)/(2*i*done+done)
|
|
|
@ -159,14 +159,14 @@ subroutine amg_d_poly_smoother_apply_vect(alpha,sm,x,beta,y,desc_data,trans,&
|
|
|
|
! x == tx
|
|
|
|
! x == tx
|
|
|
|
!
|
|
|
|
!
|
|
|
|
if (allocated(sm%poly_beta)) then
|
|
|
|
if (allocated(sm%poly_beta)) then
|
|
|
|
if (size(sm%poly_beta) /= sweeps) deallocate(sm%poly_beta)
|
|
|
|
if (size(sm%poly_beta) /= sm%pdegree) deallocate(sm%poly_beta)
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
if (.not.allocated(sm%poly_beta)) then
|
|
|
|
if (.not.allocated(sm%poly_beta)) then
|
|
|
|
call psb_realloc(sweeps,sm%poly_beta,info)
|
|
|
|
call psb_realloc(sm%pdegree,sm%poly_beta,info)
|
|
|
|
sm%poly_beta(1:sweeps) = amg_d_poly_beta_mat(1:sweeps,sweeps)
|
|
|
|
sm%poly_beta(1:sm%pdegree) = amg_d_poly_beta_mat(1:sm%pdegree,sm%pdegree)
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
do i=1, sweeps
|
|
|
|
do i=1, sm%pdegree
|
|
|
|
! B r_{k-1}
|
|
|
|
! B r_{k-1}
|
|
|
|
call sm%sv%apply(done,r,dzero,ty,desc_data,trans_,aux,wv(5:),info,init='Z')
|
|
|
|
call sm%sv%apply(done,r,dzero,ty,desc_data,trans_,aux,wv(5:),info,init='Z')
|
|
|
|
cz = (2*i*done-3)/(2*i*done+done)
|
|
|
|
cz = (2*i*done-3)/(2*i*done+done)
|
|
|
@ -193,7 +193,7 @@ subroutine amg_d_poly_smoother_apply_vect(alpha,sm,x,beta,y,desc_data,trans,&
|
|
|
|
! b == x
|
|
|
|
! b == x
|
|
|
|
! x == tx
|
|
|
|
! x == tx
|
|
|
|
!
|
|
|
|
!
|
|
|
|
sm%cf_a = amg_d_poly_a_vect(sweeps)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
theta = (done+sm%cf_a)/2
|
|
|
|
theta = (done+sm%cf_a)/2
|
|
|
|
delta = (done-sm%cf_a)/2
|
|
|
|
delta = (done-sm%cf_a)/2
|
|
|
@ -203,7 +203,7 @@ subroutine amg_d_poly_smoother_apply_vect(alpha,sm,x,beta,y,desc_data,trans,&
|
|
|
|
call psb_geaxpby((done/sm%rho_ba),ty,dzero,r,desc_data,info)
|
|
|
|
call psb_geaxpby((done/sm%rho_ba),ty,dzero,r,desc_data,info)
|
|
|
|
call psb_geaxpby((done/theta),r,dzero,tz,desc_data,info)
|
|
|
|
call psb_geaxpby((done/theta),r,dzero,tz,desc_data,info)
|
|
|
|
! tz == d
|
|
|
|
! tz == d
|
|
|
|
do i=1, sweeps
|
|
|
|
do i=1, sm%pdegree
|
|
|
|
! x_{k+1} = x_k + d_k
|
|
|
|
! x_{k+1} = x_k + d_k
|
|
|
|
call psb_geaxpby(done,tz,done,tx,desc_data,info)
|
|
|
|
call psb_geaxpby(done,tz,done,tx,desc_data,info)
|
|
|
|
!
|
|
|
|
!
|
|
|
|