From 4d1a87e5d8a7240f30733208f55e55c3ab0939e3 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Mon, 11 May 2020 12:11:27 +0200 Subject: [PATCH] Added L1-JACOBI and L1-BJAC as simple preconditioners in PRECINIT --- mlprec/impl/mld_cprecinit.F90 | 23 +++++++++++++++++++++++ mlprec/impl/mld_dprecinit.F90 | 23 +++++++++++++++++++++++ mlprec/impl/mld_sprecinit.F90 | 23 +++++++++++++++++++++++ mlprec/impl/mld_zprecinit.F90 | 23 +++++++++++++++++++++++ 4 files changed, 92 insertions(+) diff --git a/mlprec/impl/mld_cprecinit.F90 b/mlprec/impl/mld_cprecinit.F90 index 837b4260..077c3cde 100644 --- a/mlprec/impl/mld_cprecinit.F90 +++ b/mlprec/impl/mld_cprecinit.F90 @@ -50,10 +50,15 @@ ! ! 'DIAG', 'JACOBI' - diagonal/Jacobi ! +! 'L1-DIAG', 'L1-JACOBI' - diagonal/Jacobi with L1 norm correction +! ! 'GS', 'FBGS' - Hybrid Gauss-Seidel, also symmetrized ! ! 'BJAC' - block Jacobi preconditioner, with ILU(0) ! on the local blocks +! +! 'L1-BJAC' - block Jacobi preconditioner, with ILU(0) +! on the local blocks and L1 correction for off-diag blocks ! ! 'AS' - Additive Schwarz (AS), with ! overlap 1 and ILU(0) on the local submatrices @@ -140,6 +145,15 @@ subroutine mld_cprecinit(ictxt,prec,ptype,info) allocate(mld_c_diag_solver_type :: prec%precv(ilev_)%sm%sv, stat=info) call prec%precv(ilev_)%default() + case ('L1-DIAG','L1-JACOBI','L1_DIAG','L1_JACOBI') + nlev_ = 1 + ilev_ = 1 + allocate(prec%precv(nlev_),stat=info) + allocate(mld_c_jac_smoother_type :: prec%precv(ilev_)%sm, stat=info) + if (info /= psb_success_) return + allocate(mld_c_l1_diag_solver_type :: prec%precv(ilev_)%sm%sv, stat=info) + call prec%precv(ilev_)%default() + case ('GS','FWGS') nlev_ = 1 ilev_ = 1 @@ -174,6 +188,15 @@ subroutine mld_cprecinit(ictxt,prec,ptype,info) allocate(mld_c_ilu_solver_type :: prec%precv(ilev_)%sm%sv, stat=info) call prec%precv(ilev_)%default() + case ('L1-BJAC','L1_BJAC') + nlev_ = 1 + ilev_ = 1 + allocate(prec%precv(nlev_),stat=info) + allocate(mld_c_l1_jac_smoother_type :: prec%precv(ilev_)%sm, stat=info) + if (info /= psb_success_) return + allocate(mld_c_ilu_solver_type :: prec%precv(ilev_)%sm%sv, stat=info) + call prec%precv(ilev_)%default() + case ('AS') nlev_ = 1 ilev_ = 1 diff --git a/mlprec/impl/mld_dprecinit.F90 b/mlprec/impl/mld_dprecinit.F90 index 6703dddf..0a6fe849 100644 --- a/mlprec/impl/mld_dprecinit.F90 +++ b/mlprec/impl/mld_dprecinit.F90 @@ -50,10 +50,15 @@ ! ! 'DIAG', 'JACOBI' - diagonal/Jacobi ! +! 'L1-DIAG', 'L1-JACOBI' - diagonal/Jacobi with L1 norm correction +! ! 'GS', 'FBGS' - Hybrid Gauss-Seidel, also symmetrized ! ! 'BJAC' - block Jacobi preconditioner, with ILU(0) ! on the local blocks +! +! 'L1-BJAC' - block Jacobi preconditioner, with ILU(0) +! on the local blocks and L1 correction for off-diag blocks ! ! 'AS' - Additive Schwarz (AS), with ! overlap 1 and ILU(0) on the local submatrices @@ -143,6 +148,15 @@ subroutine mld_dprecinit(ictxt,prec,ptype,info) allocate(mld_d_diag_solver_type :: prec%precv(ilev_)%sm%sv, stat=info) call prec%precv(ilev_)%default() + case ('L1-DIAG','L1-JACOBI','L1_DIAG','L1_JACOBI') + nlev_ = 1 + ilev_ = 1 + allocate(prec%precv(nlev_),stat=info) + allocate(mld_d_jac_smoother_type :: prec%precv(ilev_)%sm, stat=info) + if (info /= psb_success_) return + allocate(mld_d_l1_diag_solver_type :: prec%precv(ilev_)%sm%sv, stat=info) + call prec%precv(ilev_)%default() + case ('GS','FWGS') nlev_ = 1 ilev_ = 1 @@ -177,6 +191,15 @@ subroutine mld_dprecinit(ictxt,prec,ptype,info) allocate(mld_d_ilu_solver_type :: prec%precv(ilev_)%sm%sv, stat=info) call prec%precv(ilev_)%default() + case ('L1-BJAC','L1_BJAC') + nlev_ = 1 + ilev_ = 1 + allocate(prec%precv(nlev_),stat=info) + allocate(mld_d_l1_jac_smoother_type :: prec%precv(ilev_)%sm, stat=info) + if (info /= psb_success_) return + allocate(mld_d_ilu_solver_type :: prec%precv(ilev_)%sm%sv, stat=info) + call prec%precv(ilev_)%default() + case ('AS') nlev_ = 1 ilev_ = 1 diff --git a/mlprec/impl/mld_sprecinit.F90 b/mlprec/impl/mld_sprecinit.F90 index c239d081..412d99b8 100644 --- a/mlprec/impl/mld_sprecinit.F90 +++ b/mlprec/impl/mld_sprecinit.F90 @@ -50,10 +50,15 @@ ! ! 'DIAG', 'JACOBI' - diagonal/Jacobi ! +! 'L1-DIAG', 'L1-JACOBI' - diagonal/Jacobi with L1 norm correction +! ! 'GS', 'FBGS' - Hybrid Gauss-Seidel, also symmetrized ! ! 'BJAC' - block Jacobi preconditioner, with ILU(0) ! on the local blocks +! +! 'L1-BJAC' - block Jacobi preconditioner, with ILU(0) +! on the local blocks and L1 correction for off-diag blocks ! ! 'AS' - Additive Schwarz (AS), with ! overlap 1 and ILU(0) on the local submatrices @@ -140,6 +145,15 @@ subroutine mld_sprecinit(ictxt,prec,ptype,info) allocate(mld_s_diag_solver_type :: prec%precv(ilev_)%sm%sv, stat=info) call prec%precv(ilev_)%default() + case ('L1-DIAG','L1-JACOBI','L1_DIAG','L1_JACOBI') + nlev_ = 1 + ilev_ = 1 + allocate(prec%precv(nlev_),stat=info) + allocate(mld_s_jac_smoother_type :: prec%precv(ilev_)%sm, stat=info) + if (info /= psb_success_) return + allocate(mld_s_l1_diag_solver_type :: prec%precv(ilev_)%sm%sv, stat=info) + call prec%precv(ilev_)%default() + case ('GS','FWGS') nlev_ = 1 ilev_ = 1 @@ -174,6 +188,15 @@ subroutine mld_sprecinit(ictxt,prec,ptype,info) allocate(mld_s_ilu_solver_type :: prec%precv(ilev_)%sm%sv, stat=info) call prec%precv(ilev_)%default() + case ('L1-BJAC','L1_BJAC') + nlev_ = 1 + ilev_ = 1 + allocate(prec%precv(nlev_),stat=info) + allocate(mld_s_l1_jac_smoother_type :: prec%precv(ilev_)%sm, stat=info) + if (info /= psb_success_) return + allocate(mld_s_ilu_solver_type :: prec%precv(ilev_)%sm%sv, stat=info) + call prec%precv(ilev_)%default() + case ('AS') nlev_ = 1 ilev_ = 1 diff --git a/mlprec/impl/mld_zprecinit.F90 b/mlprec/impl/mld_zprecinit.F90 index 27299b57..98e05b51 100644 --- a/mlprec/impl/mld_zprecinit.F90 +++ b/mlprec/impl/mld_zprecinit.F90 @@ -50,10 +50,15 @@ ! ! 'DIAG', 'JACOBI' - diagonal/Jacobi ! +! 'L1-DIAG', 'L1-JACOBI' - diagonal/Jacobi with L1 norm correction +! ! 'GS', 'FBGS' - Hybrid Gauss-Seidel, also symmetrized ! ! 'BJAC' - block Jacobi preconditioner, with ILU(0) ! on the local blocks +! +! 'L1-BJAC' - block Jacobi preconditioner, with ILU(0) +! on the local blocks and L1 correction for off-diag blocks ! ! 'AS' - Additive Schwarz (AS), with ! overlap 1 and ILU(0) on the local submatrices @@ -143,6 +148,15 @@ subroutine mld_zprecinit(ictxt,prec,ptype,info) allocate(mld_z_diag_solver_type :: prec%precv(ilev_)%sm%sv, stat=info) call prec%precv(ilev_)%default() + case ('L1-DIAG','L1-JACOBI','L1_DIAG','L1_JACOBI') + nlev_ = 1 + ilev_ = 1 + allocate(prec%precv(nlev_),stat=info) + allocate(mld_z_jac_smoother_type :: prec%precv(ilev_)%sm, stat=info) + if (info /= psb_success_) return + allocate(mld_z_l1_diag_solver_type :: prec%precv(ilev_)%sm%sv, stat=info) + call prec%precv(ilev_)%default() + case ('GS','FWGS') nlev_ = 1 ilev_ = 1 @@ -177,6 +191,15 @@ subroutine mld_zprecinit(ictxt,prec,ptype,info) allocate(mld_z_ilu_solver_type :: prec%precv(ilev_)%sm%sv, stat=info) call prec%precv(ilev_)%default() + case ('L1-BJAC','L1_BJAC') + nlev_ = 1 + ilev_ = 1 + allocate(prec%precv(nlev_),stat=info) + allocate(mld_z_l1_jac_smoother_type :: prec%precv(ilev_)%sm, stat=info) + if (info /= psb_success_) return + allocate(mld_z_ilu_solver_type :: prec%precv(ilev_)%sm%sv, stat=info) + call prec%precv(ilev_)%default() + case ('AS') nlev_ = 1 ilev_ = 1