From e0491f1f178b6eec52b9ff4f20ff880cbfebf180 Mon Sep 17 00:00:00 2001 From: Cirdans-Home Date: Thu, 30 Apr 2020 19:10:01 +0200 Subject: [PATCH] Changed selection criterion between Jacobi/BJAC application --- mlprec/impl/smoother/mld_c_jac_smoother_apply_vect.f90 | 8 +++++--- mlprec/impl/smoother/mld_d_jac_smoother_apply_vect.f90 | 8 +++++--- mlprec/impl/smoother/mld_s_jac_smoother_apply_vect.f90 | 8 +++++--- mlprec/impl/smoother/mld_z_jac_smoother_apply_vect.f90 | 8 +++++--- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/mlprec/impl/smoother/mld_c_jac_smoother_apply_vect.f90 b/mlprec/impl/smoother/mld_c_jac_smoother_apply_vect.f90 index 22bc1cc3..2b55f98d 100644 --- a/mlprec/impl/smoother/mld_c_jac_smoother_apply_vect.f90 +++ b/mlprec/impl/smoother/mld_c_jac_smoother_apply_vect.f90 @@ -39,6 +39,7 @@ subroutine mld_c_jac_smoother_apply_vect(alpha,sm,x,beta,y,desc_data,trans,& & sweeps,work,wv,info,init,initu) use psb_base_mod + use mld_c_diag_solver use psb_base_krylov_conv_mod, only : log_conv use mld_c_jac_smoother, mld_protect_name => mld_c_jac_smoother_apply_vect implicit none @@ -124,7 +125,8 @@ subroutine mld_c_jac_smoother_apply_vect(alpha,sm,x,beta,y,desc_data,trans,& endif else if (sweeps >= 0) then - if (associated(sm%pa)) then + select type (smsv => sm%sv) + class is (mld_c_diag_solver_type) ! ! This means we are dealing with a pure Jacobi smoother/solver. ! @@ -200,7 +202,7 @@ subroutine mld_c_jac_smoother_apply_vect(alpha,sm,x,beta,y,desc_data,trans,& end associate - else + class default ! ! ! Apply multiple sweeps of a block-Jacobi solver @@ -289,7 +291,7 @@ subroutine mld_c_jac_smoother_apply_vect(alpha,sm,x,beta,y,desc_data,trans,& end if end associate - end if + end select else diff --git a/mlprec/impl/smoother/mld_d_jac_smoother_apply_vect.f90 b/mlprec/impl/smoother/mld_d_jac_smoother_apply_vect.f90 index e9740f40..2e95454d 100644 --- a/mlprec/impl/smoother/mld_d_jac_smoother_apply_vect.f90 +++ b/mlprec/impl/smoother/mld_d_jac_smoother_apply_vect.f90 @@ -39,6 +39,7 @@ subroutine mld_d_jac_smoother_apply_vect(alpha,sm,x,beta,y,desc_data,trans,& & sweeps,work,wv,info,init,initu) use psb_base_mod + use mld_d_diag_solver use psb_base_krylov_conv_mod, only : log_conv use mld_d_jac_smoother, mld_protect_name => mld_d_jac_smoother_apply_vect implicit none @@ -124,7 +125,8 @@ subroutine mld_d_jac_smoother_apply_vect(alpha,sm,x,beta,y,desc_data,trans,& endif else if (sweeps >= 0) then - if (associated(sm%pa)) then + select type (smsv => sm%sv) + class is (mld_d_diag_solver_type) ! ! This means we are dealing with a pure Jacobi smoother/solver. ! @@ -200,7 +202,7 @@ subroutine mld_d_jac_smoother_apply_vect(alpha,sm,x,beta,y,desc_data,trans,& end associate - else + class default ! ! ! Apply multiple sweeps of a block-Jacobi solver @@ -289,7 +291,7 @@ subroutine mld_d_jac_smoother_apply_vect(alpha,sm,x,beta,y,desc_data,trans,& end if end associate - end if + end select else diff --git a/mlprec/impl/smoother/mld_s_jac_smoother_apply_vect.f90 b/mlprec/impl/smoother/mld_s_jac_smoother_apply_vect.f90 index 3d864606..5ed28511 100644 --- a/mlprec/impl/smoother/mld_s_jac_smoother_apply_vect.f90 +++ b/mlprec/impl/smoother/mld_s_jac_smoother_apply_vect.f90 @@ -39,6 +39,7 @@ subroutine mld_s_jac_smoother_apply_vect(alpha,sm,x,beta,y,desc_data,trans,& & sweeps,work,wv,info,init,initu) use psb_base_mod + use mld_s_diag_solver use psb_base_krylov_conv_mod, only : log_conv use mld_s_jac_smoother, mld_protect_name => mld_s_jac_smoother_apply_vect implicit none @@ -124,7 +125,8 @@ subroutine mld_s_jac_smoother_apply_vect(alpha,sm,x,beta,y,desc_data,trans,& endif else if (sweeps >= 0) then - if (associated(sm%pa)) then + select type (smsv => sm%sv) + class is (mld_s_diag_solver_type) ! ! This means we are dealing with a pure Jacobi smoother/solver. ! @@ -200,7 +202,7 @@ subroutine mld_s_jac_smoother_apply_vect(alpha,sm,x,beta,y,desc_data,trans,& end associate - else + class default ! ! ! Apply multiple sweeps of a block-Jacobi solver @@ -289,7 +291,7 @@ subroutine mld_s_jac_smoother_apply_vect(alpha,sm,x,beta,y,desc_data,trans,& end if end associate - end if + end select else diff --git a/mlprec/impl/smoother/mld_z_jac_smoother_apply_vect.f90 b/mlprec/impl/smoother/mld_z_jac_smoother_apply_vect.f90 index cd957f41..2da1aa53 100644 --- a/mlprec/impl/smoother/mld_z_jac_smoother_apply_vect.f90 +++ b/mlprec/impl/smoother/mld_z_jac_smoother_apply_vect.f90 @@ -39,6 +39,7 @@ subroutine mld_z_jac_smoother_apply_vect(alpha,sm,x,beta,y,desc_data,trans,& & sweeps,work,wv,info,init,initu) use psb_base_mod + use mld_z_diag_solver use psb_base_krylov_conv_mod, only : log_conv use mld_z_jac_smoother, mld_protect_name => mld_z_jac_smoother_apply_vect implicit none @@ -124,7 +125,8 @@ subroutine mld_z_jac_smoother_apply_vect(alpha,sm,x,beta,y,desc_data,trans,& endif else if (sweeps >= 0) then - if (associated(sm%pa)) then + select type (smsv => sm%sv) + class is (mld_z_diag_solver_type) ! ! This means we are dealing with a pure Jacobi smoother/solver. ! @@ -200,7 +202,7 @@ subroutine mld_z_jac_smoother_apply_vect(alpha,sm,x,beta,y,desc_data,trans,& end associate - else + class default ! ! ! Apply multiple sweeps of a block-Jacobi solver @@ -289,7 +291,7 @@ subroutine mld_z_jac_smoother_apply_vect(alpha,sm,x,beta,y,desc_data,trans,& end if end associate - end if + end select else