@@ -134,7 +134,8 @@ function substitute_vars!(graph::BipartiteGraph, subs, cache = Int[], callback!
134
134
graph
135
135
end
136
136
137
- function to_mass_matrix_form (neweqs, ieq, graph, fullvars, isdervar:: F , var_to_diff) where F
137
+ function to_mass_matrix_form (neweqs, ieq, graph, fullvars, isdervar:: F ,
138
+ var_to_diff) where {F}
138
139
eq = neweqs[ieq]
139
140
if ! (eq. lhs isa Number && eq. lhs == 0 )
140
141
eq = 0 ~ eq. rhs - eq. lhs
@@ -447,7 +448,8 @@ function tearing_reassemble(state::TearingState, var_eq_matching; simplify = fal
447
448
# We cannot solve the differential variable like D(x)
448
449
if isdervar (iv)
449
450
# TODO : what if `to_mass_matrix_form(ieq)` returns `nothing`?
450
- eq, diffidx = to_mass_matrix_form (neweqs, ieq, graph, fullvars, isdervar, var_to_diff)
451
+ eq, diffidx = to_mass_matrix_form (neweqs, ieq, graph, fullvars, isdervar,
452
+ var_to_diff)
451
453
push! (diff_eqs, eq)
452
454
push! (diffeq_idxs, ieq)
453
455
push! (diff_vars, diffidx)
@@ -472,7 +474,8 @@ function tearing_reassemble(state::TearingState, var_eq_matching; simplify = fal
472
474
push! (solved_variables, iv)
473
475
end
474
476
else
475
- eq, diffidx = to_mass_matrix_form (neweqs, ieq, graph, fullvars, isdervar, var_to_diff)
477
+ eq, diffidx = to_mass_matrix_form (neweqs, ieq, graph, fullvars, isdervar,
478
+ var_to_diff)
476
479
if diffidx === nothing
477
480
push! (alge_eqs, eq)
478
481
push! (algeeq_idxs, ieq)
@@ -494,7 +497,9 @@ function tearing_reassemble(state::TearingState, var_eq_matching; simplify = fal
494
497
if length (diff_vars_set) != length (diff_vars)
495
498
error (" Tearing internal error: lowering DAE into semi-implicit ODE failed!" )
496
499
end
497
- invvarsperm = [diff_vars; setdiff! (setdiff (1 : ndsts (graph), diff_vars_set), BitSet (solved_variables))]
500
+ invvarsperm = [diff_vars;
501
+ setdiff! (setdiff (1 : ndsts (graph), diff_vars_set),
502
+ BitSet (solved_variables))]
498
503
varsperm = zeros (Int, ndsts (graph))
499
504
for (i, v) in enumerate (invvarsperm)
500
505
varsperm[v] = i
@@ -516,7 +521,8 @@ function tearing_reassemble(state::TearingState, var_eq_matching; simplify = fal
516
521
517
522
# Contract the vertices in the structure graph to make the structure match
518
523
# the new reality of the system we've just created.
519
- graph = contract_variables (graph, var_eq_matching, varsperm, eqsperm, length (solved_variables))
524
+ graph = contract_variables (graph, var_eq_matching, varsperm, eqsperm,
525
+ length (solved_variables))
520
526
521
527
# Update system
522
528
new_var_to_diff = complete (DiffGraph (length (invvarsperm)))
0 commit comments