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

kinsol interface for GMRES missing #405

Open
jguterl opened this issue May 25, 2023 · 4 comments
Open

kinsol interface for GMRES missing #405

jguterl opened this issue May 25, 2023 · 4 comments

Comments

@jguterl
Copy link

jguterl commented May 25, 2023

The MWE

using NonlinearSolve
using Sundials
p = [2.0,3.0]
f(u,p) = u .* u .- p
u0 = [1.0, 1.0]

probN = NonlinearProblem(f, u0, p)
s = KINSOL(;linear_solver=:GMRES)
solver = solve(probN, s, reltol = 1e-7)

fails
with

UndefVarError: LS not defined
Stacktrace:
 [1] kinsol(f::Function, y0::Vector{Float64}; userdata::Nothing, linear_solver::Symbol, jac_upper::Int64, jac_lower::Int64)
   @ Sundials ~/.julia/packages/Sundials/4gP3E/src/simple.jl:15
 [2] __solve(prob::NonlinearProblem{Vector{Float64}, false, Vector{Float64}, NonlinearFunction{false, SciMLBase.FullSpecialize, typeof(f), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardNonlinearProblem}, alg::KINSOL{:GMRES}, timeseries::Vector{Any}, ts::Vector{Any}, ks::Vector{Any}, recompile::Type{Val{true}}; kwargs::Base.Pairs{Symbol, Float64, Tuple{Symbol}, NamedTuple{(:reltol,), Tuple{Float64}}})
   @ Sundials ~/.julia/packages/Sundials/4gP3E/src/common_interface/solve.jl:80
@jguterl
Copy link
Author

jguterl commented May 25, 2023

I believe the issue is the lack of interface in the method kinsol

@ChrisRackauckas
Copy link
Member

Yes that case is just missing the handling

https://github.com/SciML/Sundials.jl/blob/master/src/simple.jl#L70-L76

It's not hard to read the Sundials docs and add the right call into there though. Someone just needs to do it.

@jguterl
Copy link
Author

jguterl commented May 26, 2023 via email

@ChrisRackauckas
Copy link
Member

There's no benchmarks specifically on the nonlinear solvers yet. We need to set that up in the SciMLBenchmarks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants