From bb0e68d48d586f8d49ea02f5dd28ce1fa33ec121 Mon Sep 17 00:00:00 2001 From: Mo8it Date: Thu, 27 Jan 2022 03:17:51 +0100 Subject: [PATCH] Updated n_Verlet for v_0 = 0 --- graphics/radial_distribution.jl | 6 ++++-- graphics/verlet_and_cell_lists.jl | 6 ++++-- src/setup.jl | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/graphics/radial_distribution.jl b/graphics/radial_distribution.jl index f5df5af..7622e58 100644 --- a/graphics/radial_distribution.jl +++ b/graphics/radial_distribution.jl @@ -29,6 +29,8 @@ function gen_rdf_graphics() particle_cs = Vector{SVector{2,Float64}}(undef, N) + distance_limit = 0.99 * 2 * particle_radius + x = y = distance = 0.0 for p1_ind in 1:N @@ -42,9 +44,9 @@ function gen_rdf_graphics() no_collision = true - if distance >= 0.99 * 2 * particle_radius + if distance >= distance_limit for p2_ind in 1:(p1_ind - 1) - if ReCo.norm2d(p1_c - particle_cs[p2_ind]) < 2 * particle_radius + if ReCo.norm2d(p1_c - particle_cs[p2_ind]) < distance_limit no_collision = false break diff --git a/graphics/verlet_and_cell_lists.jl b/graphics/verlet_and_cell_lists.jl index 6c5fe11..61d80df 100644 --- a/graphics/verlet_and_cell_lists.jl +++ b/graphics/verlet_and_cell_lists.jl @@ -30,6 +30,8 @@ function gen_verlet_and_cell_lists_graphics() particle_cs = Vector{SVector{2,Float64}}(undef, N) + distance_limit = 0.99 * 2 * particle_radius + x = y = distance = 0.0 for p1_ind in 1:N @@ -43,9 +45,9 @@ function gen_verlet_and_cell_lists_graphics() no_collision = true - if distance >= 0.99 * 2 * R_particle + if distance >= distance_limit for p2_ind in 1:(p1_ind - 1) - if ReCo.norm2d(p1_c - particle_cs[p2_ind]) < 2 * R_particle + if ReCo.norm2d(p1_c - particle_cs[p2_ind]) < distance_limit no_collision = false break diff --git a/src/setup.jl b/src/setup.jl index 4f5efaf..305ae62 100644 --- a/src/setup.jl +++ b/src/setup.jl @@ -78,7 +78,7 @@ function gen_sim_consts( Int64, (skin_r - interaction_r) / max_approach_after_one_integration_step ) else - n_steps_before_verlet_list_update = 100 + n_steps_before_verlet_list_update = 1200 end grid_n = round(Int64, ceil(sqrt(n_particles)))