@@ -78,16 +78,16 @@ function Base.showerror(io::IO, e::OverrideInitNoTolerance)
78
78
end
79
79
80
80
"""
81
- Utility function to evaluate the RHS of the ODE , using the integrator's `tmp_cache` if
81
+ Utility function to evaluate the RHS, using the integrator's `tmp_cache` if
82
82
it is in-place or simply calling the function if not.
83
83
"""
84
- function _evaluate_f_ode (integrator, f, isinplace:: Val{true} , args... )
84
+ function _evaluate_f (integrator, f, isinplace:: Val{true} , args... )
85
85
tmp = first (get_tmp_cache (integrator))
86
86
f (tmp, args... )
87
87
return tmp
88
88
end
89
89
90
- function _evaluate_f_ode (integrator, f, isinplace:: Val{false} , args... )
90
+ function _evaluate_f (integrator, f, isinplace:: Val{false} , args... )
91
91
return f (args... )
92
92
end
93
93
@@ -126,7 +126,7 @@ function get_initial_values(
126
126
algebraic_eqs = [all (iszero, x) for x in eachrow (M)]
127
127
(iszero (algebraic_vars) || iszero (algebraic_eqs)) && return u0, p, true
128
128
update_coefficients! (M, u0, p, t)
129
- tmp = _evaluate_f_ode (integrator, f, isinplace, u0, p, t)
129
+ tmp = _evaluate_f (integrator, f, isinplace, u0, p, t)
130
130
tmp .= ArrayInterface. restructure (tmp, algebraic_eqs .* _vec (tmp))
131
131
132
132
normresid = isdefined (integrator. opts, :internalnorm ) ?
@@ -137,34 +137,17 @@ function get_initial_values(
137
137
return u0, p, true
138
138
end
139
139
140
- """
141
- Utility function to evaluate the RHS of the DAE, using the integrator's `tmp_cache` if
142
- it is in-place or simply calling the function if not.
143
- """
144
- function _evaluate_f_dae (integrator, f, isinplace:: Val{true} , args... )
145
- tmp = get_tmp_cache (integrator)[2 ]
146
- f (tmp, args... )
147
- return tmp
148
- end
149
-
150
- function _evaluate_f_dae (integrator, f, isinplace:: Val{false} , args... )
151
- return f (args... )
152
- end
153
-
154
140
function get_initial_values (
155
141
prob:: AbstractDAEProblem , integrator:: DEIntegrator , f, alg:: CheckInit ,
156
- isinplace:: Union{Val{true}, Val{false}} ; abstol = nothing , kwargs... )
142
+ isinplace:: Union{Val{true}, Val{false}} ; abstol, kwargs... )
157
143
u0 = state_values (integrator)
158
144
p = parameter_values (integrator)
159
145
t = current_time (integrator)
160
146
161
- resid = _evaluate_f_dae (integrator, f, isinplace, integrator. du, u0, p, t)
147
+ resid = _evaluate_f (integrator, f, isinplace, integrator. du, u0, p, t)
162
148
normresid = isdefined (integrator. opts, :internalnorm ) ?
163
149
integrator. opts. internalnorm (resid, t) : norm (resid)
164
150
165
- if abstol === nothing
166
- abstol = cache_get_abstol (integrator)
167
- end
168
151
if normresid > abstol
169
152
throw (CheckInitFailureError (normresid, abstol))
170
153
end
0 commit comments