|
|
@ -39,7 +39,7 @@
|
|
|
|
! File: mld_cprecset.f90
|
|
|
|
! File: mld_cprecset.f90
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Subroutine: mld_cprecseti
|
|
|
|
! Subroutine: mld_cprecseti
|
|
|
|
! Version: real
|
|
|
|
! Version: complex
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! This routine sets the integer parameters defining the preconditioner. More
|
|
|
|
! This routine sets the integer parameters defining the preconditioner. More
|
|
|
|
! precisely, the integer parameter identified by 'what' is assigned the value
|
|
|
|
! precisely, the integer parameter identified by 'what' is assigned the value
|
|
|
@ -47,7 +47,7 @@
|
|
|
|
! For the multilevel preconditioners, the levels are numbered in increasing
|
|
|
|
! For the multilevel preconditioners, the levels are numbered in increasing
|
|
|
|
! order starting from the finest one, i.e. level 1 is the finest level.
|
|
|
|
! order starting from the finest one, i.e. level 1 is the finest level.
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! To set character and real parameters, see mld_cprecsetc and mld_cprecsetr,
|
|
|
|
! To set character and complex parameters, see mld_cprecsetc and mld_cprecsetr,
|
|
|
|
! respectively.
|
|
|
|
! respectively.
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!
|
|
|
@ -85,9 +85,6 @@ subroutine mld_ccprecseti(p,what,val,info,ilev)
|
|
|
|
use mld_c_diag_solver
|
|
|
|
use mld_c_diag_solver
|
|
|
|
use mld_c_ilu_solver
|
|
|
|
use mld_c_ilu_solver
|
|
|
|
use mld_c_id_solver
|
|
|
|
use mld_c_id_solver
|
|
|
|
#if defined(HAVE_UMF_) && 0
|
|
|
|
|
|
|
|
use mld_c_umf_solver
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(HAVE_SLU_)
|
|
|
|
#if defined(HAVE_SLU_)
|
|
|
|
use mld_c_slu_solver
|
|
|
|
use mld_c_slu_solver
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -133,7 +130,6 @@ subroutine mld_ccprecseti(p,what,val,info,ilev)
|
|
|
|
p%coarse_aggr_size = max(val,-1)
|
|
|
|
p%coarse_aggr_size = max(val,-1)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Set preconditioner parameters at level ilev.
|
|
|
|
! Set preconditioner parameters at level ilev.
|
|
|
|
!
|
|
|
|
!
|
|
|
@ -143,7 +139,7 @@ subroutine mld_ccprecseti(p,what,val,info,ilev)
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Rules for fine level are slightly different.
|
|
|
|
! Rules for fine level are slightly different.
|
|
|
|
!
|
|
|
|
!
|
|
|
|
select case(psb_toupper(what))
|
|
|
|
select case(psb_toupper(trim(what)))
|
|
|
|
case('SMOOTHER_TYPE')
|
|
|
|
case('SMOOTHER_TYPE')
|
|
|
|
call onelev_set_smoother(p%precv(ilev_),val,info)
|
|
|
|
call onelev_set_smoother(p%precv(ilev_),val,info)
|
|
|
|
case('SUB_SOLVE')
|
|
|
|
case('SUB_SOLVE')
|
|
|
@ -195,9 +191,7 @@ subroutine mld_ccprecseti(p,what,val,info,ilev)
|
|
|
|
select case (val)
|
|
|
|
select case (val)
|
|
|
|
case(mld_bjac_)
|
|
|
|
case(mld_bjac_)
|
|
|
|
call onelev_set_smoother(p%precv(nlev_),val,info)
|
|
|
|
call onelev_set_smoother(p%precv(nlev_),val,info)
|
|
|
|
#if defined(HAVE_UMF_) && 0
|
|
|
|
#if defined(HAVE_SLU_)
|
|
|
|
call onelev_set_solver(p%precv(nlev_),mld_umf_,info)
|
|
|
|
|
|
|
|
#elif defined(HAVE_SLU_)
|
|
|
|
|
|
|
|
call onelev_set_solver(p%precv(nlev_),mld_slu_,info)
|
|
|
|
call onelev_set_solver(p%precv(nlev_),mld_slu_,info)
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
call onelev_set_solver(p%precv(nlev_),mld_ilu_n_,info)
|
|
|
|
call onelev_set_solver(p%precv(nlev_),mld_ilu_n_,info)
|
|
|
@ -246,7 +240,7 @@ subroutine mld_ccprecseti(p,what,val,info,ilev)
|
|
|
|
! ilev not specified: set preconditioner parameters at all the appropriate
|
|
|
|
! ilev not specified: set preconditioner parameters at all the appropriate
|
|
|
|
! levels
|
|
|
|
! levels
|
|
|
|
!
|
|
|
|
!
|
|
|
|
select case(psb_toupper(what))
|
|
|
|
select case(psb_toupper(trim(what)))
|
|
|
|
case('SUB_SOLVE')
|
|
|
|
case('SUB_SOLVE')
|
|
|
|
do ilev_=1,max(1,nlev_-1)
|
|
|
|
do ilev_=1,max(1,nlev_-1)
|
|
|
|
if (.not.allocated(p%precv(ilev_)%sm)) then
|
|
|
|
if (.not.allocated(p%precv(ilev_)%sm)) then
|
|
|
@ -296,9 +290,7 @@ subroutine mld_ccprecseti(p,what,val,info,ilev)
|
|
|
|
select case (val)
|
|
|
|
select case (val)
|
|
|
|
case(mld_bjac_)
|
|
|
|
case(mld_bjac_)
|
|
|
|
call onelev_set_smoother(p%precv(nlev_),mld_bjac_,info)
|
|
|
|
call onelev_set_smoother(p%precv(nlev_),mld_bjac_,info)
|
|
|
|
#if defined(HAVE_UMF_) && 0
|
|
|
|
#if defined(HAVE_SLU_)
|
|
|
|
call onelev_set_solver(p%precv(nlev_),mld_umf_,info)
|
|
|
|
|
|
|
|
#elif defined(HAVE_SLU_)
|
|
|
|
|
|
|
|
call onelev_set_solver(p%precv(nlev_),mld_slu_,info)
|
|
|
|
call onelev_set_solver(p%precv(nlev_),mld_slu_,info)
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
call onelev_set_solver(p%precv(nlev_),mld_ilu_n_,info)
|
|
|
|
call onelev_set_solver(p%precv(nlev_),mld_ilu_n_,info)
|
|
|
@ -512,26 +504,6 @@ contains
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
call level%sm%sv%set('SUB_SOLVE',val,info)
|
|
|
|
call level%sm%sv%set('SUB_SOLVE',val,info)
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(HAVE_UMF_) && 0
|
|
|
|
|
|
|
|
case (mld_umf_)
|
|
|
|
|
|
|
|
if (allocated(level%sm%sv)) then
|
|
|
|
|
|
|
|
select type (sv => level%sm%sv)
|
|
|
|
|
|
|
|
class is (mld_c_umf_solver_type)
|
|
|
|
|
|
|
|
! do nothing
|
|
|
|
|
|
|
|
class default
|
|
|
|
|
|
|
|
call level%sm%sv%free(info)
|
|
|
|
|
|
|
|
if (info == 0) deallocate(level%sm%sv)
|
|
|
|
|
|
|
|
if (info == 0) allocate(mld_c_umf_solver_type ::&
|
|
|
|
|
|
|
|
& level%sm%sv, stat=info)
|
|
|
|
|
|
|
|
end select
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
allocate(mld_c_umf_solver_type :: level%sm%sv, stat=info)
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
if (allocated(level%sm)) then
|
|
|
|
|
|
|
|
if (allocated(level%sm%sv)) &
|
|
|
|
|
|
|
|
& call level%sm%sv%default()
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_SLU_
|
|
|
|
#ifdef HAVE_SLU_
|
|
|
|
case (mld_slu_)
|
|
|
|
case (mld_slu_)
|
|
|
|
if (allocated(level%sm%sv)) then
|
|
|
|
if (allocated(level%sm%sv)) then
|
|
|
@ -565,7 +537,7 @@ end subroutine mld_ccprecseti
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Subroutine: mld_cprecsetc
|
|
|
|
! Subroutine: mld_cprecsetc
|
|
|
|
! Version: real
|
|
|
|
! Version: complex
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! This routine sets the character parameters defining the preconditioner. More
|
|
|
|
! This routine sets the character parameters defining the preconditioner. More
|
|
|
|
! precisely, the character parameter identified by 'what' is assigned the value
|
|
|
|
! precisely, the character parameter identified by 'what' is assigned the value
|
|
|
@ -573,7 +545,7 @@ end subroutine mld_ccprecseti
|
|
|
|
! For the multilevel preconditioners, the levels are numbered in increasing
|
|
|
|
! For the multilevel preconditioners, the levels are numbered in increasing
|
|
|
|
! order starting from the finest one, i.e. level 1 is the finest level.
|
|
|
|
! order starting from the finest one, i.e. level 1 is the finest level.
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! To set integer and real parameters, see mld_cprecseti and mld_cprecsetr,
|
|
|
|
! To set integer and complex parameters, see mld_cprecseti and mld_cprecsetr,
|
|
|
|
! respectively.
|
|
|
|
! respectively.
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!
|
|
|
@ -653,10 +625,10 @@ end subroutine mld_ccprecsetc
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Subroutine: mld_cprecsetr
|
|
|
|
! Subroutine: mld_cprecsetr
|
|
|
|
! Version: real
|
|
|
|
! Version: complex
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! This routine sets the real parameters defining the preconditioner. More
|
|
|
|
! This routine sets the complex parameters defining the preconditioner. More
|
|
|
|
! precisely, the real parameter identified by 'what' is assigned the value
|
|
|
|
! precisely, the complex parameter identified by 'what' is assigned the value
|
|
|
|
! contained in 'val'.
|
|
|
|
! contained in 'val'.
|
|
|
|
! For the multilevel preconditioners, the levels are numbered in increasing
|
|
|
|
! For the multilevel preconditioners, the levels are numbered in increasing
|
|
|
|
! order starting from the finest one, i.e. level 1 is the finest level.
|
|
|
|
! order starting from the finest one, i.e. level 1 is the finest level.
|
|
|
@ -671,7 +643,7 @@ end subroutine mld_ccprecsetc
|
|
|
|
! The number identifying the parameter to be set.
|
|
|
|
! The number identifying the parameter to be set.
|
|
|
|
! A mnemonic constant has been associated to each of these
|
|
|
|
! A mnemonic constant has been associated to each of these
|
|
|
|
! numbers, as reported in the MLD2P4 User's and Reference Guide.
|
|
|
|
! numbers, as reported in the MLD2P4 User's and Reference Guide.
|
|
|
|
! val - real(psb_dpk_), input.
|
|
|
|
! val - real(psb_spk_), input.
|
|
|
|
! The value of the parameter to be set. The list of allowed
|
|
|
|
! The value of the parameter to be set. The list of allowed
|
|
|
|
! values is reported in the MLD2P4 User's and Reference Guide.
|
|
|
|
! values is reported in the MLD2P4 User's and Reference Guide.
|
|
|
|
! info - integer, output.
|
|
|
|
! info - integer, output.
|
|
|
@ -705,6 +677,7 @@ subroutine mld_ccprecsetr(p,what,val,info,ilev)
|
|
|
|
|
|
|
|
|
|
|
|
! Local variables
|
|
|
|
! Local variables
|
|
|
|
integer(psb_ipk_) :: ilev_,nlev_
|
|
|
|
integer(psb_ipk_) :: ilev_,nlev_
|
|
|
|
|
|
|
|
real(psb_spk_) :: thr
|
|
|
|
character(len=*), parameter :: name='mld_precsetr'
|
|
|
|
character(len=*), parameter :: name='mld_precsetr'
|
|
|
|
|
|
|
|
|
|
|
|
info = psb_success_
|
|
|
|
info = psb_success_
|
|
|
@ -749,6 +722,13 @@ subroutine mld_ccprecsetr(p,what,val,info,ilev)
|
|
|
|
ilev_=nlev_
|
|
|
|
ilev_=nlev_
|
|
|
|
call p%precv(ilev_)%set('SUB_ILUTHRS',val,info)
|
|
|
|
call p%precv(ilev_)%set('SUB_ILUTHRS',val,info)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case('AGGR_THRESH')
|
|
|
|
|
|
|
|
thr = val
|
|
|
|
|
|
|
|
do ilev_ = 2, nlev_
|
|
|
|
|
|
|
|
call p%precv(ilev_)%set('AGGR_THRESH',thr,info)
|
|
|
|
|
|
|
|
thr = thr * p%precv(ilev_)%parms%aggr_scale
|
|
|
|
|
|
|
|
end do
|
|
|
|
|
|
|
|
|
|
|
|
case default
|
|
|
|
case default
|
|
|
|
|
|
|
|
|
|
|
|
do ilev_=1,nlev_
|
|
|
|
do ilev_=1,nlev_
|
|
|
|