Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/problems/odeproblem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
t = nothing, eval_expression = false, eval_module = @__MODULE__, sparse = false,
steady_state = false, checkbounds = false, sparsity = false, analytic = nothing,
simplify = false, cse = true, initialization_data = nothing, expression = Val{false},
check_compatibility = true, nlstep = false, kwargs...) where {iip, spec}
check_compatibility = true, nlstep = false, nlstep_compile = true, kwargs...) where {iip, spec}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
check_compatibility = true, nlstep = false, nlstep_compile = true, kwargs...) where {iip, spec}
check_compatibility = true, nlstep = false, nlstep_compile = true, kwargs...) where {
iip, spec}

check_complete(sys, ODEFunction)
check_compatibility && check_compatible_system(ODEFunction, sys)

Expand Down Expand Up @@ -42,7 +42,7 @@
_M = concrete_massmatrix(M; sparse, u0)

if nlstep
ode_nlstep = generate_ODENLStepData(sys, u0, p, M)
ode_nlstep = generate_ODENLStepData(sys, u0, p, M, nlstep_compile)
else
ode_nlstep = nothing
end
Expand Down
14 changes: 9 additions & 5 deletions src/systems/solver_nlprob.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function generate_ODENLStepData(sys::System, u0, p, mm = calculate_massmatrix(sys))
nlsys, outer_tmp, inner_tmp = inner_nlsystem(sys, mm)
function generate_ODENLStepData(sys::System, u0, p, mm = calculate_massmatrix(sys), nlstep_compile::Bool = true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
function generate_ODENLStepData(sys::System, u0, p, mm = calculate_massmatrix(sys), nlstep_compile::Bool = true)
function generate_ODENLStepData(
sys::System, u0, p, mm = calculate_massmatrix(sys), nlstep_compile::Bool = true)

nlsys, outer_tmp, inner_tmp = inner_nlsystem(sys, mm, nlstep_compile)
state = ProblemState(; u = u0, p)
op = Dict()
op[ODE_GAMMA[1]] = one(eltype(u0))
Expand Down Expand Up @@ -35,7 +35,7 @@ function get_inner_tmp(n::Int)
only(@parameters inner_tmpₘₜₖ[1:n])
end

function inner_nlsystem(sys::System, mm)
function inner_nlsystem(sys::System, mm, nlstep_compile::Bool)
dvs = unknowns(sys)
eqs = full_equations(sys)
t = get_iv(sys)
Expand All @@ -56,8 +56,12 @@ function inner_nlsystem(sys::System, mm)

new_dvs = unknowns(sys)
new_ps = [parameters(sys); [gamma1, gamma2, gamma3, c, inner_tmp, outer_tmp]]
nlsys = mtkcompile(
System(new_eqs, new_dvs, new_ps; name = :nlsys); split = is_split(sys))
nlsys = System(new_eqs, new_dvs, new_ps; name = :nlsys)
nlsys = if nlstep_compile
mtkcompile(nlsys; split = is_split(sys))
else
complete(nlsys; split = is_split(sys))
end
return nlsys, outer_tmp, inner_tmp
end

Expand Down
Loading