From 68a9cceaa001e1e72c6c7cb2c7a7000d44b08a89 Mon Sep 17 00:00:00 2001 From: Cirdans-Home Date: Tue, 29 Oct 2024 15:51:37 +0000 Subject: [PATCH] Fixed l1-Jacobi scaling --- amgprec/impl/aggregator/amg_caggrmat_smth_bld.f90 | 12 +++++++----- amgprec/impl/aggregator/amg_daggrmat_smth_bld.f90 | 12 +++++++----- amgprec/impl/aggregator/amg_saggrmat_smth_bld.f90 | 12 +++++++----- amgprec/impl/aggregator/amg_zaggrmat_smth_bld.f90 | 12 +++++++----- 4 files changed, 28 insertions(+), 20 deletions(-) diff --git a/amgprec/impl/aggregator/amg_caggrmat_smth_bld.f90 b/amgprec/impl/aggregator/amg_caggrmat_smth_bld.f90 index 4cd75284..e87637cf 100644 --- a/amgprec/impl/aggregator/amg_caggrmat_smth_bld.f90 +++ b/amgprec/impl/aggregator/amg_caggrmat_smth_bld.f90 @@ -255,7 +255,8 @@ subroutine amg_caggrmat_smth_bld(dol1smoothing,a,desc_a,ilaggr,nlaggr,& enddo if (jd == -1) then - if (.not.do_l1correction) write(0,*) 'Wrong input: we need the diagonal!!!!', i + ! if (.not.do_l1correction) + write(0,*) 'Wrong input: we need the diagonal!!!!', i else acsrf%val(jd)=acsrf%val(jd)-tmp end if @@ -277,10 +278,11 @@ subroutine amg_caggrmat_smth_bld(dol1smoothing,a,desc_a,ilaggr,nlaggr,& !$OMP end parallel do if (parms%aggr_omega_alg == amg_eig_est_) then - if (do_l1correction) then - ! For l1-Jacobi this can be estimated with 1 - parms%aggr_omega_val = done - else if (parms%aggr_eig == amg_max_norm_) then + !if (do_l1correction) then + ! ! For l1-Jacobi this can be estimated with 1 + ! parms%aggr_omega_val = done + ! + if (parms%aggr_eig == amg_max_norm_) then allocate(arwsum(nrow)) call acsr%arwsum(arwsum) anorm = maxval(abs(adiag(1:nrow)*arwsum(1:nrow))) diff --git a/amgprec/impl/aggregator/amg_daggrmat_smth_bld.f90 b/amgprec/impl/aggregator/amg_daggrmat_smth_bld.f90 index 399e27b6..5b4f0a92 100644 --- a/amgprec/impl/aggregator/amg_daggrmat_smth_bld.f90 +++ b/amgprec/impl/aggregator/amg_daggrmat_smth_bld.f90 @@ -255,7 +255,8 @@ subroutine amg_daggrmat_smth_bld(dol1smoothing,a,desc_a,ilaggr,nlaggr,& enddo if (jd == -1) then - if (.not.do_l1correction) write(0,*) 'Wrong input: we need the diagonal!!!!', i + ! if (.not.do_l1correction) + write(0,*) 'Wrong input: we need the diagonal!!!!', i else acsrf%val(jd)=acsrf%val(jd)-tmp end if @@ -277,10 +278,11 @@ subroutine amg_daggrmat_smth_bld(dol1smoothing,a,desc_a,ilaggr,nlaggr,& !$OMP end parallel do if (parms%aggr_omega_alg == amg_eig_est_) then - if (do_l1correction) then - ! For l1-Jacobi this can be estimated with 1 - parms%aggr_omega_val = done - else if (parms%aggr_eig == amg_max_norm_) then + !if (do_l1correction) then + ! ! For l1-Jacobi this can be estimated with 1 + ! parms%aggr_omega_val = done + ! + if (parms%aggr_eig == amg_max_norm_) then allocate(arwsum(nrow)) call acsr%arwsum(arwsum) anorm = maxval(abs(adiag(1:nrow)*arwsum(1:nrow))) diff --git a/amgprec/impl/aggregator/amg_saggrmat_smth_bld.f90 b/amgprec/impl/aggregator/amg_saggrmat_smth_bld.f90 index 7cf657eb..1688b369 100644 --- a/amgprec/impl/aggregator/amg_saggrmat_smth_bld.f90 +++ b/amgprec/impl/aggregator/amg_saggrmat_smth_bld.f90 @@ -255,7 +255,8 @@ subroutine amg_saggrmat_smth_bld(dol1smoothing,a,desc_a,ilaggr,nlaggr,& enddo if (jd == -1) then - if (.not.do_l1correction) write(0,*) 'Wrong input: we need the diagonal!!!!', i + ! if (.not.do_l1correction) + write(0,*) 'Wrong input: we need the diagonal!!!!', i else acsrf%val(jd)=acsrf%val(jd)-tmp end if @@ -277,10 +278,11 @@ subroutine amg_saggrmat_smth_bld(dol1smoothing,a,desc_a,ilaggr,nlaggr,& !$OMP end parallel do if (parms%aggr_omega_alg == amg_eig_est_) then - if (do_l1correction) then - ! For l1-Jacobi this can be estimated with 1 - parms%aggr_omega_val = done - else if (parms%aggr_eig == amg_max_norm_) then + !if (do_l1correction) then + ! ! For l1-Jacobi this can be estimated with 1 + ! parms%aggr_omega_val = done + ! + if (parms%aggr_eig == amg_max_norm_) then allocate(arwsum(nrow)) call acsr%arwsum(arwsum) anorm = maxval(abs(adiag(1:nrow)*arwsum(1:nrow))) diff --git a/amgprec/impl/aggregator/amg_zaggrmat_smth_bld.f90 b/amgprec/impl/aggregator/amg_zaggrmat_smth_bld.f90 index 70dd0ecd..d35ac125 100644 --- a/amgprec/impl/aggregator/amg_zaggrmat_smth_bld.f90 +++ b/amgprec/impl/aggregator/amg_zaggrmat_smth_bld.f90 @@ -255,7 +255,8 @@ subroutine amg_zaggrmat_smth_bld(dol1smoothing,a,desc_a,ilaggr,nlaggr,& enddo if (jd == -1) then - if (.not.do_l1correction) write(0,*) 'Wrong input: we need the diagonal!!!!', i + ! if (.not.do_l1correction) + write(0,*) 'Wrong input: we need the diagonal!!!!', i else acsrf%val(jd)=acsrf%val(jd)-tmp end if @@ -277,10 +278,11 @@ subroutine amg_zaggrmat_smth_bld(dol1smoothing,a,desc_a,ilaggr,nlaggr,& !$OMP end parallel do if (parms%aggr_omega_alg == amg_eig_est_) then - if (do_l1correction) then - ! For l1-Jacobi this can be estimated with 1 - parms%aggr_omega_val = done - else if (parms%aggr_eig == amg_max_norm_) then + !if (do_l1correction) then + ! ! For l1-Jacobi this can be estimated with 1 + ! parms%aggr_omega_val = done + ! + if (parms%aggr_eig == amg_max_norm_) then allocate(arwsum(nrow)) call acsr%arwsum(arwsum) anorm = maxval(abs(adiag(1:nrow)*arwsum(1:nrow)))