Skip to content

Commit 456478f

Browse files
only build initialization if simplified
1 parent deaa824 commit 456478f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/systems/diffeqs/abstractodesystem.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,8 +862,11 @@ function process_DEProblem(constructor, sys::AbstractODESystem, u0map, parammap;
862862
# TODO: make check for if a DAE cheaper than calculating the mass matrix a second time!
863863
ci = infer_clocks!(ClockInference(TearingState(sys)))
864864
# TODO: make it work with clocks
865+
# ModelingToolkit.get_tearing_state(sys) !== nothing => Requires structural_simplify first
865866
if (implicit_dae || calculate_massmatrix(sys) !== I) &&
866-
all(isequal(Continuous()), ci.var_domain)
867+
all(isequal(Continuous()), ci.var_domain) &&
868+
ModelingToolkit.get_tearing_state(sys) !== nothing
869+
867870
if eltype(u0map) <: Number
868871
u0map = unknowns(sys) .=> u0map
869872
end

0 commit comments

Comments
 (0)