Skip to content

Commit dcffe8f

Browse files
check for io first
1 parent ae4be0f commit dcffe8f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/systems/systemstructure.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,8 +638,8 @@ function _structural_simplify!(state::TearingState, io; simplify = false,
638638

639639
ci = infer_clocks!(ClockInference(state))
640640
# TODO: make it work with clocks
641-
if sys isa ODESystem && all(isequal(Continuous()), ci.var_domain) &&
642-
!all(all(x -> !(typeof(x) <: Union{Sample, Hold, ShiftIndex}), io))
641+
if sys isa ODESystem && all(isequal(Continuous()), ci.var_domain) && (!has_io ||
642+
!all(all(x -> !(typeof(x) <: Union{Sample, Hold, ShiftIndex}), io)))
643643
isys = ModelingToolkit.generate_initializesystem(sys)
644644
!isempty(equations(isys)) &&
645645
(isys = structural_simplify(isys; fully_determined = false))

0 commit comments

Comments
 (0)