Skip to content
Merged
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
12 changes: 11 additions & 1 deletion src/problems/ode_problems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ prob = ODEProblemLibrary.prob_ode_linear
sol = solve(prob)
```
"""
struct ODEProblem{uType, tType, isinplace, P, F, K, PT} <:
mutable struct ODEProblem{uType, tType, isinplace, P, F, K, PT} <:
AbstractODEProblem{uType, tType, isinplace}
"""The ODE is `du = f(u,p,t)` for out-of-place and f(du,u,p,t) for in-place."""
f::F
Expand Down Expand Up @@ -162,6 +162,16 @@ struct ODEProblem{uType, tType, isinplace, P, F, K, PT} <:
end
TruncatedStacktraces.@truncate_stacktrace ODEProblem 3 1 2

function Base.setproperty!(prob::ODEProblem, s::Symbol, v)
@warn "Mutation of ODEProblem detected. SciMLBase v2.0 has made ODEProblem temporarily mutable in order to allow for interfacing with EnzymeRules due to a current limitation in the rule system. This change is only intended to be temporary and ODEProblem will return to being a struct in a later non-breaking release. Do not rely on this behavior, use with caution."
Base.setfield!(prob, s, v)
end

function Base.setproperty!(prob::ODEProblem, s::Symbol, v, order::Symbol)
@warn "Mutation of ODEProblem detected. SciMLBase v2.0 has made ODEProblem temporarily mutable in order to allow for interfacing with EnzymeRules due to a current limitation in the rule system. This change is only intended to be temporary and ODEProblem will return to being a struct in a later non-breaking release. Do not rely on this behavior, use with caution."
Base.setfield!(prob, s, v, order)
end

"""
ODEProblem(f::ODEFunction,u0,tspan,p=NullParameters(),callback=CallbackSet())

Expand Down