Skip to content

Commit 6534e2b

Browse files
refactor: use common observed for NonlinearSystem
1 parent 46997c4 commit 6534e2b

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

src/systems/nonlinear/nonlinearsystem.jl

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -306,18 +306,7 @@ function SciMLBase.NonlinearFunction{iip}(sys::NonlinearSystem, dvs = unknowns(s
306306
_jac = nothing
307307
end
308308

309-
observedfun = let sys = sys, dict = Dict()
310-
function generated_observed(obsvar, u, p)
311-
obs = get!(dict, value(obsvar)) do
312-
build_explicit_observed_function(sys, obsvar)
313-
end
314-
if p isa MTKParameters
315-
obs(u, p...)
316-
else
317-
obs(u, p)
318-
end
319-
end
320-
end
309+
observedfun = ObservedFunctionCache(sys)
321310

322311
NonlinearFunction{iip}(f,
323312
sys = sys,

0 commit comments

Comments
 (0)