Skip to content

Commit ffe5675

Browse files
refactor: add nlstep kwarg to generate nlstep_data
1 parent 4c5e6d9 commit ffe5675

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/problems/odeproblem.jl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
t = nothing, eval_expression = false, eval_module = @__MODULE__, sparse = false,
44
steady_state = false, checkbounds = false, sparsity = false, analytic = nothing,
55
simplify = false, cse = true, initialization_data = nothing, expression = Val{false},
6-
check_compatibility = true, kwargs...) where {iip, spec}
6+
check_compatibility = true, nlstep = false, kwargs...) where {iip, spec}
77
check_complete(sys, ODEFunction)
88
check_compatibility && check_compatible_system(ODEFunction, sys)
99

@@ -41,6 +41,12 @@
4141
M = calculate_massmatrix(sys)
4242
_M = concrete_massmatrix(M; sparse, u0)
4343

44+
if nlstep
45+
ode_nlstep = generate_ODENLStepData(sys, u0, p, M)
46+
else
47+
ode_nlstep = nothing
48+
end
49+
4450
observedfun = ObservedFunctionCache(
4551
sys; expression, steady_state, eval_expression, eval_module, checkbounds, cse)
4652

@@ -57,7 +63,8 @@
5763
observed = observedfun,
5864
sparsity = sparsity ? _W_sparsity : nothing,
5965
analytic = analytic,
60-
initialization_data)
66+
initialization_data,
67+
nlstep_data = ode_nlstep)
6168

6269
maybe_codegen_scimlfn(expression, ODEFunction{iip, spec}, args; kwargs...)
6370
end

0 commit comments

Comments
 (0)