Skip to content

Commit 734e195

Browse files
format
1 parent 3ea493a commit 734e195

File tree

5 files changed

+18
-16
lines changed

5 files changed

+18
-16
lines changed

src/structural_transformation/symbolics_tearing.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ function tearing_reassemble(state::TearingState, var_eq_matching;
560560
# TODO: generalize to SDE
561561
if sys isa ODESystem
562562
@set! sys.schedule = Schedule(var_eq_matching, dummy_sub)
563-
end
563+
end
564564
@set! state.sys = sys
565565
@set! sys.tearing_state = state
566566
return invalidate_cache!(sys)

src/systems/diffeqs/abstractodesystem.jl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
struct Schedule
2-
var_eq_matching
3-
dummy_sub
2+
var_eq_matching::Any
3+
dummy_sub::Any
44
end
55

66
function filter_kwargs(kwargs)
@@ -1518,7 +1518,8 @@ function InitializationProblem(sys::AbstractODESystem, t,
15181518
u0map::StaticArray,
15191519
args...;
15201520
kwargs...)
1521-
InitializationProblem{false, SciMLBase.FullSpecialize}(sys, t, u0map, args...; kwargs...)
1521+
InitializationProblem{false, SciMLBase.FullSpecialize}(
1522+
sys, t, u0map, args...; kwargs...)
15221523
end
15231524

15241525
function InitializationProblem{true}(sys::AbstractODESystem, args...; kwargs...)
@@ -1529,7 +1530,7 @@ function InitializationProblem{false}(sys::AbstractODESystem, args...; kwargs...
15291530
InitializationProblem{false, SciMLBase.FullSpecialize}(sys, args...; kwargs...)
15301531
end
15311532

1532-
function InitializationProblem{iip, specialize}(sys::AbstractODESystem,
1533+
function InitializationProblem{iip, specialize}(sys::AbstractODESystem,
15331534
t, u0map = [],
15341535
parammap = DiffEqBase.NullParameters();
15351536
guesses = [],
@@ -1560,8 +1561,9 @@ function InitializationProblem{iip, specialize}(sys::AbstractODESystem,
15601561
if warn_initialize_determined && neqs < nunknown
15611562
@warn "Initialization system is underdetermined. $neqs equations for $nunknown unknowns. Initialization will default to using least squares. To suppress this warning pass warn_initialize_determined = false."
15621563
end
1563-
1564-
parammap isa DiffEqBase.NullParameters ? [independent_variable(sys) => t] : merge(todict(parammap), Dict(independent_variable(sys) => t))
1564+
1565+
parammap isa DiffEqBase.NullParameters ? [independent_variable(sys) => t] :
1566+
merge(todict(parammap), Dict(independent_variable(sys) => t))
15651567

15661568
if neqs == nunknown
15671569
NonlinearProblem(isys, guesses, parammap)

src/systems/diffeqs/odesystem.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,12 @@ struct ODESystem <: AbstractODESystem
169169
"""
170170
parent::Any
171171

172-
173172
function ODESystem(tag, deqs, iv, dvs, ps, tspan, var_to_name, ctrls, observed, tgrad,
174173
jac, ctrl_jac, Wfact, Wfact_t, name, systems, defaults, guesses,
175174
torn_matching, initializesystem, schedule, connector_type, preface, cevents,
176175
devents, parameter_dependencies,
177176
metadata = nothing, gui_metadata = nothing,
178-
tearing_state = nothing,
177+
tearing_state = nothing,
179178
substitutions = nothing, complete = false, index_cache = nothing,
180179
discrete_subsystems = nothing, solved_unknowns = nothing,
181180
split_idxs = nothing, parent = nothing; checks::Union{Bool, Int} = true)
@@ -191,7 +190,7 @@ struct ODESystem <: AbstractODESystem
191190
end
192191
new(tag, deqs, iv, dvs, ps, tspan, var_to_name, ctrls, observed, tgrad, jac,
193192
ctrl_jac, Wfact, Wfact_t, name, systems, defaults, guesses, torn_matching,
194-
initializesystem, schedule, connector_type, preface, cevents, devents, parameter_dependencies,
193+
initializesystem, schedule, connector_type, preface, cevents, devents, parameter_dependencies,
195194
metadata,
196195
gui_metadata, tearing_state, substitutions, complete, index_cache,
197196
discrete_subsystems, solved_unknowns, split_idxs, parent)
@@ -215,7 +214,7 @@ function ODESystem(deqs::AbstractVector{<:Equation}, iv, dvs, ps;
215214
continuous_events = nothing,
216215
discrete_events = nothing,
217216
parameter_dependencies = nothing,
218-
checks = true,
217+
checks = true,
219218
metadata = nothing,
220219
gui_metadata = nothing)
221220
name === nothing &&

src/systems/nonlinear/initializesystem.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Generate `NonlinearSystem` which initializes an ODE problem from specified initi
66
function generate_initializesystem(sys::ODESystem;
77
u0map = Dict(),
88
name = nameof(sys),
9-
guesses = Dict(), check_defguess = false,
9+
guesses = Dict(), check_defguess = false,
1010
default_dd_value = 0.0,
1111
kwargs...)
1212
sts, eqs = unknowns(sys), equations(sys)
@@ -25,8 +25,9 @@ function generate_initializesystem(sys::ODESystem;
2525
schedule = getfield(sys, :schedule)
2626

2727
dd_guess = if schedule !== nothing
28-
guessmap = [x[2]=>get(guesses, x[1], default_dd_value) for x in schedule.dummy_sub]
29-
Dict(filter(x->!isnothing(x[1]) && x[1]set_full_states,guessmap))
28+
guessmap = [x[2] => get(guesses, x[1], default_dd_value)
29+
for x in schedule.dummy_sub]
30+
Dict(filter(x -> !isnothing(x[1]) && x[1] set_full_states, guessmap))
3031
else
3132
Dict()
3233
end
@@ -55,7 +56,7 @@ function generate_initializesystem(sys::ODESystem;
5556

5657
pars = [parameters(sys); independent_variable(sys)]
5758
nleqs = [eqs_ics; observed(sys)]
58-
59+
5960
sys_nl = NonlinearSystem(nleqs,
6061
full_states,
6162
pars;

src/systems/systems.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function structural_simplify(
2626
else
2727
newsys = newsys′
2828
end
29-
if newsys isa ODESystem
29+
if newsys isa ODESystem
3030
schedule = newsys.schedule
3131
@set! newsys.parent = complete(sys; split)
3232
@set! newsys.schedule = schedule

0 commit comments

Comments
 (0)