|
|
@ -135,7 +135,7 @@ subroutine amg_d_poly_smoother_apply_vect(alpha,sm,x,beta,y,desc_data,trans,&
|
|
|
|
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)
|
|
|
|
cr = (8*i*done-4)/((2*i*done+done)*sm%rho_ba)
|
|
|
|
cr = (8*i*done-4)/((2*i*done+done)*sm%rho_ba)
|
|
|
|
if (.false.) then
|
|
|
|
if (.false.) then
|
|
|
|
! z_k = cz z_{k-1} + cr ty = cz z_{k-1} + cr Br_{k-1}
|
|
|
|
! z_k = cz z_{k-1} + cr ty = cz z_{k-1} + cr Br_{k-1}
|
|
|
|
call psb_geaxpby(cr,ty,cz,tz,desc_data,info)
|
|
|
|
call psb_geaxpby(cr,ty,cz,tz,desc_data,info)
|
|
|
|
! r_k = b-Ax_k = x -A tx
|
|
|
|
! r_k = b-Ax_k = x -A tx
|
|
|
@ -175,7 +175,7 @@ subroutine amg_d_poly_smoother_apply_vect(alpha,sm,x,beta,y,desc_data,trans,&
|
|
|
|
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)
|
|
|
|
cr = (8*i*done-4)/((2*i*done+done)*sm%rho_ba)
|
|
|
|
cr = (8*i*done-4)/((2*i*done+done)*sm%rho_ba)
|
|
|
|
if (.false.) then
|
|
|
|
if (.false.) then
|
|
|
|
! z_k = cz z_{k-1} + cr ty = cz z_{k-1} + cr Br_{k-1}
|
|
|
|
! z_k = cz z_{k-1} + cr ty = cz z_{k-1} + cr Br_{k-1}
|
|
|
|
call psb_geaxpby(cr,ty,cz,tz,desc_data,info)
|
|
|
|
call psb_geaxpby(cr,ty,cz,tz,desc_data,info)
|
|
|
|
! r_k = b-Ax_k = x -A tx
|
|
|
|
! r_k = b-Ax_k = x -A tx
|
|
|
@ -201,7 +201,6 @@ 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(sm%pdegree)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
theta = (done+sm%cf_a)/2
|
|
|
|
theta = (done+sm%cf_a)/2
|
|
|
|
delta = (done-sm%cf_a)/2
|
|
|
|
delta = (done-sm%cf_a)/2
|
|
|
@ -209,25 +208,25 @@ subroutine amg_d_poly_smoother_apply_vect(alpha,sm,x,beta,y,desc_data,trans,&
|
|
|
|
rho_old = done/sigma
|
|
|
|
rho_old = done/sigma
|
|
|
|
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')
|
|
|
|
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)
|
|
|
|
if (.false.) then
|
|
|
|
if (.false.) then
|
|
|
|
call psb_geaxpby((done/theta),r,dzero,tz,desc_data,info)
|
|
|
|
call psb_geaxpby((done/theta),r,dzero,tz,desc_data,info)
|
|
|
|
call psb_geaxpby(done,tz,done,tx,desc_data,info)
|
|
|
|
call psb_geaxpby(done,tz,done,tx,desc_data,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
call psb_abgdxyz((done/theta),dzero,done,done,r,tz,tx,desc_data,info)
|
|
|
|
call psb_abgdxyz((done/theta),dzero,done,done,r,tz,tx,desc_data,info)
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
! tz == d
|
|
|
|
! tz == d
|
|
|
|
do i=1, sm%pdegree
|
|
|
|
do i=1, sm%pdegree-1
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! r_{k-1} = r_k - (1/rho(BA)) B A d_k
|
|
|
|
! r_{k-1} = r_k - (1/rho(BA)) B A d_k
|
|
|
|
call psb_spmm(done,sm%pa,tz,dzero,ty,desc_data,info,work=aux,trans=trans_)
|
|
|
|
call psb_spmm(done,sm%pa,tz,dzero,ty,desc_data,info,work=aux,trans=trans_)
|
|
|
|
call sm%sv%apply(-done,ty,done,r,desc_data,trans_,aux,wv(5:),info,init='Z')
|
|
|
|
call sm%sv%apply(-(done/sm%rho_ba),ty,done,r,desc_data,trans_,aux,wv(5:),info,init='Z')
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! d_{k+1} = (rho rho_old) d_k + 2(rho/delta) r_{k+1}
|
|
|
|
! d_{k+1} = (rho rho_old) d_k + 2(rho/delta) r_{k+1}
|
|
|
|
rho = done/(2*sigma - rho_old)
|
|
|
|
rho = done/(2*sigma - rho_old)
|
|
|
|
if (.false.) then
|
|
|
|
if (.false.) then
|
|
|
|
call psb_geaxpby((2*rho/delta),r,(rho*rho_old),tz,desc_data,info)
|
|
|
|
call psb_geaxpby((2*rho/delta),r,(rho*rho_old),tz,desc_data,info)
|
|
|
|
call psb_geaxpby(done,tz,done,tx,desc_data,info)
|
|
|
|
call psb_geaxpby(done,tz,done,tx,desc_data,info)
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -236,6 +235,7 @@ subroutine amg_d_poly_smoother_apply_vect(alpha,sm,x,beta,y,desc_data,trans,&
|
|
|
|
!!$ res = psb_genrm2(r,desc_data,info)
|
|
|
|
!!$ res = psb_genrm2(r,desc_data,info)
|
|
|
|
!!$ write(0,*) 'Polynomial smoother NEW ',i,res
|
|
|
|
!!$ write(0,*) 'Polynomial smoother NEW ',i,res
|
|
|
|
! x_k = x_{k-1} + z_k
|
|
|
|
! x_k = x_{k-1} + z_k
|
|
|
|
|
|
|
|
rho_old = rho
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end block
|
|
|
|
end block
|
|
|
|
|
|
|
|
|
|
|
|