Skip to content

Commit e3217f3

Browse files
fix: don't rely on integrator.opts.internalnorm in CheckInit
1 parent e1d93b1 commit e3217f3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/initialization.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ function get_initial_values(
115115
tmp = _evaluate_f_ode(integrator, f, isinplace, u0, p, t)
116116
tmp .= ArrayInterface.restructure(tmp, algebraic_eqs .* _vec(tmp))
117117

118-
normresid = integrator.opts.internalnorm(tmp, t)
118+
normresid = isdefined(integrator.opts, :internalnorm) ?
119+
integrator.opts.internalnorm(tmp, t) : norm(tmp)
119120
if normresid > integrator.opts.abstol
120121
throw(CheckInitFailureError(normresid, integrator.opts.abstol))
121122
end
@@ -144,7 +145,8 @@ function get_initial_values(
144145
t = current_time(integrator)
145146

146147
resid = _evaluate_f_dae(integrator, f, isinplace, integrator.du, u0, p, t)
147-
normresid = integrator.opts.internalnorm(resid, t)
148+
normresid = isdefined(integrator.opts, :internalnorm) ?
149+
integrator.opts.internalnorm(resid, t) : norm(resid)
148150
if normresid > integrator.opts.abstol
149151
throw(CheckInitFailureError(normresid, integrator.opts.abstol))
150152
end

0 commit comments

Comments
 (0)