From af178daa84ce08eb58b649fdce2b49e745464c25 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Mon, 27 Sep 2021 14:50:46 +0200 Subject: [PATCH] Modify dump method to print base level matrix. --- amgprec/impl/level/amg_c_base_onelev_dump.f90 | 26 ++++++++++--------- amgprec/impl/level/amg_d_base_onelev_dump.f90 | 26 ++++++++++--------- amgprec/impl/level/amg_s_base_onelev_dump.f90 | 26 ++++++++++--------- amgprec/impl/level/amg_z_base_onelev_dump.f90 | 26 ++++++++++--------- 4 files changed, 56 insertions(+), 48 deletions(-) diff --git a/amgprec/impl/level/amg_c_base_onelev_dump.f90 b/amgprec/impl/level/amg_c_base_onelev_dump.f90 index aba4bfa6..14b4c9b6 100644 --- a/amgprec/impl/level/amg_c_base_onelev_dump.f90 +++ b/amgprec/impl/level/amg_c_base_onelev_dump.f90 @@ -101,7 +101,13 @@ subroutine amg_c_base_onelev_dump(lv,level,info,prefix,head,ac,rp,& end if if (global_num_) then - if (level >= 2) then + if (level == 1) then + if (ac_) then + ivr = lv%base_desc%get_global_indices(owned=.false.) + write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx' + call lv%base_a%print(fname,head=head,iv=ivr) + end if + else if (level >= 2) then if (ac_) then ivr = lv%desc_ac%get_global_indices(owned=.false.) write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx' @@ -126,7 +132,12 @@ subroutine amg_c_base_onelev_dump(lv,level,info,prefix,head,ac,rp,& end if end if else - if (level >= 2) then + if (level == 1) then + if (ac_) then + write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx' + call lv%base_a%print(fname,head=head) + end if + else if (level >= 2) then if (ac_) then write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx' call lv%ac%print(fname,head=head) @@ -146,16 +157,7 @@ subroutine amg_c_base_onelev_dump(lv,level,info,prefix,head,ac,rp,& end if end if - if (level >= 2) then - if (allocated(lv%sm)) then - call lv%sm%dump(lv%desc_ac,level,info,smoother=smoother, & - & solver=solver,prefix=trim(prefix_)//"_sm",global_num=global_num) - end if - if (allocated(lv%sm2a)) then - call lv%sm2a%dump(lv%desc_ac,level,info,smoother=smoother, & - & solver=solver,prefix=trim(prefix_)//"_sm2a",global_num=global_num) - end if - else + if (level >= 1) then if (allocated(lv%sm)) then call lv%sm%dump(lv%base_desc,level,info,smoother=smoother, & & solver=solver,prefix=trim(prefix_)//"_sm",global_num=global_num) diff --git a/amgprec/impl/level/amg_d_base_onelev_dump.f90 b/amgprec/impl/level/amg_d_base_onelev_dump.f90 index 32fe1e55..c1013d41 100644 --- a/amgprec/impl/level/amg_d_base_onelev_dump.f90 +++ b/amgprec/impl/level/amg_d_base_onelev_dump.f90 @@ -101,7 +101,13 @@ subroutine amg_d_base_onelev_dump(lv,level,info,prefix,head,ac,rp,& end if if (global_num_) then - if (level >= 2) then + if (level == 1) then + if (ac_) then + ivr = lv%base_desc%get_global_indices(owned=.false.) + write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx' + call lv%base_a%print(fname,head=head,iv=ivr) + end if + else if (level >= 2) then if (ac_) then ivr = lv%desc_ac%get_global_indices(owned=.false.) write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx' @@ -126,7 +132,12 @@ subroutine amg_d_base_onelev_dump(lv,level,info,prefix,head,ac,rp,& end if end if else - if (level >= 2) then + if (level == 1) then + if (ac_) then + write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx' + call lv%base_a%print(fname,head=head) + end if + else if (level >= 2) then if (ac_) then write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx' call lv%ac%print(fname,head=head) @@ -146,16 +157,7 @@ subroutine amg_d_base_onelev_dump(lv,level,info,prefix,head,ac,rp,& end if end if - if (level >= 2) then - if (allocated(lv%sm)) then - call lv%sm%dump(lv%desc_ac,level,info,smoother=smoother, & - & solver=solver,prefix=trim(prefix_)//"_sm",global_num=global_num) - end if - if (allocated(lv%sm2a)) then - call lv%sm2a%dump(lv%desc_ac,level,info,smoother=smoother, & - & solver=solver,prefix=trim(prefix_)//"_sm2a",global_num=global_num) - end if - else + if (level >= 1) then if (allocated(lv%sm)) then call lv%sm%dump(lv%base_desc,level,info,smoother=smoother, & & solver=solver,prefix=trim(prefix_)//"_sm",global_num=global_num) diff --git a/amgprec/impl/level/amg_s_base_onelev_dump.f90 b/amgprec/impl/level/amg_s_base_onelev_dump.f90 index ba70a1a1..d30c0bf7 100644 --- a/amgprec/impl/level/amg_s_base_onelev_dump.f90 +++ b/amgprec/impl/level/amg_s_base_onelev_dump.f90 @@ -101,7 +101,13 @@ subroutine amg_s_base_onelev_dump(lv,level,info,prefix,head,ac,rp,& end if if (global_num_) then - if (level >= 2) then + if (level == 1) then + if (ac_) then + ivr = lv%base_desc%get_global_indices(owned=.false.) + write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx' + call lv%base_a%print(fname,head=head,iv=ivr) + end if + else if (level >= 2) then if (ac_) then ivr = lv%desc_ac%get_global_indices(owned=.false.) write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx' @@ -126,7 +132,12 @@ subroutine amg_s_base_onelev_dump(lv,level,info,prefix,head,ac,rp,& end if end if else - if (level >= 2) then + if (level == 1) then + if (ac_) then + write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx' + call lv%base_a%print(fname,head=head) + end if + else if (level >= 2) then if (ac_) then write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx' call lv%ac%print(fname,head=head) @@ -146,16 +157,7 @@ subroutine amg_s_base_onelev_dump(lv,level,info,prefix,head,ac,rp,& end if end if - if (level >= 2) then - if (allocated(lv%sm)) then - call lv%sm%dump(lv%desc_ac,level,info,smoother=smoother, & - & solver=solver,prefix=trim(prefix_)//"_sm",global_num=global_num) - end if - if (allocated(lv%sm2a)) then - call lv%sm2a%dump(lv%desc_ac,level,info,smoother=smoother, & - & solver=solver,prefix=trim(prefix_)//"_sm2a",global_num=global_num) - end if - else + if (level >= 1) then if (allocated(lv%sm)) then call lv%sm%dump(lv%base_desc,level,info,smoother=smoother, & & solver=solver,prefix=trim(prefix_)//"_sm",global_num=global_num) diff --git a/amgprec/impl/level/amg_z_base_onelev_dump.f90 b/amgprec/impl/level/amg_z_base_onelev_dump.f90 index 0c111355..5d0b8f27 100644 --- a/amgprec/impl/level/amg_z_base_onelev_dump.f90 +++ b/amgprec/impl/level/amg_z_base_onelev_dump.f90 @@ -101,7 +101,13 @@ subroutine amg_z_base_onelev_dump(lv,level,info,prefix,head,ac,rp,& end if if (global_num_) then - if (level >= 2) then + if (level == 1) then + if (ac_) then + ivr = lv%base_desc%get_global_indices(owned=.false.) + write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx' + call lv%base_a%print(fname,head=head,iv=ivr) + end if + else if (level >= 2) then if (ac_) then ivr = lv%desc_ac%get_global_indices(owned=.false.) write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx' @@ -126,7 +132,12 @@ subroutine amg_z_base_onelev_dump(lv,level,info,prefix,head,ac,rp,& end if end if else - if (level >= 2) then + if (level == 1) then + if (ac_) then + write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx' + call lv%base_a%print(fname,head=head) + end if + else if (level >= 2) then if (ac_) then write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx' call lv%ac%print(fname,head=head) @@ -146,16 +157,7 @@ subroutine amg_z_base_onelev_dump(lv,level,info,prefix,head,ac,rp,& end if end if - if (level >= 2) then - if (allocated(lv%sm)) then - call lv%sm%dump(lv%desc_ac,level,info,smoother=smoother, & - & solver=solver,prefix=trim(prefix_)//"_sm",global_num=global_num) - end if - if (allocated(lv%sm2a)) then - call lv%sm2a%dump(lv%desc_ac,level,info,smoother=smoother, & - & solver=solver,prefix=trim(prefix_)//"_sm2a",global_num=global_num) - end if - else + if (level >= 1) then if (allocated(lv%sm)) then call lv%sm%dump(lv%base_desc,level,info,smoother=smoother, & & solver=solver,prefix=trim(prefix_)//"_sm",global_num=global_num)