@ -11,6 +11,7 @@ using SparseMatricesCSR
using Test
using Test
MPI . Init ( )
MPI . Init ( )
HYPRE_Init ( )
@testset " HYPREMatrix " begin
@testset " HYPREMatrix " begin
H = HYPREMatrix ( )
H = HYPREMatrix ( )
@ -264,6 +265,10 @@ end
copy! ( x , x_h )
copy! ( x , x_h )
# Test result with direct solver
# Test result with direct solver
@test x ≈ A \ b atol = tol
@test x ≈ A \ b atol = tol
# Test without passing initial guess
x_h = HYPRE . solve ( amg , A_h , b_h )
copy! ( x , x_h )
@test x ≈ A \ b atol = tol
end
end
@testset " (ParCSR)PCG " begin
@testset " (ParCSR)PCG " begin
@ -282,6 +287,10 @@ end
copy! ( x , x_h )
copy! ( x , x_h )
# Test result with direct solver
# Test result with direct solver
@test x ≈ A \ b atol = tol
@test x ≈ A \ b atol = tol
# Test without passing initial guess
x_h = HYPRE . solve ( pcg , A_h , b_h )
copy! ( x , x_h )
@test x ≈ A \ b atol = tol
# Solve with AMG preconditioner
# Solve with AMG preconditioner
precond = HYPRE . BoomerAMG ( )
precond = HYPRE . BoomerAMG ( )
pcg = HYPRE . PCG ( ; Tol = tol , Precond = precond )
pcg = HYPRE . PCG ( ; Tol = tol , Precond = precond )
@ -289,4 +298,8 @@ end
copy! ( x , x_h )
copy! ( x , x_h )
# Test result with direct solver
# Test result with direct solver
@test x ≈ A \ b atol = tol
@test x ≈ A \ b atol = tol
# Test without passing initial guess
x_h = HYPRE . solve ( pcg , A_h , b_h )
copy! ( x , x_h )
@test x ≈ A \ b atol = tol
end
end