From 7aa9ddd673382d71aeca47eb4f1ca03eccf38e80 Mon Sep 17 00:00:00 2001 From: MoBit Date: Tue, 7 Dec 2021 07:08:22 +0100 Subject: [PATCH] Fix: Update verlet list at start --- src/simulation.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/simulation.jl b/src/simulation.jl index c66074a..1584881 100644 --- a/src/simulation.jl +++ b/src/simulation.jl @@ -95,6 +95,7 @@ function simulate( task::Union{Task,Nothing} = nothing cl = CellList(args.particles_c, args.box; parallel=false) + cl = update_verlet_list!(args, cl) start_time = now() println("Started simulation at $start_time.") @@ -102,6 +103,7 @@ function simulate( @showprogress 0.6 for (integration_step, t) in enumerate(T0:δt:T) if (integration_step % n_steps_before_snapshot == 0) && save_data wait(task) + bundle_snapshot_counter += 1 save_snapshot!(args.bundle, bundle_snapshot_counter, t, args.particles) @@ -122,6 +124,8 @@ function simulate( euler!(args) end + wait(task) + if bundle_snapshot_counter > 0 bundle = first_n_snapshots(args.bundle, bundle_snapshot_counter)