Skip to content
Snippets Groups Projects
Commit e13a40a8 authored by Florian Atteneder's avatar Florian Atteneder
Browse files

dg1d: substep callbacks have to be evolved after updating the solution...

dg1d: substep callbacks have to be evolved after updating the solution (!202)
parent 1d78c8f6
No related branches found
No related tags found
1 merge request!202dg1d: substep callbacks have to be evolved after updating the solution
Pipeline #7155 passed
......@@ -231,8 +231,6 @@ function ode_step!(u!, F, u0, t, dt, tmp_k, coeffs::COEFFS_LSERK4, callback_subs
for i = 1:nstages
ti = t + c[i] * dt
F(ki, i == 1 ? u0 : u!, ti)
success = callback_substep(u!, ti, i+1) # +1 because u! is value for next stage
!success && return false
if i == 1
@. u! = u0 + b[i] * dt * ki
else
......@@ -243,9 +241,11 @@ function ode_step!(u!, F, u0, t, dt, tmp_k, coeffs::COEFFS_LSERK4, callback_subs
if i < nstages
@. kim1 = ki
end
success = callback_substep(u!, ti, i+1) # +1 because u! is value for next stage
!success && return false
end # for
return true
return success
end
......@@ -262,12 +262,12 @@ function ode_step!(u!, F, u0, t, dt, tmp_k, coeffs::TimeStepAlgorithm, callback_
# assumes that a[1,:] are all zeros
F(tmp_k[i], i == 1 ? u0 : u!, ti)
i == nstages && break
success = callback_substep(u!, ti, i+1) # +1 because u! is value for next stage
!success && return false
u! .= u0
for j = 1:i
@. u! += a[i+1, j] * dt * tmp_k[j]
end
success = callback_substep(u!, ti, i+1) # +1 because u! is value for next stage
!success && return false
end
u! .= u0
......@@ -276,7 +276,7 @@ function ode_step!(u!, F, u0, t, dt, tmp_k, coeffs::TimeStepAlgorithm, callback_
end
success = callback_substep(u!, t+dt, nstages)
return true
return success
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment