Skip to content

Commit 4631a1e

Browse files
fix: add f field to MockIntegrator
1 parent 7600f5f commit 4631a1e

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/linearization.jl

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ function (linfun::LinearizationFunction)(u, p, t)
285285
linfun.num_states == length(u) ||
286286
error("Number of unknown variables ($(linfun.num_states)) does not match the number of input unknowns ($(length(u)))")
287287
integ_cache = (linfun.caches,)
288-
integ = MockIntegrator{true}(u, p, t, integ_cache, nothing)
288+
integ = MockIntegrator{true}(u, p, t, fun, integ_cache, nothing)
289289
u, p, success = SciMLBase.get_initial_values(
290290
linfun.prob, integ, fun, linfun.initializealg, Val(true);
291291
linfun.initialize_kwargs...)
@@ -325,7 +325,7 @@ Mock `DEIntegrator` to allow using `CheckInit` without having to create a new in
325325
326326
$(TYPEDFIELDS)
327327
"""
328-
struct MockIntegrator{iip, U, P, T, C, O} <: SciMLBase.DEIntegrator{Nothing, iip, U, T}
328+
struct MockIntegrator{iip, U, P, T, F, C, O} <: SciMLBase.DEIntegrator{Nothing, iip, U, T}
329329
"""
330330
The state vector.
331331
"""
@@ -339,6 +339,10 @@ struct MockIntegrator{iip, U, P, T, C, O} <: SciMLBase.DEIntegrator{Nothing, iip
339339
"""
340340
t::T
341341
"""
342+
The wrapped `SciMLFunction`.
343+
"""
344+
f::F
345+
"""
342346
The integrator cache.
343347
"""
344348
cache::C
@@ -348,8 +352,9 @@ struct MockIntegrator{iip, U, P, T, C, O} <: SciMLBase.DEIntegrator{Nothing, iip
348352
opts::O
349353
end
350354

351-
function MockIntegrator{iip}(u::U, p::P, t::T, cache::C, opts::O) where {iip, U, P, T, C, O}
352-
return MockIntegrator{iip, U, P, T, C, O}(u, p, t, cache, opts)
355+
function MockIntegrator{iip}(
356+
u::U, p::P, t::T, f::F, cache::C, opts::O) where {iip, U, P, T, F, C, O}
357+
return MockIntegrator{iip, U, P, T, F, C, O}(u, p, t, f, cache, opts)
353358
end
354359

355360
SymbolicIndexingInterface.state_values(integ::MockIntegrator) = integ.u

0 commit comments

Comments
 (0)