diff --git a/src/LinearSolvers/Krylov/KrylovUtils.jl b/src/LinearSolvers/Krylov/KrylovUtils.jl index 55335d77..dcd76b11 100644 --- a/src/LinearSolvers/Krylov/KrylovUtils.jl +++ b/src/LinearSolvers/Krylov/KrylovUtils.jl @@ -19,6 +19,9 @@ function krylov_mul!(y,A,x,Pr::Nothing,Pl,wr,wl) mul!(wl,A,x) solve!(y,Pl,wl) end +function krylov_mul!(y,A,x,Pr::Nothing,Pl::Nothing,wr,wl) + mul!(y,A,x) +end """ Computes the Krylov residual r = Pl⁻¹(A⋅x - b). diff --git a/test/LinearSolvers/KrylovSolversTests.jl b/test/LinearSolvers/KrylovSolversTests.jl index 9bf8fe51..94a35495 100644 --- a/test/LinearSolvers/KrylovSolversTests.jl +++ b/test/LinearSolvers/KrylovSolversTests.jl @@ -64,9 +64,14 @@ function main(distribute,np) P = JacobiLinearSolver() verbose = i_am_main(parts) + # GMRES with left and right preconditioner gmres = LinearSolvers.GMRESSolver(40;Pr=P,Pl=P,rtol=1.e-8,verbose=verbose) test_solver(gmres,op,Uh,dΩ) + # GMRES without preconditioner + gmres = LinearSolvers.GMRESSolver(40;rtol=1.e-8,verbose=verbose) + test_solver(gmres,op,Uh,dΩ) + fgmres = LinearSolvers.FGMRESSolver(40,P;rtol=1.e-8,verbose=verbose) test_solver(fgmres,op,Uh,dΩ)