Skip to content

Commit d31ecf2

Browse files
committed
fix: outer_step! call at end of loop missed
The symmetrized split step method combines most calls to `outer_step!` with half a time step into full time steps. However, an extra half step has to be taken each time the time step is updated. This is missing for the external states. With default settings, this results in an approximately 5% error. Add it in.
1 parent 373ac19 commit d31ecf2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/UltraDark.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ function take_steps!(grids, t_start, Δt, n, output_config, a, constants, extern
166166
end
167167

168168
outer_step!(Δt / 2, grids, constants)
169+
for s in external_states
170+
outer_step!(Δt / 2, grids, constants, s; a = a(t))
171+
end
172+
169173
t += Δt / 2
170174

171175
t

0 commit comments

Comments
 (0)