From 64a65e3f6c941e6abb9d095ad07f4cd47508b242 Mon Sep 17 00:00:00 2001 From: Cirdans-Home Date: Mon, 29 Mar 2021 17:05:44 +0200 Subject: [PATCH] Added options for coarse BJAC sets --- amgprec/impl/amg_ccprecset.F90 | 36 +++++++++++++++++++++++++++++----- amgprec/impl/amg_dcprecset.F90 | 36 +++++++++++++++++++++++++++++----- amgprec/impl/amg_scprecset.F90 | 36 +++++++++++++++++++++++++++++----- amgprec/impl/amg_zcprecset.F90 | 36 +++++++++++++++++++++++++++++----- 4 files changed, 124 insertions(+), 20 deletions(-) diff --git a/amgprec/impl/amg_ccprecset.F90 b/amgprec/impl/amg_ccprecset.F90 index 8226efe4..3bcdb4f9 100644 --- a/amgprec/impl/amg_ccprecset.F90 +++ b/amgprec/impl/amg_ccprecset.F90 @@ -435,6 +435,14 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx) do il=ilev_, ilmax_ call p%precv(il)%set(what,amg_repl_mat_,info,pos=pos) end do + case('BJAC_STOP') + do il=ilev_, ilmax_ + call p%precv(il)%set('SMOOTHER_STOP',string,info,pos=pos) + end do + case('BJAC_TRACE') + do il=ilev_, ilmax_ + call p%precv(il)%set('SMOOTHER_TRACE',string,info,pos=pos) + end do case('COARSE_SUBSOLVE') if (ilev_ /= nlev_) then write(psb_err_unit,*) name,& @@ -711,6 +719,15 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx) end select endif + case('BJAC_STOP') + if (nlev_ > 1) then + call p%precv(il)%set('SMOOTHER_STOP',string,info,pos=pos) + end if + case('BJAC_TRACE') + if (nlev_ > 1) then + call p%precv(il)%set('SMOOTHER_TRACE',string,info,pos=pos) + end if + case('COARSE_SUBSOLVE') if (nlev_ > 1) then call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) @@ -840,10 +857,17 @@ subroutine amg_ccprecsetr(p,what,val,info,ilev,ilmax,pos,idx) ! if (present(ilev)) then - do il=ilev_, ilmax_ - call p%precv(il)%set(what,val,info,pos=pos,idx=idx) - end do - + select case(psb_toupper(trim(what))) + case('BJAC_STOPTOL') + do il=ilev_, ilmax_ + call p%precv(il)%set('SMOOTHER_STOPTOL',val,info,pos=pos) + end do + case default + ! Nothing to do here, setted elsewhere + do il=ilev_, ilmax_ + call p%precv(il)%set(what,val,info,pos=pos,idx=idx) + end do + end select else if (.not.present(ilev)) then ! ! ilev not specified: set preconditioner parameters at all the appropriate levels @@ -853,7 +877,9 @@ subroutine amg_ccprecsetr(p,what,val,info,ilev,ilmax,pos,idx) case('COARSE_ILUTHRS') ilev_=nlev_ call p%precv(ilev_)%set('SUB_ILUTHRS',val,info,pos=pos) - + case('BJAC_STOPTOL') + ilev_=nlev_ + call p%precv(ilev_)%set('SMOOTHER_STOPTOL',val,info,pos=pos) case default do il=1,nlev_ diff --git a/amgprec/impl/amg_dcprecset.F90 b/amgprec/impl/amg_dcprecset.F90 index 395ab70b..99891881 100644 --- a/amgprec/impl/amg_dcprecset.F90 +++ b/amgprec/impl/amg_dcprecset.F90 @@ -447,6 +447,14 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx) do il=ilev_, ilmax_ call p%precv(il)%set(what,amg_repl_mat_,info,pos=pos) end do + case('BJAC_STOP') + do il=ilev_, ilmax_ + call p%precv(il)%set('SMOOTHER_STOP',string,info,pos=pos) + end do + case('BJAC_TRACE') + do il=ilev_, ilmax_ + call p%precv(il)%set('SMOOTHER_TRACE',string,info,pos=pos) + end do case('COARSE_SUBSOLVE') if (ilev_ /= nlev_) then write(psb_err_unit,*) name,& @@ -751,6 +759,15 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx) end select endif + case('BJAC_STOP') + if (nlev_ > 1) then + call p%precv(il)%set('SMOOTHER_STOP',string,info,pos=pos) + end if + case('BJAC_TRACE') + if (nlev_ > 1) then + call p%precv(il)%set('SMOOTHER_TRACE',string,info,pos=pos) + end if + case('COARSE_SUBSOLVE') if (nlev_ > 1) then call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) @@ -880,10 +897,17 @@ subroutine amg_dcprecsetr(p,what,val,info,ilev,ilmax,pos,idx) ! if (present(ilev)) then - do il=ilev_, ilmax_ - call p%precv(il)%set(what,val,info,pos=pos,idx=idx) - end do - + select case(psb_toupper(trim(what))) + case('BJAC_STOPTOL') + do il=ilev_, ilmax_ + call p%precv(il)%set('SMOOTHER_STOPTOL',val,info,pos=pos) + end do + case default + ! Nothing to do here, setted elsewhere + do il=ilev_, ilmax_ + call p%precv(il)%set(what,val,info,pos=pos,idx=idx) + end do + end select else if (.not.present(ilev)) then ! ! ilev not specified: set preconditioner parameters at all the appropriate levels @@ -893,7 +917,9 @@ subroutine amg_dcprecsetr(p,what,val,info,ilev,ilmax,pos,idx) case('COARSE_ILUTHRS') ilev_=nlev_ call p%precv(ilev_)%set('SUB_ILUTHRS',val,info,pos=pos) - + case('BJAC_STOPTOL') + ilev_=nlev_ + call p%precv(ilev_)%set('SMOOTHER_STOPTOL',val,info,pos=pos) case default do il=1,nlev_ diff --git a/amgprec/impl/amg_scprecset.F90 b/amgprec/impl/amg_scprecset.F90 index 12164dfd..8e06b31e 100644 --- a/amgprec/impl/amg_scprecset.F90 +++ b/amgprec/impl/amg_scprecset.F90 @@ -435,6 +435,14 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx) do il=ilev_, ilmax_ call p%precv(il)%set(what,amg_repl_mat_,info,pos=pos) end do + case('BJAC_STOP') + do il=ilev_, ilmax_ + call p%precv(il)%set('SMOOTHER_STOP',string,info,pos=pos) + end do + case('BJAC_TRACE') + do il=ilev_, ilmax_ + call p%precv(il)%set('SMOOTHER_TRACE',string,info,pos=pos) + end do case('COARSE_SUBSOLVE') if (ilev_ /= nlev_) then write(psb_err_unit,*) name,& @@ -711,6 +719,15 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx) end select endif + case('BJAC_STOP') + if (nlev_ > 1) then + call p%precv(il)%set('SMOOTHER_STOP',string,info,pos=pos) + end if + case('BJAC_TRACE') + if (nlev_ > 1) then + call p%precv(il)%set('SMOOTHER_TRACE',string,info,pos=pos) + end if + case('COARSE_SUBSOLVE') if (nlev_ > 1) then call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) @@ -840,10 +857,17 @@ subroutine amg_scprecsetr(p,what,val,info,ilev,ilmax,pos,idx) ! if (present(ilev)) then - do il=ilev_, ilmax_ - call p%precv(il)%set(what,val,info,pos=pos,idx=idx) - end do - + select case(psb_toupper(trim(what))) + case('BJAC_STOPTOL') + do il=ilev_, ilmax_ + call p%precv(il)%set('SMOOTHER_STOPTOL',val,info,pos=pos) + end do + case default + ! Nothing to do here, setted elsewhere + do il=ilev_, ilmax_ + call p%precv(il)%set(what,val,info,pos=pos,idx=idx) + end do + end select else if (.not.present(ilev)) then ! ! ilev not specified: set preconditioner parameters at all the appropriate levels @@ -853,7 +877,9 @@ subroutine amg_scprecsetr(p,what,val,info,ilev,ilmax,pos,idx) case('COARSE_ILUTHRS') ilev_=nlev_ call p%precv(ilev_)%set('SUB_ILUTHRS',val,info,pos=pos) - + case('BJAC_STOPTOL') + ilev_=nlev_ + call p%precv(ilev_)%set('SMOOTHER_STOPTOL',val,info,pos=pos) case default do il=1,nlev_ diff --git a/amgprec/impl/amg_zcprecset.F90 b/amgprec/impl/amg_zcprecset.F90 index 309cc9bb..9e67bc9a 100644 --- a/amgprec/impl/amg_zcprecset.F90 +++ b/amgprec/impl/amg_zcprecset.F90 @@ -447,6 +447,14 @@ subroutine amg_zcprecsetc(p,what,string,info,ilev,ilmax,pos,idx) do il=ilev_, ilmax_ call p%precv(il)%set(what,amg_repl_mat_,info,pos=pos) end do + case('BJAC_STOP') + do il=ilev_, ilmax_ + call p%precv(il)%set('SMOOTHER_STOP',string,info,pos=pos) + end do + case('BJAC_TRACE') + do il=ilev_, ilmax_ + call p%precv(il)%set('SMOOTHER_TRACE',string,info,pos=pos) + end do case('COARSE_SUBSOLVE') if (ilev_ /= nlev_) then write(psb_err_unit,*) name,& @@ -751,6 +759,15 @@ subroutine amg_zcprecsetc(p,what,string,info,ilev,ilmax,pos,idx) end select endif + case('BJAC_STOP') + if (nlev_ > 1) then + call p%precv(il)%set('SMOOTHER_STOP',string,info,pos=pos) + end if + case('BJAC_TRACE') + if (nlev_ > 1) then + call p%precv(il)%set('SMOOTHER_TRACE',string,info,pos=pos) + end if + case('COARSE_SUBSOLVE') if (nlev_ > 1) then call p%precv(nlev_)%set('SUB_SOLVE',string,info,pos=pos) @@ -880,10 +897,17 @@ subroutine amg_zcprecsetr(p,what,val,info,ilev,ilmax,pos,idx) ! if (present(ilev)) then - do il=ilev_, ilmax_ - call p%precv(il)%set(what,val,info,pos=pos,idx=idx) - end do - + select case(psb_toupper(trim(what))) + case('BJAC_STOPTOL') + do il=ilev_, ilmax_ + call p%precv(il)%set('SMOOTHER_STOPTOL',val,info,pos=pos) + end do + case default + ! Nothing to do here, setted elsewhere + do il=ilev_, ilmax_ + call p%precv(il)%set(what,val,info,pos=pos,idx=idx) + end do + end select else if (.not.present(ilev)) then ! ! ilev not specified: set preconditioner parameters at all the appropriate levels @@ -893,7 +917,9 @@ subroutine amg_zcprecsetr(p,what,val,info,ilev,ilmax,pos,idx) case('COARSE_ILUTHRS') ilev_=nlev_ call p%precv(ilev_)%set('SUB_ILUTHRS',val,info,pos=pos) - + case('BJAC_STOPTOL') + ilev_=nlev_ + call p%precv(ilev_)%set('SMOOTHER_STOPTOL',val,info,pos=pos) case default do il=1,nlev_