Skip to content

Commit 0a8d823

Browse files
accept_step_controller
1 parent b468ab6 commit 0a8d823

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/integrators/controllers.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,15 @@ end
308308
return dt_factor
309309
end
310310

311+
# checks whether the controller should accept a step based on the error estimate
312+
@inline function accept_step_controller(integrator, controller::AbstractController)
313+
return integrator.EEst <= 1
314+
end
315+
316+
@inline function accept_step_controller(integrator, controller::PIDController)
317+
return integrator.qold >= controller.accept_safety
318+
end
319+
311320
function step_accept_controller!(integrator, controller::PIDController, alg, dt_factor)
312321
@unpack qsteady_min, qsteady_max = integrator.opts
313322

0 commit comments

Comments
 (0)