|
|
@ -54,7 +54,6 @@ subroutine mld_c_bwgs_solver_apply_vect(alpha,sv,x,beta,y,desc_data,&
|
|
|
|
type(psb_c_vect_type),intent(inout), optional :: initu
|
|
|
|
type(psb_c_vect_type),intent(inout), optional :: initu
|
|
|
|
|
|
|
|
|
|
|
|
integer(psb_ipk_) :: n_row,n_col, itx
|
|
|
|
integer(psb_ipk_) :: n_row,n_col, itx
|
|
|
|
type(psb_c_vect_type) :: tw, xit
|
|
|
|
|
|
|
|
complex(psb_spk_), pointer :: ww(:), aux(:), tx(:),ty(:)
|
|
|
|
complex(psb_spk_), pointer :: ww(:), aux(:), tx(:),ty(:)
|
|
|
|
complex(psb_spk_), allocatable :: temp(:)
|
|
|
|
complex(psb_spk_), allocatable :: temp(:)
|
|
|
|
integer(psb_ipk_) :: ictxt,np,me,i, err_act
|
|
|
|
integer(psb_ipk_) :: ictxt,np,me,i, err_act
|
|
|
@ -121,69 +120,76 @@ subroutine mld_c_bwgs_solver_apply_vect(alpha,sv,x,beta,y,desc_data,&
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
call psb_geasb(tw,desc_data,info,mold=x%v,scratch=.true.)
|
|
|
|
if (size(wv) < 2) then
|
|
|
|
call psb_geasb(xit,desc_data,info,mold=x%v,scratch=.true.)
|
|
|
|
info = psb_err_internal_error_
|
|
|
|
select case (init_)
|
|
|
|
call psb_errpush(info,name,&
|
|
|
|
case('Z')
|
|
|
|
& a_err='invalid wv size')
|
|
|
|
call xit%zero()
|
|
|
|
|
|
|
|
case('Y')
|
|
|
|
|
|
|
|
call psb_geaxpby(cone,y,czero,xit,desc_data,info)
|
|
|
|
|
|
|
|
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,initu,czero,xit,desc_data,info)
|
|
|
|
|
|
|
|
case default
|
|
|
|
|
|
|
|
call psb_errpush(psb_err_internal_error_,name,&
|
|
|
|
|
|
|
|
& a_err='wrong init to smoother_apply')
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end select
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
select case(trans_)
|
|
|
|
|
|
|
|
case('N')
|
|
|
|
|
|
|
|
if (sv%eps <=szero) then
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! Fixed number of iterations
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
do itx=1,sv%sweeps
|
|
|
|
|
|
|
|
call psb_geaxpby(cone,x,czero,tw,desc_data,info)
|
|
|
|
|
|
|
|
! Update with L. The off-diagonal block is taken care
|
|
|
|
|
|
|
|
! from the Jacobi smoother, hence this is purely local.
|
|
|
|
|
|
|
|
call psb_spmm(-cone,sv%l,xit,cone,tw,desc_data,info,doswap=.false.)
|
|
|
|
|
|
|
|
call psb_spsm(cone,sv%u,tw,czero,xit,desc_data,info)
|
|
|
|
|
|
|
|
end do
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
call psb_geaxpby(alpha,xit,beta,y,desc_data,info)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
associate(tw => wv(1), xit => wv(2))
|
|
|
|
!
|
|
|
|
|
|
|
|
! Iterations to convergence, not implemented right now.
|
|
|
|
select case (init_)
|
|
|
|
!
|
|
|
|
case('Z')
|
|
|
|
info = psb_err_internal_error_
|
|
|
|
call xit%zero()
|
|
|
|
call psb_errpush(info,name,a_err='EPS>0 not implemented in GS subsolve')
|
|
|
|
case('Y')
|
|
|
|
|
|
|
|
call psb_geaxpby(cone,y,czero,xit,desc_data,info)
|
|
|
|
|
|
|
|
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,initu,czero,xit,desc_data,info)
|
|
|
|
|
|
|
|
case default
|
|
|
|
|
|
|
|
call psb_errpush(psb_err_internal_error_,name,&
|
|
|
|
|
|
|
|
& a_err='wrong init to smoother_apply')
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
end select
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
select case(trans_)
|
|
|
|
case default
|
|
|
|
case('N')
|
|
|
|
|
|
|
|
if (sv%eps <=szero) then
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! Fixed number of iterations
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
do itx=1,sv%sweeps
|
|
|
|
|
|
|
|
call psb_geaxpby(cone,x,czero,tw,desc_data,info)
|
|
|
|
|
|
|
|
! Update with L. The off-diagonal block is taken care
|
|
|
|
|
|
|
|
! from the Jacobi smoother, hence this is purely local.
|
|
|
|
|
|
|
|
call psb_spmm(-cone,sv%l,xit,cone,tw,desc_data,info,doswap=.false.)
|
|
|
|
|
|
|
|
call psb_spsm(cone,sv%u,tw,czero,xit,desc_data,info)
|
|
|
|
|
|
|
|
end do
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
call psb_geaxpby(alpha,xit,beta,y,desc_data,info)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! Iterations to convergence, not implemented right now.
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
info = psb_err_internal_error_
|
|
|
|
|
|
|
|
call psb_errpush(info,name,a_err='EPS>0 not implemented in GS subsolve')
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case default
|
|
|
|
info = psb_err_internal_error_
|
|
|
|
info = psb_err_internal_error_
|
|
|
|
call psb_errpush(info,name,&
|
|
|
|
call psb_errpush(info,name,&
|
|
|
|
& a_err='Invalid TRANS in GS subsolve')
|
|
|
|
& a_err='Invalid TRANS in GS subsolve')
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end select
|
|
|
|
end select
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
|
|
|
|
|
|
|
|
call psb_errpush(psb_err_internal_error_,name,&
|
|
|
|
call psb_errpush(psb_err_internal_error_,name,&
|
|
|
|
& a_err='Error in subsolve')
|
|
|
|
& a_err='Error in subsolve')
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
call tw%free(info)
|
|
|
|
end associate
|
|
|
|
call xit%free(info)
|
|
|
|
|
|
|
|
if (n_col <= size(work)) then
|
|
|
|
if (n_col <= size(work)) then
|
|
|
|
if ((4*n_col+n_col) <= size(work)) then
|
|
|
|
if ((4*n_col+n_col) <= size(work)) then
|
|
|
|
else
|
|
|
|
else
|
|
|
|