From 50951ef6367a05753ac75641c3636a3c9fe6ad1b Mon Sep 17 00:00:00 2001 From: Cirdans-Home Date: Wed, 5 May 2021 17:37:45 +0200 Subject: [PATCH] Fixed set of coarse matrix for BJAC --- Makefile | 2 +- amgprec/impl/amg_ccprecset.F90 | 16 ++++++++++++++++ amgprec/impl/amg_dcprecset.F90 | 20 ++++++++++++++++++++ amgprec/impl/amg_scprecset.F90 | 16 ++++++++++++++++ amgprec/impl/amg_zcprecset.F90 | 20 ++++++++++++++++++++ 5 files changed, 73 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d0dd8ab9..6b32af10 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ include Make.inc all: library -library: libdir amgp +library: libdir amgp cbnd #cbnd libdir: diff --git a/amgprec/impl/amg_ccprecset.F90 b/amgprec/impl/amg_ccprecset.F90 index 0cd0822e..3fb97bf3 100644 --- a/amgprec/impl/amg_ccprecset.F90 +++ b/amgprec/impl/amg_ccprecset.F90 @@ -462,6 +462,14 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx) select case (psb_toupper(string)) case('BJAC') call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos) +#if defined(HAVE_SLU_) + call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos) +#elif defined(HAVE_MUMPS_) + call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos) +#else + call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos) +#endif + call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info) case('L1-BJAC') call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos) #if defined(HAVE_SLU_) @@ -612,6 +620,14 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx) select case (psb_toupper(trim(string))) case('BJAC') call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos) +#if defined(HAVE_SLU_) + call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos) +#elif defined(HAVE_MUMPS_) + call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos) +#else + call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos) +#endif + call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info) case('L1-BJAC') call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos) #if defined(HAVE_SLU_) diff --git a/amgprec/impl/amg_dcprecset.F90 b/amgprec/impl/amg_dcprecset.F90 index 5fc667c1..4fe1dc0b 100644 --- a/amgprec/impl/amg_dcprecset.F90 +++ b/amgprec/impl/amg_dcprecset.F90 @@ -474,6 +474,16 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx) select case (psb_toupper(string)) case('BJAC') call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos) +#if defined(HAVE_UMF_) + call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos) +#elif defined(HAVE_SLU_) + call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos) +#elif defined(HAVE_MUMPS_) + call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos) +#else + call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos) +#endif + call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info) case('L1-BJAC') call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos) #if defined(HAVE_UMF_) @@ -638,6 +648,16 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx) select case (psb_toupper(trim(string))) case('BJAC') call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos) +#if defined(HAVE_UMF_) + call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos) +#elif defined(HAVE_SLU_) + call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos) +#elif defined(HAVE_MUMPS_) + call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos) +#else + call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos) +#endif + call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info) case('L1-BJAC') call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos) #if defined(HAVE_UMF_) diff --git a/amgprec/impl/amg_scprecset.F90 b/amgprec/impl/amg_scprecset.F90 index 95d0478f..e82df5ba 100644 --- a/amgprec/impl/amg_scprecset.F90 +++ b/amgprec/impl/amg_scprecset.F90 @@ -462,6 +462,14 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx) select case (psb_toupper(string)) case('BJAC') call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos) +#if defined(HAVE_SLU_) + call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos) +#elif defined(HAVE_MUMPS_) + call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos) +#else + call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos) +#endif + call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info) case('L1-BJAC') call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos) #if defined(HAVE_SLU_) @@ -612,6 +620,14 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx) select case (psb_toupper(trim(string))) case('BJAC') call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos) +#if defined(HAVE_SLU_) + call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos) +#elif defined(HAVE_MUMPS_) + call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos) +#else + call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos) +#endif + call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info) case('L1-BJAC') call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos) #if defined(HAVE_SLU_) diff --git a/amgprec/impl/amg_zcprecset.F90 b/amgprec/impl/amg_zcprecset.F90 index 108f0ddb..4e27ac15 100644 --- a/amgprec/impl/amg_zcprecset.F90 +++ b/amgprec/impl/amg_zcprecset.F90 @@ -474,6 +474,16 @@ subroutine amg_zcprecsetc(p,what,string,info,ilev,ilmax,pos,idx) select case (psb_toupper(string)) case('BJAC') call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos) +#if defined(HAVE_UMF_) + call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos) +#elif defined(HAVE_SLU_) + call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos) +#elif defined(HAVE_MUMPS_) + call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos) +#else + call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos) +#endif + call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info) case('L1-BJAC') call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos) #if defined(HAVE_UMF_) @@ -638,6 +648,16 @@ subroutine amg_zcprecsetc(p,what,string,info,ilev,ilmax,pos,idx) select case (psb_toupper(trim(string))) case('BJAC') call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_bjac_,info,pos=pos) +#if defined(HAVE_UMF_) + call p%precv(nlev_)%set('SUB_SOLVE',amg_umf_,info,pos=pos) +#elif defined(HAVE_SLU_) + call p%precv(nlev_)%set('SUB_SOLVE',amg_slu_,info,pos=pos) +#elif defined(HAVE_MUMPS_) + call p%precv(nlev_)%set('SUB_SOLVE',amg_mumps_,info,pos=pos) +#else + call p%precv(nlev_)%set('SUB_SOLVE',psb_ilu_n_,info,pos=pos) +#endif + call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info) case('L1-BJAC') call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_l1_bjac_,info,pos=pos) #if defined(HAVE_UMF_)