|
|
@ -114,6 +114,66 @@ subroutine mld_c_jac_smoother_apply(alpha,sm,x,beta,y,desc_data,&
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
else if (sweeps >= 0) then
|
|
|
|
else if (sweeps >= 0) then
|
|
|
|
|
|
|
|
if (associated(sm%pa)) then
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! This means we are dealing with a pure Jacobi smoother/solver.
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
call psb_geasb(tx,desc_data,info)
|
|
|
|
|
|
|
|
call psb_geasb(ty,desc_data,info)
|
|
|
|
|
|
|
|
select case (init_)
|
|
|
|
|
|
|
|
case('Z')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
call sm%sv%apply(cone,x,czero,ty,desc_data,trans_,aux,info,init='Z')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case('Y')
|
|
|
|
|
|
|
|
call psb_geaxpby(cone,x,czero,tx,desc_data,info)
|
|
|
|
|
|
|
|
call psb_geaxpby(cone,y,czero,ty,desc_data,info)
|
|
|
|
|
|
|
|
call psb_spmm(-cone,sm%pa,ty,cone,tx,desc_data,info,work=aux,trans=trans_)
|
|
|
|
|
|
|
|
call sm%sv%apply(cone,tx,czero,ty,desc_data,trans_,aux,info,init='Y')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case('U')
|
|
|
|
|
|
|
|
if (.not.present(initu)) then
|
|
|
|
|
|
|
|
call psb_errpush(psb_err_internal_error_,name,&
|
|
|
|
|
|
|
|
& a_err='missing initu to smoother_apply')
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
call psb_geaxpby(cone,x,czero,tx,desc_data,info)
|
|
|
|
|
|
|
|
call psb_geaxpby(cone,initu,czero,ty,desc_data,info)
|
|
|
|
|
|
|
|
call psb_spmm(-cone,sm%pa,ty,cone,tx,desc_data,info,work=aux,trans=trans_)
|
|
|
|
|
|
|
|
call sm%sv%apply(cone,tx,czero,ty,desc_data,trans_,aux,info,init='Y')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case default
|
|
|
|
|
|
|
|
call psb_errpush(psb_err_internal_error_,name,&
|
|
|
|
|
|
|
|
& a_err='wrong init to smoother_apply')
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
end select
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
do i=1, sweeps-1
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! Compute Y(j+1) = Y(j)+ D^(-1)*(X-A*Y(j)),
|
|
|
|
|
|
|
|
! where is the diagonal and A the matrix.
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
call psb_geaxpby(cone,x,czero,tx,desc_data,info)
|
|
|
|
|
|
|
|
call psb_spmm(-cone,sm%pa,ty,cone,tx,desc_data,info,work=aux,trans=trans_)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (info /= psb_success_) exit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
call sm%sv%apply(cone,tx,cone,ty,desc_data,trans_,aux,info,init='Y')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (info /= psb_success_) exit
|
|
|
|
|
|
|
|
end do
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (info == psb_success_) call psb_geaxpby(alpha,ty,beta,y,desc_data,info)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
|
|
|
|
info=psb_err_internal_error_
|
|
|
|
|
|
|
|
call psb_errpush(info,name,&
|
|
|
|
|
|
|
|
& a_err='subsolve with Jacobi sweeps > 1')
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Apply multiple sweeps of a block-Jacobi solver
|
|
|
|
! Apply multiple sweeps of a block-Jacobi solver
|
|
|
@ -180,6 +240,7 @@ subroutine mld_c_jac_smoother_apply(alpha,sm,x,beta,y,desc_data,&
|
|
|
|
& a_err='subsolve with Jacobi sweeps > 1')
|
|
|
|
& a_err='subsolve with Jacobi sweeps > 1')
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
deallocate(tx,ty,stat=info)
|
|
|
|
deallocate(tx,ty,stat=info)
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|