mirror of
https://github.com/sfilippone/amg4psblas.git
synced 2026-10-20 12:52:16 +00:00
Defined a new CNV method for wrkspace. Changed LV%BLD to call CNV method at end, so all relevant fields are taken care of. Fixed LV%BLD to handle all smoothers and wrkspace.
This commit is contained in:
@@ -93,30 +93,51 @@ subroutine mld_c_base_onelev_build(lv,info,amold,vmold,imold)
|
||||
& 'Jacobi sweeps',izero,is_int_non_negative)
|
||||
call mld_check_def(lv%parms%sweeps_post,&
|
||||
& 'Jacobi sweeps',izero,is_int_non_negative)
|
||||
|
||||
call lv%sm%build(lv%base_a,lv%base_desc,&
|
||||
& info,amold=amold,vmold=vmold,imold=imold)
|
||||
if (info == 0) then
|
||||
if (allocated(lv%sm2a)) then
|
||||
call lv%sm2a%build(lv%base_a,lv%base_desc,info,&
|
||||
& amold=amold,vmold=vmold,imold=imold)
|
||||
lv%sm2 => lv%sm2a
|
||||
else
|
||||
lv%sm2 => lv%sm
|
||||
|
||||
if (.false.) then
|
||||
call lv%sm%build(lv%base_a,lv%base_desc,&
|
||||
& info,amold=amold,vmold=vmold,imold=imold)
|
||||
if (info == 0) then
|
||||
if (allocated(lv%sm2a)) then
|
||||
call lv%sm2a%build(lv%base_a,lv%base_desc,info,&
|
||||
& amold=amold,vmold=vmold,imold=imold)
|
||||
lv%sm2 => lv%sm2a
|
||||
else
|
||||
lv%sm2 => lv%sm
|
||||
end if
|
||||
end if
|
||||
if (info /=0) then
|
||||
info = psb_err_internal_error_
|
||||
call psb_errpush(info,name,&
|
||||
& a_err='Smoother bld error')
|
||||
goto 9999
|
||||
end if
|
||||
else
|
||||
call lv%sm%build(lv%base_a,lv%base_desc,info)
|
||||
if (info == 0) then
|
||||
if (allocated(lv%sm2a)) then
|
||||
call lv%sm2a%build(lv%base_a,lv%base_desc,info)
|
||||
lv%sm2 => lv%sm2a
|
||||
else
|
||||
lv%sm2 => lv%sm
|
||||
end if
|
||||
end if
|
||||
if (info /=0 ) then
|
||||
info = psb_err_internal_error_
|
||||
call psb_errpush(info,name,&
|
||||
& a_err='Smoother bld error')
|
||||
goto 9999
|
||||
end if
|
||||
end if
|
||||
if (info /=0) then
|
||||
info = psb_err_internal_error_
|
||||
call psb_errpush(info,name,&
|
||||
& a_err='Smoother bld error')
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
if (any((/present(amold),present(vmold),present(imold)/))) &
|
||||
& call lv%cnv(info,amold=amold,vmold=vmold,imold=imold)
|
||||
end if
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
|
||||
9999 call psb_error_handler(err_act)
|
||||
|
||||
|
||||
return
|
||||
|
||||
|
||||
end subroutine mld_c_base_onelev_build
|
||||
|
||||
@@ -54,10 +54,14 @@ subroutine mld_c_base_onelev_cnv(lv,info,amold,vmold,imold)
|
||||
if (any((/present(amold),present(vmold),present(imold)/))) then
|
||||
if (allocated(lv%sm)) &
|
||||
& call lv%sm%cnv(info,amold=amold,vmold=vmold,imold=imold)
|
||||
if (info == psb_success_ .and. allocated(lv%sm2a)) &
|
||||
& call lv%sm2a%cnv(info,amold=amold,vmold=vmold,imold=imold)
|
||||
if (info == psb_success_ .and. allocated(lv%wrk)) &
|
||||
& call lv%wrk(vmold=vmold)
|
||||
if (info == psb_success_.and. lv%ac%is_asb()) &
|
||||
& call lv%ac%cscnv(info,mold=amold)
|
||||
if (info == psb_success_ .and. lv%desc_ac%is_ok()) &
|
||||
& call lv%desc_ac%cnv(imold)
|
||||
if (info == psb_success_ .and. lv%desc_ac%is_ok() &
|
||||
& .and. present(imold)) call lv%desc_ac%cnv(imold)
|
||||
call lv%map%cnv(info,mold=amold,imold=imold)
|
||||
end if
|
||||
end subroutine mld_c_base_onelev_cnv
|
||||
|
||||
@@ -93,30 +93,51 @@ subroutine mld_d_base_onelev_build(lv,info,amold,vmold,imold)
|
||||
& 'Jacobi sweeps',izero,is_int_non_negative)
|
||||
call mld_check_def(lv%parms%sweeps_post,&
|
||||
& 'Jacobi sweeps',izero,is_int_non_negative)
|
||||
|
||||
call lv%sm%build(lv%base_a,lv%base_desc,&
|
||||
& info,amold=amold,vmold=vmold,imold=imold)
|
||||
if (info == 0) then
|
||||
if (allocated(lv%sm2a)) then
|
||||
call lv%sm2a%build(lv%base_a,lv%base_desc,info,&
|
||||
& amold=amold,vmold=vmold,imold=imold)
|
||||
lv%sm2 => lv%sm2a
|
||||
else
|
||||
lv%sm2 => lv%sm
|
||||
|
||||
if (.false.) then
|
||||
call lv%sm%build(lv%base_a,lv%base_desc,&
|
||||
& info,amold=amold,vmold=vmold,imold=imold)
|
||||
if (info == 0) then
|
||||
if (allocated(lv%sm2a)) then
|
||||
call lv%sm2a%build(lv%base_a,lv%base_desc,info,&
|
||||
& amold=amold,vmold=vmold,imold=imold)
|
||||
lv%sm2 => lv%sm2a
|
||||
else
|
||||
lv%sm2 => lv%sm
|
||||
end if
|
||||
end if
|
||||
if (info /=0) then
|
||||
info = psb_err_internal_error_
|
||||
call psb_errpush(info,name,&
|
||||
& a_err='Smoother bld error')
|
||||
goto 9999
|
||||
end if
|
||||
else
|
||||
call lv%sm%build(lv%base_a,lv%base_desc,info)
|
||||
if (info == 0) then
|
||||
if (allocated(lv%sm2a)) then
|
||||
call lv%sm2a%build(lv%base_a,lv%base_desc,info)
|
||||
lv%sm2 => lv%sm2a
|
||||
else
|
||||
lv%sm2 => lv%sm
|
||||
end if
|
||||
end if
|
||||
if (info /=0 ) then
|
||||
info = psb_err_internal_error_
|
||||
call psb_errpush(info,name,&
|
||||
& a_err='Smoother bld error')
|
||||
goto 9999
|
||||
end if
|
||||
end if
|
||||
if (info /=0) then
|
||||
info = psb_err_internal_error_
|
||||
call psb_errpush(info,name,&
|
||||
& a_err='Smoother bld error')
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
if (any((/present(amold),present(vmold),present(imold)/))) &
|
||||
& call lv%cnv(info,amold=amold,vmold=vmold,imold=imold)
|
||||
end if
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
|
||||
9999 call psb_error_handler(err_act)
|
||||
|
||||
|
||||
return
|
||||
|
||||
|
||||
end subroutine mld_d_base_onelev_build
|
||||
|
||||
@@ -54,10 +54,14 @@ subroutine mld_d_base_onelev_cnv(lv,info,amold,vmold,imold)
|
||||
if (any((/present(amold),present(vmold),present(imold)/))) then
|
||||
if (allocated(lv%sm)) &
|
||||
& call lv%sm%cnv(info,amold=amold,vmold=vmold,imold=imold)
|
||||
if (info == psb_success_ .and. allocated(lv%sm2a)) &
|
||||
& call lv%sm2a%cnv(info,amold=amold,vmold=vmold,imold=imold)
|
||||
if (info == psb_success_ .and. allocated(lv%wrk)) &
|
||||
& call lv%wrk(vmold=vmold)
|
||||
if (info == psb_success_.and. lv%ac%is_asb()) &
|
||||
& call lv%ac%cscnv(info,mold=amold)
|
||||
if (info == psb_success_ .and. lv%desc_ac%is_ok()) &
|
||||
& call lv%desc_ac%cnv(imold)
|
||||
if (info == psb_success_ .and. lv%desc_ac%is_ok() &
|
||||
& .and. present(imold)) call lv%desc_ac%cnv(imold)
|
||||
call lv%map%cnv(info,mold=amold,imold=imold)
|
||||
end if
|
||||
end subroutine mld_d_base_onelev_cnv
|
||||
|
||||
@@ -93,30 +93,51 @@ subroutine mld_s_base_onelev_build(lv,info,amold,vmold,imold)
|
||||
& 'Jacobi sweeps',izero,is_int_non_negative)
|
||||
call mld_check_def(lv%parms%sweeps_post,&
|
||||
& 'Jacobi sweeps',izero,is_int_non_negative)
|
||||
|
||||
call lv%sm%build(lv%base_a,lv%base_desc,&
|
||||
& info,amold=amold,vmold=vmold,imold=imold)
|
||||
if (info == 0) then
|
||||
if (allocated(lv%sm2a)) then
|
||||
call lv%sm2a%build(lv%base_a,lv%base_desc,info,&
|
||||
& amold=amold,vmold=vmold,imold=imold)
|
||||
lv%sm2 => lv%sm2a
|
||||
else
|
||||
lv%sm2 => lv%sm
|
||||
|
||||
if (.false.) then
|
||||
call lv%sm%build(lv%base_a,lv%base_desc,&
|
||||
& info,amold=amold,vmold=vmold,imold=imold)
|
||||
if (info == 0) then
|
||||
if (allocated(lv%sm2a)) then
|
||||
call lv%sm2a%build(lv%base_a,lv%base_desc,info,&
|
||||
& amold=amold,vmold=vmold,imold=imold)
|
||||
lv%sm2 => lv%sm2a
|
||||
else
|
||||
lv%sm2 => lv%sm
|
||||
end if
|
||||
end if
|
||||
if (info /=0) then
|
||||
info = psb_err_internal_error_
|
||||
call psb_errpush(info,name,&
|
||||
& a_err='Smoother bld error')
|
||||
goto 9999
|
||||
end if
|
||||
else
|
||||
call lv%sm%build(lv%base_a,lv%base_desc,info)
|
||||
if (info == 0) then
|
||||
if (allocated(lv%sm2a)) then
|
||||
call lv%sm2a%build(lv%base_a,lv%base_desc,info)
|
||||
lv%sm2 => lv%sm2a
|
||||
else
|
||||
lv%sm2 => lv%sm
|
||||
end if
|
||||
end if
|
||||
if (info /=0 ) then
|
||||
info = psb_err_internal_error_
|
||||
call psb_errpush(info,name,&
|
||||
& a_err='Smoother bld error')
|
||||
goto 9999
|
||||
end if
|
||||
end if
|
||||
if (info /=0) then
|
||||
info = psb_err_internal_error_
|
||||
call psb_errpush(info,name,&
|
||||
& a_err='Smoother bld error')
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
if (any((/present(amold),present(vmold),present(imold)/))) &
|
||||
& call lv%cnv(info,amold=amold,vmold=vmold,imold=imold)
|
||||
end if
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
|
||||
9999 call psb_error_handler(err_act)
|
||||
|
||||
|
||||
return
|
||||
|
||||
|
||||
end subroutine mld_s_base_onelev_build
|
||||
|
||||
@@ -54,10 +54,14 @@ subroutine mld_s_base_onelev_cnv(lv,info,amold,vmold,imold)
|
||||
if (any((/present(amold),present(vmold),present(imold)/))) then
|
||||
if (allocated(lv%sm)) &
|
||||
& call lv%sm%cnv(info,amold=amold,vmold=vmold,imold=imold)
|
||||
if (info == psb_success_ .and. allocated(lv%sm2a)) &
|
||||
& call lv%sm2a%cnv(info,amold=amold,vmold=vmold,imold=imold)
|
||||
if (info == psb_success_ .and. allocated(lv%wrk)) &
|
||||
& call lv%wrk(vmold=vmold)
|
||||
if (info == psb_success_.and. lv%ac%is_asb()) &
|
||||
& call lv%ac%cscnv(info,mold=amold)
|
||||
if (info == psb_success_ .and. lv%desc_ac%is_ok()) &
|
||||
& call lv%desc_ac%cnv(imold)
|
||||
if (info == psb_success_ .and. lv%desc_ac%is_ok() &
|
||||
& .and. present(imold)) call lv%desc_ac%cnv(imold)
|
||||
call lv%map%cnv(info,mold=amold,imold=imold)
|
||||
end if
|
||||
end subroutine mld_s_base_onelev_cnv
|
||||
|
||||
@@ -93,30 +93,51 @@ subroutine mld_z_base_onelev_build(lv,info,amold,vmold,imold)
|
||||
& 'Jacobi sweeps',izero,is_int_non_negative)
|
||||
call mld_check_def(lv%parms%sweeps_post,&
|
||||
& 'Jacobi sweeps',izero,is_int_non_negative)
|
||||
|
||||
call lv%sm%build(lv%base_a,lv%base_desc,&
|
||||
& info,amold=amold,vmold=vmold,imold=imold)
|
||||
if (info == 0) then
|
||||
if (allocated(lv%sm2a)) then
|
||||
call lv%sm2a%build(lv%base_a,lv%base_desc,info,&
|
||||
& amold=amold,vmold=vmold,imold=imold)
|
||||
lv%sm2 => lv%sm2a
|
||||
else
|
||||
lv%sm2 => lv%sm
|
||||
|
||||
if (.false.) then
|
||||
call lv%sm%build(lv%base_a,lv%base_desc,&
|
||||
& info,amold=amold,vmold=vmold,imold=imold)
|
||||
if (info == 0) then
|
||||
if (allocated(lv%sm2a)) then
|
||||
call lv%sm2a%build(lv%base_a,lv%base_desc,info,&
|
||||
& amold=amold,vmold=vmold,imold=imold)
|
||||
lv%sm2 => lv%sm2a
|
||||
else
|
||||
lv%sm2 => lv%sm
|
||||
end if
|
||||
end if
|
||||
if (info /=0) then
|
||||
info = psb_err_internal_error_
|
||||
call psb_errpush(info,name,&
|
||||
& a_err='Smoother bld error')
|
||||
goto 9999
|
||||
end if
|
||||
else
|
||||
call lv%sm%build(lv%base_a,lv%base_desc,info)
|
||||
if (info == 0) then
|
||||
if (allocated(lv%sm2a)) then
|
||||
call lv%sm2a%build(lv%base_a,lv%base_desc,info)
|
||||
lv%sm2 => lv%sm2a
|
||||
else
|
||||
lv%sm2 => lv%sm
|
||||
end if
|
||||
end if
|
||||
if (info /=0 ) then
|
||||
info = psb_err_internal_error_
|
||||
call psb_errpush(info,name,&
|
||||
& a_err='Smoother bld error')
|
||||
goto 9999
|
||||
end if
|
||||
end if
|
||||
if (info /=0) then
|
||||
info = psb_err_internal_error_
|
||||
call psb_errpush(info,name,&
|
||||
& a_err='Smoother bld error')
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
if (any((/present(amold),present(vmold),present(imold)/))) &
|
||||
& call lv%cnv(info,amold=amold,vmold=vmold,imold=imold)
|
||||
end if
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
|
||||
9999 call psb_error_handler(err_act)
|
||||
|
||||
|
||||
return
|
||||
|
||||
|
||||
end subroutine mld_z_base_onelev_build
|
||||
|
||||
@@ -54,10 +54,14 @@ subroutine mld_z_base_onelev_cnv(lv,info,amold,vmold,imold)
|
||||
if (any((/present(amold),present(vmold),present(imold)/))) then
|
||||
if (allocated(lv%sm)) &
|
||||
& call lv%sm%cnv(info,amold=amold,vmold=vmold,imold=imold)
|
||||
if (info == psb_success_ .and. allocated(lv%sm2a)) &
|
||||
& call lv%sm2a%cnv(info,amold=amold,vmold=vmold,imold=imold)
|
||||
if (info == psb_success_ .and. allocated(lv%wrk)) &
|
||||
& call lv%wrk(vmold=vmold)
|
||||
if (info == psb_success_.and. lv%ac%is_asb()) &
|
||||
& call lv%ac%cscnv(info,mold=amold)
|
||||
if (info == psb_success_ .and. lv%desc_ac%is_ok()) &
|
||||
& call lv%desc_ac%cnv(imold)
|
||||
if (info == psb_success_ .and. lv%desc_ac%is_ok() &
|
||||
& .and. present(imold)) call lv%desc_ac%cnv(imold)
|
||||
call lv%map%cnv(info,mold=amold,imold=imold)
|
||||
end if
|
||||
end subroutine mld_z_base_onelev_cnv
|
||||
|
||||
Reference in New Issue
Block a user