|
|
|
@ -1,15 +1,15 @@
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
!
|
|
|
|
|
! MLD2P4 version 2.2
|
|
|
|
|
! MultiLevel Domain Decomposition Parallel Preconditioners Package
|
|
|
|
|
! AMG4PSBLAS version 1.0
|
|
|
|
|
! Algebraic Multigrid Package
|
|
|
|
|
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
|
|
|
|
|
!
|
|
|
|
|
! (C) Copyright 2008-2018
|
|
|
|
|
! (C) Copyright 2020
|
|
|
|
|
!
|
|
|
|
|
! Salvatore Filippone
|
|
|
|
|
! Pasqua D'Ambra
|
|
|
|
|
! Daniela di Serafino
|
|
|
|
|
! Fabio Durastante
|
|
|
|
|
!
|
|
|
|
|
! Redistribution and use in source and binary forms, with or without
|
|
|
|
|
! modification, are permitted provided that the following conditions
|
|
|
|
@ -19,14 +19,14 @@
|
|
|
|
|
! 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
|
! notice, this list of conditions, and the following disclaimer in the
|
|
|
|
|
! documentation and/or other materials provided with the distribution.
|
|
|
|
|
! 3. The name of the MLD2P4 group or the names of its contributors may
|
|
|
|
|
! 3. The name of the AMG4PSBLAS group or the names of its contributors may
|
|
|
|
|
! not be used to endorse or promote products derived from this
|
|
|
|
|
! software without specific written permission.
|
|
|
|
|
!
|
|
|
|
|
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
|
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
|
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
|
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
|
|
|
|
|
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AMG4PSBLAS GROUP OR ITS CONTRIBUTORS
|
|
|
|
|
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
|
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
|
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
@ -36,7 +36,7 @@
|
|
|
|
|
! POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
!
|
|
|
|
|
!
|
|
|
|
|
! File: mld_dexample_1lev.f90
|
|
|
|
|
! File: amg_dexample_1lev.f90
|
|
|
|
|
!
|
|
|
|
|
! This sample program solves a linear system obtained by discretizing a
|
|
|
|
|
! PDE with Dirichlet BCs. The solver is BiCGStab preconditioned by
|
|
|
|
@ -58,13 +58,13 @@
|
|
|
|
|
!
|
|
|
|
|
! Note that if b1=b2=b3=c=0., the PDE is the Laplace equation.
|
|
|
|
|
!
|
|
|
|
|
program mld_dexample_1lev
|
|
|
|
|
program amg_dexample_1lev
|
|
|
|
|
use psb_base_mod
|
|
|
|
|
use mld_prec_mod
|
|
|
|
|
use amg_prec_mod
|
|
|
|
|
use psb_krylov_mod
|
|
|
|
|
use psb_util_mod
|
|
|
|
|
use data_input
|
|
|
|
|
use mld_d_pde_mod
|
|
|
|
|
use amg_d_pde_mod
|
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -75,7 +75,7 @@ program mld_dexample_1lev
|
|
|
|
|
type(psb_desc_type):: desc_A
|
|
|
|
|
|
|
|
|
|
! preconditioner
|
|
|
|
|
type(mld_dprec_type) :: P
|
|
|
|
|
type(amg_dprec_type) :: P
|
|
|
|
|
|
|
|
|
|
! right-hand side, solution and residual vectors
|
|
|
|
|
type(psb_d_vect_type) :: x, b, r
|
|
|
|
@ -107,7 +107,7 @@ program mld_dexample_1lev
|
|
|
|
|
stop
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
name='mld_dexample_ml'
|
|
|
|
|
name='amg_dexample_ml'
|
|
|
|
|
if(psb_get_errstatus() /= 0) goto 9999
|
|
|
|
|
info=psb_success_
|
|
|
|
|
call psb_set_errverbosity(2)
|
|
|
|
@ -115,7 +115,7 @@ program mld_dexample_1lev
|
|
|
|
|
! Hello world
|
|
|
|
|
!
|
|
|
|
|
if (iam == psb_root_) then
|
|
|
|
|
write(*,*) 'Welcome to MLD2P4 version: ',mld_version_string_
|
|
|
|
|
write(*,*) 'Welcome to MLD2P4 version: ',amg_version_string_
|
|
|
|
|
write(*,*) 'This is the ',trim(name),' sample program'
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
@ -127,7 +127,7 @@ program mld_dexample_1lev
|
|
|
|
|
|
|
|
|
|
call psb_barrier(ictxt)
|
|
|
|
|
t1 = psb_wtime()
|
|
|
|
|
call mld_gen_pde3d(ictxt,idim,a,b,x,desc_a,afmt,&
|
|
|
|
|
call amg_gen_pde3d(ictxt,idim,a,b,x,desc_a,afmt,&
|
|
|
|
|
& a1,a2,a3,b1,b2,b3,c,g,info)
|
|
|
|
|
call psb_barrier(ictxt)
|
|
|
|
|
t2 = psb_wtime() - t1
|
|
|
|
@ -158,7 +158,7 @@ program mld_dexample_1lev
|
|
|
|
|
call psb_amx(ictxt, tprec)
|
|
|
|
|
|
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
|
call psb_errpush(psb_err_from_subroutine_,name,a_err='mld_precbld')
|
|
|
|
|
call psb_errpush(psb_err_from_subroutine_,name,a_err='amg_precbld')
|
|
|
|
|
goto 9999
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
@ -272,4 +272,4 @@ contains
|
|
|
|
|
call psb_bcast(ictxt,tol)
|
|
|
|
|
|
|
|
|
|
end subroutine get_parms
|
|
|
|
|
end program mld_dexample_1lev
|
|
|
|
|
end program amg_dexample_1lev
|
|
|
|
|