Implement structure for polynomial smoother

This commit is contained in:
sfilippone
2023-11-13 16:58:30 +01:00
parent 1dcb542e4a
commit ea2f75776c
45 changed files with 2364 additions and 163 deletions
+13 -3
View File
@@ -144,6 +144,7 @@ program amg_d_pde3d
! AMG smoother or pre-smoother; also 1-lev preconditioner
character(len=16) :: smther ! (pre-)smoother type: BJAC, AS
integer(psb_ipk_) :: jsweeps ! (pre-)smoother / 1-lev prec. sweeps
integer(psb_ipk_) :: degree ! degree for polynomial smoother
integer(psb_ipk_) :: novr ! number of overlap layers
character(len=16) :: restr ! restriction over application of AS
character(len=16) :: prol ! prolongation over application of AS
@@ -158,6 +159,7 @@ program amg_d_pde3d
! AMG post-smoother; ignored by 1-lev preconditioner
character(len=16) :: smther2 ! post-smoother type: BJAC, AS
integer(psb_ipk_) :: jsweeps2 ! post-smoother sweeps
integer(psb_ipk_) :: degree2 ! degree for polynomial smoother
integer(psb_ipk_) :: novr2 ! number of overlap layers
character(len=16) :: restr2 ! restriction over application of AS
character(len=16) :: prol2 ! prolongation over application of AS
@@ -285,10 +287,11 @@ program amg_d_pde3d
! 1-level sweeps from "outer_sweeps"
call prec%set('smoother_sweeps', p_choice%jsweeps, info)
case ('BJAC')
case ('BJAC','POLY')
call prec%set('smoother_sweeps', p_choice%jsweeps, info)
call prec%set('sub_solve', p_choice%solve, info)
call prec%set('solver_sweeps', p_choice%ssweeps, info)
call prec%set('smoother_degree', p_choice%degree, info)
if (psb_toupper(p_choice%solve)=='MUMPS') &
& call prec%set('mumps_loc_glob','local_solver',info)
call prec%set('sub_fillin', p_choice%fill, info)
@@ -336,7 +339,8 @@ program amg_d_pde3d
call prec%set('smoother_type', p_choice%smther, info)
call prec%set('smoother_sweeps', p_choice%jsweeps, info)
call prec%set('smoother_degree', p_choice%degree, info)
select case (psb_toupper(p_choice%smther))
case ('GS','BWGS','FBGS','JACOBI','L1-JACOBI','L1-FBGS')
! do nothing
@@ -366,6 +370,7 @@ program amg_d_pde3d
if (psb_toupper(p_choice%smther2) /= 'NONE') then
call prec%set('smoother_type', p_choice%smther2, info,pos='post')
call prec%set('smoother_sweeps', p_choice%jsweeps2, info,pos='post')
call prec%set('smoother_degree', p_choice%degree2, info,pos='post')
select case (psb_toupper(p_choice%smther2))
case ('GS','BWGS','FBGS','JACOBI','L1-JACOBI','L1-FBGS')
! do nothing
@@ -402,6 +407,7 @@ program amg_d_pde3d
call prec%set('coarse_sweeps', p_choice%cjswp, info)
end select
!!$ call prec%descr(info,iout=psb_out_unit)
! build the preconditioner
call psb_barrier(ctxt)
@@ -581,6 +587,7 @@ contains
! First smoother / 1-lev preconditioner
call read_data(prec%smther,inp_unit) ! smoother type
call read_data(prec%jsweeps,inp_unit) ! (pre-)smoother / 1-lev prec sweeps
call read_data(prec%degree,inp_unit) ! (pre-)smoother / 1-lev prec sweeps
call read_data(prec%novr,inp_unit) ! number of overlap layers
call read_data(prec%restr,inp_unit) ! restriction over application of AS
call read_data(prec%prol,inp_unit) ! prolongation over application of AS
@@ -593,11 +600,12 @@ contains
! Second smoother/ AMG post-smoother (if NONE ignored in main)
call read_data(prec%smther2,inp_unit) ! smoother type
call read_data(prec%jsweeps2,inp_unit) ! (post-)smoother sweeps
call read_data(prec%degree2,inp_unit) ! (post-)smoother sweeps
call read_data(prec%novr2,inp_unit) ! number of overlap layers
call read_data(prec%restr2,inp_unit) ! restriction over application of AS
call read_data(prec%prol2,inp_unit) ! prolongation over application of AS
call read_data(prec%solve2,inp_unit) ! local subsolver
call read_data(prec%ssweeps2,inp_unit) ! inner solver sweeps
call read_data(prec%ssweeps2,inp_unit) ! inner solver sweeps
call read_data(prec%variant2,inp_unit) ! AINV variant
call read_data(prec%fill2,inp_unit) ! fill-in for incomplete LU
call read_data(prec%invfill2,inp_unit) !Inverse fill-in for INVK
@@ -663,6 +671,7 @@ contains
! broadcast first (pre-)smoother / 1-lev prec data
call psb_bcast(ctxt,prec%smther)
call psb_bcast(ctxt,prec%jsweeps)
call psb_bcast(ctxt,prec%degree)
call psb_bcast(ctxt,prec%novr)
call psb_bcast(ctxt,prec%restr)
call psb_bcast(ctxt,prec%prol)
@@ -675,6 +684,7 @@ contains
! broadcast second (post-)smoother
call psb_bcast(ctxt,prec%smther2)
call psb_bcast(ctxt,prec%jsweeps2)
call psb_bcast(ctxt,prec%degree2)
call psb_bcast(ctxt,prec%novr2)
call psb_bcast(ctxt,prec%restr2)
call psb_bcast(ctxt,prec%prol2)