Skip to content

Commit aa87cf1

Browse files
committed
SelectedUnknown -> SelectedState
1 parent a418591 commit aa87cf1

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

src/structural_transformation/partial_state_selection.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function pss_graph_modia!(structure::SystemStructure, maximal_top_matching, varl
3535
# Find Strongly connected components. Note that after pantelides, we expect
3636
# a balanced system, so a maximal matching should be possible.
3737
var_sccs::Vector{Union{Vector{Int}, Int}} = find_var_sccs(graph, maximal_top_matching)
38-
var_eq_matching = Matching{Union{Unassigned, SelectedUnknown}}(ndsts(graph))
38+
var_eq_matching = Matching{Union{Unassigned, SelectedState}}(ndsts(graph))
3939
for vars in var_sccs
4040
# TODO: We should have a way to not have the scc code look at unassigned vars.
4141
if length(vars) == 1 && maximal_top_matching[vars[1]] === unassigned
@@ -72,7 +72,7 @@ function pss_graph_modia!(structure::SystemStructure, maximal_top_matching, varl
7272
removed_vars = Int[]
7373
for var in old_level_vars
7474
old_assign = var_eq_matching[var]
75-
if isa(old_assign, SelectedUnknown)
75+
if isa(old_assign, SelectedState)
7676
push!(removed_vars, var)
7777
continue
7878
elseif !isa(old_assign, Int) ||
@@ -114,7 +114,7 @@ function pss_graph_modia!(structure::SystemStructure, maximal_top_matching, varl
114114
for var in remaining_vars
115115
if nlsolve_matching[var] === unassigned &&
116116
var_eq_matching[var] === unassigned
117-
var_eq_matching[var] = SelectedUnknown()
117+
var_eq_matching[var] = SelectedState()
118118
end
119119
end
120120
end
@@ -127,7 +127,7 @@ function pss_graph_modia!(structure::SystemStructure, maximal_top_matching, varl
127127
return complete(var_eq_matching, nsrcs(graph))
128128
end
129129

130-
struct SelectedUnknown end
130+
struct SelectedState end
131131
function partial_state_selection_graph!(structure::SystemStructure, var_eq_matching)
132132
@unpack eq_to_diff, var_to_diff, graph, solvable_graph = structure
133133
eq_to_diff = complete(eq_to_diff)
@@ -349,13 +349,13 @@ function tearing_with_dummy_derivatives(structure, dummy_derivatives)
349349
end
350350
var_eq_matching, full_var_eq_matching, var_sccs = tear_graph_modia(structure,
351351
Base.Fix1(isdiffed, (structure, dummy_derivatives)),
352-
Union{Unassigned, SelectedUnknown};
352+
Union{Unassigned, SelectedState};
353353
varfilter = Base.Fix1(getindex, can_eliminate))
354354
for v in eachindex(var_eq_matching)
355355
is_present(structure, v) || continue
356356
dv = var_to_diff[v]
357357
(dv === nothing || !is_some_diff(structure, dummy_derivatives, dv)) && continue
358-
var_eq_matching[v] = SelectedUnknown()
358+
var_eq_matching[v] = SelectedState()
359359
end
360360
return var_eq_matching, full_var_eq_matching, var_sccs, can_eliminate
361361
end

src/structural_transformation/symbolics_tearing.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function substitution_graph(graph, slist, dlist, var_eq_matching)
1818

1919
newmatching = Matching(ns)
2020
for (v, e) in enumerate(var_eq_matching)
21-
(e === unassigned || e === SelectedUnknown()) && continue
21+
(e === unassigned || e === SelectedState()) && continue
2222
iv = vrename[v]
2323
ie = erename[e]
2424
iv == 0 && continue
@@ -228,7 +228,7 @@ function tearing_reassemble(state::TearingState, var_eq_matching;
228228
# A general DAE is in the form of `F(u'(t), u(t), p, t) == 0`. We can
229229
# characterize variables in `u(t)` into two classes: differential variables
230230
# (denoted `v(t)`) and algebraic variables (denoted `z(t)`). Differential
231-
# variables are marked as `SelectedUnknown` and they are differentiated in the
231+
# variables are marked as `SelectedState` and they are differentiated in the
232232
# DAE system, i.e. `v'(t)` are all the variables in `u'(t)` that actually
233233
# appear in the system. Algebraic variables are variables that are not
234234
# differential variables.
@@ -255,7 +255,7 @@ function tearing_reassemble(state::TearingState, var_eq_matching;
255255
for var in 1:length(fullvars)
256256
dv = var_to_diff[var]
257257
dv === nothing && continue
258-
if var_eq_matching[var] !== SelectedUnknown()
258+
if var_eq_matching[var] !== SelectedState()
259259
dd = fullvars[dv]
260260
v_t = setio(diff2term(unwrap(dd)), false, false)
261261
for eq in 𝑑neighbors(graph, dv)
@@ -283,7 +283,7 @@ function tearing_reassemble(state::TearingState, var_eq_matching;
283283
end
284284
end
285285

286-
# `SelectedUnknown` information is no longer needed past here. State selection
286+
# `SelectedState` information is no longer needed past here. State selection
287287
# is done. All non-differentiated variables are algebraic variables, and all
288288
# variables that appear differentiated are differential variables.
289289

@@ -569,10 +569,10 @@ function tearing(state::TearingState; kwargs...)
569569
var_eq_matching′, = tear_graph_modia(state.structure;
570570
varfilter = var -> var in algvars,
571571
eqfilter = eq -> eq in aeqs)
572-
var_eq_matching = Matching{Union{Unassigned, SelectedUnknown}}(var_eq_matching′)
572+
var_eq_matching = Matching{Union{Unassigned, SelectedState}}(var_eq_matching′)
573573
for var in 1:ndsts(graph)
574574
if isdiffvar(state.structure, var)
575-
var_eq_matching[var] = SelectedUnknown()
575+
var_eq_matching[var] = SelectedState()
576576
end
577577
end
578578
var_eq_matching

src/systems/diffeqs/odesystem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct ODESystem <: AbstractODESystem
3636
Dependent (unknown) variables. Must not contain the independent variable.
3737
3838
N.B.: If `torn_matching !== nothing`, this includes all variables. Actual
39-
ODE unknowns are determined by the `SelectedUnknown()` entries in `torn_matching`.
39+
ODE unknowns are determined by the `SelectedState()` entries in `torn_matching`.
4040
"""
4141
unknowns::Vector
4242
"""Parameter variables. Must not contain the independent variable."""

src/systems/systemstructure.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ function Base.show(io::IO, mime::MIME"text/plain", ms::MatchedSystemStructure)
553553
printstyled(io, "(Unsolvable + Matched)", color = :magenta)
554554
print(io, " | ")
555555
printstyled(io, "", color = :cyan)
556-
printstyled(io, " SelectedUnknown")
556+
printstyled(io, " SelectedState")
557557
end
558558

559559
# TODO: clean up

0 commit comments

Comments
 (0)