1
0
Fork 0
mirror of https://gitlab.rlp.net/mobitar/ReCo.jl.git synced 2024-11-08 22:21:08 +00:00

Fix: Update verlet list at start

This commit is contained in:
MoBit 2021-12-07 07:08:22 +01:00
parent 389f99221b
commit 7aa9ddd673

View file

@ -95,6 +95,7 @@ function simulate(
task::Union{Task,Nothing} = nothing task::Union{Task,Nothing} = nothing
cl = CellList(args.particles_c, args.box; parallel=false) cl = CellList(args.particles_c, args.box; parallel=false)
cl = update_verlet_list!(args, cl)
start_time = now() start_time = now()
println("Started simulation at $start_time.") println("Started simulation at $start_time.")
@ -102,6 +103,7 @@ function simulate(
@showprogress 0.6 for (integration_step, t) in enumerate(T0:δt:T) @showprogress 0.6 for (integration_step, t) in enumerate(T0:δt:T)
if (integration_step % n_steps_before_snapshot == 0) && save_data if (integration_step % n_steps_before_snapshot == 0) && save_data
wait(task) wait(task)
bundle_snapshot_counter += 1 bundle_snapshot_counter += 1
save_snapshot!(args.bundle, bundle_snapshot_counter, t, args.particles) save_snapshot!(args.bundle, bundle_snapshot_counter, t, args.particles)
@ -122,6 +124,8 @@ function simulate(
euler!(args) euler!(args)
end end
wait(task)
if bundle_snapshot_counter > 0 if bundle_snapshot_counter > 0
bundle = first_n_snapshots(args.bundle, bundle_snapshot_counter) bundle = first_n_snapshots(args.bundle, bundle_snapshot_counter)