|
|
|
@ -72,13 +72,13 @@ contains
|
|
|
|
|
use psb_base_mod, only : psb_dpk_
|
|
|
|
|
real(psb_dpk_) :: b1
|
|
|
|
|
real(psb_dpk_), intent(in) :: x,y
|
|
|
|
|
b1=1.d0/sqrt(2.d0)
|
|
|
|
|
b1=0.d0/sqrt(2.d0)
|
|
|
|
|
end function b1
|
|
|
|
|
function b2(x,y)
|
|
|
|
|
use psb_base_mod, only : psb_dpk_
|
|
|
|
|
real(psb_dpk_) :: b2
|
|
|
|
|
real(psb_dpk_), intent(in) :: x,y
|
|
|
|
|
b2=1.d0/sqrt(2.d0)
|
|
|
|
|
b2=0.d0/sqrt(2.d0)
|
|
|
|
|
end function b2
|
|
|
|
|
function c(x,y)
|
|
|
|
|
use psb_base_mod, only : psb_dpk_
|
|
|
|
@ -90,13 +90,13 @@ contains
|
|
|
|
|
use psb_base_mod, only : psb_dpk_
|
|
|
|
|
real(psb_dpk_) :: a1
|
|
|
|
|
real(psb_dpk_), intent(in) :: x,y
|
|
|
|
|
a1=1.d0/80
|
|
|
|
|
a1=1.d0!/80
|
|
|
|
|
end function a1
|
|
|
|
|
function a2(x,y)
|
|
|
|
|
use psb_base_mod, only : psb_dpk_
|
|
|
|
|
real(psb_dpk_) :: a2
|
|
|
|
|
real(psb_dpk_), intent(in) :: x,y
|
|
|
|
|
a2=1.d0/80
|
|
|
|
|
a2=1.d0!/80
|
|
|
|
|
end function a2
|
|
|
|
|
function g(x,y)
|
|
|
|
|
use psb_base_mod, only : psb_dpk_, done, dzero
|
|
|
|
@ -153,6 +153,7 @@ program ppde2d
|
|
|
|
|
character(len=16) :: prol ! prolongation over application of as
|
|
|
|
|
character(len=16) :: solve ! Solver type: ILU, SuperLU, UMFPACK.
|
|
|
|
|
integer(psb_ipk_) :: fill1 ! Fill-in for factorization 1
|
|
|
|
|
integer(psb_ipk_) :: svsweeps ! Solver sweeps for GS
|
|
|
|
|
real(psb_dpk_) :: thr1 ! Threshold for fact. 1 ILU(T)
|
|
|
|
|
character(len=16) :: smther ! Smoother
|
|
|
|
|
integer(psb_ipk_) :: nlev ! Number of levels in multilevel prec.
|
|
|
|
@ -196,6 +197,7 @@ program ppde2d
|
|
|
|
|
write(*,*) 'Welcome to MLD2P4 version: ',mld_version_string_
|
|
|
|
|
write(*,*) 'This is the ',trim(name),' sample program'
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
! get parameters
|
|
|
|
|
!
|
|
|
|
@ -206,7 +208,8 @@ program ppde2d
|
|
|
|
|
!
|
|
|
|
|
call psb_barrier(ictxt)
|
|
|
|
|
t1 = psb_wtime()
|
|
|
|
|
call psb_gen_pde2d(ictxt,idim,a,b,x,desc_a,afmt,a1,a2,b1,b2,c,g,info)
|
|
|
|
|
call psb_gen_pde2d(ictxt,idim,a,b,x,desc_a,afmt,&
|
|
|
|
|
& a1,a2,b1,b2,c,g,info)
|
|
|
|
|
call psb_barrier(ictxt)
|
|
|
|
|
t2 = psb_wtime() - t1
|
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
@ -227,37 +230,39 @@ program ppde2d
|
|
|
|
|
if (psb_toupper(prectype%prec) == 'ML') then
|
|
|
|
|
nlv = prectype%nlev
|
|
|
|
|
call mld_precinit(prec,prectype%prec, info, nlev=nlv)
|
|
|
|
|
call mld_precset(prec,mld_smoother_type_, prectype%smther, info)
|
|
|
|
|
call mld_precset(prec,mld_smoother_sweeps_, prectype%jsweeps, info)
|
|
|
|
|
call mld_precset(prec,mld_sub_ovr_, prectype%novr, info)
|
|
|
|
|
call mld_precset(prec,mld_sub_restr_, prectype%restr, info)
|
|
|
|
|
call mld_precset(prec,mld_sub_prol_, prectype%prol, info)
|
|
|
|
|
call mld_precset(prec,mld_sub_solve_, prectype%solve, info)
|
|
|
|
|
call mld_precset(prec,mld_sub_fillin_, prectype%fill1, info)
|
|
|
|
|
call mld_precset(prec,mld_sub_iluthrs_, prectype%thr1, info)
|
|
|
|
|
call mld_precset(prec,mld_aggr_kind_, prectype%aggrkind,info)
|
|
|
|
|
call mld_precset(prec,mld_aggr_alg_, prectype%aggr_alg,info)
|
|
|
|
|
call mld_precset(prec,mld_ml_type_, prectype%mltype, info)
|
|
|
|
|
call mld_precset(prec,mld_smoother_pos_, prectype%smthpos, info)
|
|
|
|
|
call mld_precset(prec,'smoother_type', prectype%smther, info)
|
|
|
|
|
call mld_precset(prec,'smoother_sweeps', prectype%jsweeps, info)
|
|
|
|
|
call mld_precset(prec,'sub_ovr', prectype%novr, info)
|
|
|
|
|
call mld_precset(prec,'sub_restr', prectype%restr, info)
|
|
|
|
|
call mld_precset(prec,'sub_prol', prectype%prol, info)
|
|
|
|
|
call mld_precset(prec,'sub_solve', prectype%solve, info)
|
|
|
|
|
call mld_precset(prec,'sub_fillin', prectype%fill1, info)
|
|
|
|
|
call mld_precset(prec,'solver_sweeps', prectype%svsweeps, info)
|
|
|
|
|
call mld_precset(prec,'sub_iluthrs', prectype%thr1, info)
|
|
|
|
|
call mld_precset(prec,'aggr_kind', prectype%aggrkind,info)
|
|
|
|
|
call mld_precset(prec,'aggr_alg', prectype%aggr_alg,info)
|
|
|
|
|
call mld_precset(prec,'ml_type', prectype%mltype, info)
|
|
|
|
|
call mld_precset(prec,'smoother_pos', prectype%smthpos, info)
|
|
|
|
|
if (prectype%athres >= dzero) &
|
|
|
|
|
& call mld_precset(prec,mld_aggr_thresh_, prectype%athres, info)
|
|
|
|
|
call mld_precset(prec,mld_coarse_solve_, prectype%csolve, info)
|
|
|
|
|
call mld_precset(prec,mld_coarse_subsolve_, prectype%csbsolve,info)
|
|
|
|
|
call mld_precset(prec,mld_coarse_mat_, prectype%cmat, info)
|
|
|
|
|
call mld_precset(prec,mld_coarse_fillin_, prectype%cfill, info)
|
|
|
|
|
call mld_precset(prec,mld_coarse_iluthrs_, prectype%cthres, info)
|
|
|
|
|
call mld_precset(prec,mld_coarse_sweeps_, prectype%cjswp, info)
|
|
|
|
|
call mld_precset(prec,mld_coarse_aggr_size_, prectype%csize, info)
|
|
|
|
|
& call mld_precset(prec,'aggr_thresh', prectype%athres, info)
|
|
|
|
|
call mld_precset(prec,'coarse_solve', prectype%csolve, info)
|
|
|
|
|
call mld_precset(prec,'coarse_subsolve', prectype%csbsolve,info)
|
|
|
|
|
call mld_precset(prec,'coarse_mat', prectype%cmat, info)
|
|
|
|
|
call mld_precset(prec,'coarse_fillin', prectype%cfill, info)
|
|
|
|
|
call mld_precset(prec,'coarse_iluthrs', prectype%cthres, info)
|
|
|
|
|
call mld_precset(prec,'coarse_sweeps', prectype%cjswp, info)
|
|
|
|
|
call mld_precset(prec,'coarse_aggr_size', prectype%csize, info)
|
|
|
|
|
else
|
|
|
|
|
nlv = 1
|
|
|
|
|
call mld_precinit(prec,prectype%prec, info, nlev=nlv)
|
|
|
|
|
call mld_precset(prec,mld_smoother_sweeps_, prectype%jsweeps, info)
|
|
|
|
|
call mld_precset(prec,mld_sub_ovr_, prectype%novr, info)
|
|
|
|
|
call mld_precset(prec,mld_sub_restr_, prectype%restr, info)
|
|
|
|
|
call mld_precset(prec,mld_sub_prol_, prectype%prol, info)
|
|
|
|
|
call mld_precset(prec,mld_sub_solve_, prectype%solve, info)
|
|
|
|
|
call mld_precset(prec,mld_sub_fillin_, prectype%fill1, info)
|
|
|
|
|
call mld_precset(prec,mld_sub_iluthrs_, prectype%thr1, info)
|
|
|
|
|
call mld_precinit(prec,prectype%prec, info, nlev=nlv)
|
|
|
|
|
call mld_precset(prec,'smoother_sweeps', prectype%jsweeps, info)
|
|
|
|
|
call mld_precset(prec,'sub_ovr', prectype%novr, info)
|
|
|
|
|
call mld_precset(prec,'sub_restr', prectype%restr, info)
|
|
|
|
|
call mld_precset(prec,'sub_prol', prectype%prol, info)
|
|
|
|
|
call mld_precset(prec,'sub_solve', prectype%solve, info)
|
|
|
|
|
call mld_precset(prec,'sub_fillin', prectype%fill1, info)
|
|
|
|
|
call mld_precset(prec,'solver_sweeps', prectype%svsweeps, info)
|
|
|
|
|
call mld_precset(prec,'sub_iluthrs', prectype%thr1, info)
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
call psb_barrier(ictxt)
|
|
|
|
@ -364,30 +369,31 @@ contains
|
|
|
|
|
call read_data(itrace,psb_inp_unit)
|
|
|
|
|
call read_data(irst,psb_inp_unit)
|
|
|
|
|
call read_data(eps,psb_inp_unit)
|
|
|
|
|
call read_data(prectype%descr,psb_inp_unit) ! verbose description of the prec
|
|
|
|
|
call read_data(prectype%prec,psb_inp_unit) ! overall prectype
|
|
|
|
|
call read_data(prectype%novr,psb_inp_unit) ! number of overlap layers
|
|
|
|
|
call read_data(prectype%restr,psb_inp_unit) ! restriction over application of as
|
|
|
|
|
call read_data(prectype%prol,psb_inp_unit) ! prolongation over application of as
|
|
|
|
|
call read_data(prectype%solve,psb_inp_unit) ! Factorization type: ILU, SuperLU, UMFPACK.
|
|
|
|
|
call read_data(prectype%fill1,psb_inp_unit) ! Fill-in for factorization 1
|
|
|
|
|
call read_data(prectype%thr1,psb_inp_unit) ! Threshold for fact. 1 ILU(T)
|
|
|
|
|
call read_data(prectype%jsweeps,psb_inp_unit) ! Jacobi sweeps for PJAC
|
|
|
|
|
call read_data(prectype%descr,psb_inp_unit) ! verbose description of the prec
|
|
|
|
|
call read_data(prectype%prec,psb_inp_unit) ! overall prectype
|
|
|
|
|
call read_data(prectype%novr,psb_inp_unit) ! number of overlap layers
|
|
|
|
|
call read_data(prectype%restr,psb_inp_unit) ! restriction over application of as
|
|
|
|
|
call read_data(prectype%prol,psb_inp_unit) ! prolongation over application of as
|
|
|
|
|
call read_data(prectype%solve,psb_inp_unit) ! Factorization type: ILU, SuperLU, UMFPACK.
|
|
|
|
|
call read_data(prectype%svsweeps,psb_inp_unit) ! Solver sweeps
|
|
|
|
|
call read_data(prectype%fill1,psb_inp_unit) ! Fill-in for factorization 1
|
|
|
|
|
call read_data(prectype%thr1,psb_inp_unit) ! Threshold for fact. 1 ILU(T)
|
|
|
|
|
call read_data(prectype%jsweeps,psb_inp_unit) ! Jacobi sweeps for PJAC
|
|
|
|
|
if (psb_toupper(prectype%prec) == 'ML') then
|
|
|
|
|
call read_data(prectype%smther,psb_inp_unit) ! Smoother type.
|
|
|
|
|
call read_data(prectype%nlev,psb_inp_unit) ! Number of levels in multilevel prec.
|
|
|
|
|
call read_data(prectype%aggrkind,psb_inp_unit) ! smoothed/raw aggregatin
|
|
|
|
|
call read_data(prectype%aggr_alg,psb_inp_unit) ! local or global aggregation
|
|
|
|
|
call read_data(prectype%mltype,psb_inp_unit) ! additive or multiplicative 2nd level prec
|
|
|
|
|
call read_data(prectype%smthpos,psb_inp_unit) ! side: pre, post, both smoothing
|
|
|
|
|
call read_data(prectype%cmat,psb_inp_unit) ! coarse mat
|
|
|
|
|
call read_data(prectype%csolve,psb_inp_unit) ! Factorization type: ILU, SuperLU, UMFPACK.
|
|
|
|
|
call read_data(prectype%csbsolve,psb_inp_unit) ! Factorization type: ILU, SuperLU, UMFPACK.
|
|
|
|
|
call read_data(prectype%cfill,psb_inp_unit) ! Fill-in for factorization 1
|
|
|
|
|
call read_data(prectype%cthres,psb_inp_unit) ! Threshold for fact. 1 ILU(T)
|
|
|
|
|
call read_data(prectype%cjswp,psb_inp_unit) ! Jacobi sweeps
|
|
|
|
|
call read_data(prectype%athres,psb_inp_unit) ! smoother aggr thresh
|
|
|
|
|
call read_data(prectype%csize,psb_inp_unit) ! coarse size
|
|
|
|
|
call read_data(prectype%smther,psb_inp_unit) ! Smoother type.
|
|
|
|
|
call read_data(prectype%nlev,psb_inp_unit) ! Number of levels in multilevel prec.
|
|
|
|
|
call read_data(prectype%aggrkind,psb_inp_unit) ! smoothed/raw aggregatin
|
|
|
|
|
call read_data(prectype%aggr_alg,psb_inp_unit) ! local or global aggregation
|
|
|
|
|
call read_data(prectype%mltype,psb_inp_unit) ! additive or multiplicative 2nd level prec
|
|
|
|
|
call read_data(prectype%smthpos,psb_inp_unit) ! side: pre, post, both smoothing
|
|
|
|
|
call read_data(prectype%cmat,psb_inp_unit) ! coarse mat
|
|
|
|
|
call read_data(prectype%csolve,psb_inp_unit) ! Factorization type: ILU, SuperLU, UMFPACK.
|
|
|
|
|
call read_data(prectype%csbsolve,psb_inp_unit) ! Factorization type: ILU, SuperLU, UMFPACK.
|
|
|
|
|
call read_data(prectype%cfill,psb_inp_unit) ! Fill-in for factorization 1
|
|
|
|
|
call read_data(prectype%cthres,psb_inp_unit) ! Threshold for fact. 1 ILU(T)
|
|
|
|
|
call read_data(prectype%cjswp,psb_inp_unit) ! Jacobi sweeps
|
|
|
|
|
call read_data(prectype%athres,psb_inp_unit) ! smoother aggr thresh
|
|
|
|
|
call read_data(prectype%csize,psb_inp_unit) ! coarse size
|
|
|
|
|
end if
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
@ -408,6 +414,7 @@ contains
|
|
|
|
|
call psb_bcast(ictxt,prectype%restr) ! restriction over application of as
|
|
|
|
|
call psb_bcast(ictxt,prectype%prol) ! prolongation over application of as
|
|
|
|
|
call psb_bcast(ictxt,prectype%solve) ! Factorization type: ILU, SuperLU, UMFPACK.
|
|
|
|
|
call psb_bcast(ictxt,prectype%svsweeps) ! Sweeps for inner GS solver
|
|
|
|
|
call psb_bcast(ictxt,prectype%fill1) ! Fill-in for factorization 1
|
|
|
|
|
call psb_bcast(ictxt,prectype%thr1) ! Threshold for fact. 1 ILU(T)
|
|
|
|
|
call psb_bcast(ictxt,prectype%jsweeps) ! Jacobi sweeps
|
|
|
|
@ -463,4 +470,3 @@ contains
|
|
|
|
|
end subroutine pr_usage
|
|
|
|
|
|
|
|
|
|
end program ppde2d
|
|
|
|
|
|
|
|
|
|