Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addressing ambiguity in krylov_mul! whenever no preconditioner is used at all (neither left or right) #44

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading