Skip to content

Commit

Permalink
testing Kinsol workarounds
Browse files Browse the repository at this point in the history
  • Loading branch information
sjdaines committed Aug 25, 2022
1 parent 16ecf43 commit 3a63963
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Kinsol.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function kinjactimesvec(
u::Sundials.N_Vector,
new_u::Ptr{Cint},
userfun::UserFunctionAndData
)
)
retval = userfun.jv(
convert(Vector, v),
convert(Vector, Jv),
Expand Down Expand Up @@ -130,7 +130,7 @@ function kin_create(
# use the user_data field to pass a function
# see: https://github.com/JuliaLang/julia/issues/2554
userfun = UserFunctionAndData(f, psetupfun, psolvefun, jvfun, userdata)
push!(handles, userfun) # prevent userfun from being garbage collected (required for julia 1.8)
# push!(handles, userfun) # TODO prevent userfun from being garbage collected ?
function getkinsolfun(userfun::T) where {T}
@cfunction(kinsolfun, Cint, (Sundials.N_Vector, Sundials.N_Vector, Ref{T}))
end
Expand Down

0 comments on commit 3a63963

Please sign in to comment.