Skip to content

Commit

Permalink
Addressing ambiguity in krylov_mul! whenever no preconditioner is used
Browse files Browse the repository at this point in the history
at all (neither left or right)
  • Loading branch information
amartinhuertas committed Nov 3, 2023
1 parent 9a47661 commit e91e9a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/LinearSolvers/Krylov/KrylovUtils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
5 changes: 5 additions & 0 deletions test/LinearSolvers/KrylovSolversTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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Ω)

Expand Down

0 comments on commit e91e9a2

Please sign in to comment.