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

Fix mean squared displacement

This commit is contained in:
Mo8it 2022-01-23 04:18:51 +01:00
parent c5d92348f8
commit a392840a91
2 changed files with 20 additions and 12 deletions

View file

@ -4,19 +4,21 @@ using Dates: Dates
using Random: Random using Random: Random
using StaticArrays: SVector using StaticArrays: SVector
using JLD2: JLD2 using JLD2: JLD2
using CellListMap: CellListMap
using ReCo: ReCo using ReCo: ReCo
# Disable the periodic boundary conditions # IMPORTANT: Disable the periodic boundary conditions
ReCo.update_verlet_lists!(args...) = nothing # The arguments types have to match for the function to be overwritten!
ReCo.gen_cell_list(args...) = nothing ReCo.update_verlet_lists!(::Any, ::CellListMap.CellList) = nothing
ReCo.gen_cell_list_box(args...) = nothing ReCo.gen_cell_list(::Vector{SVector{2,Float64}}, ::CellListMap.Box) = nothing
ReCo.push_to_verlet_list!(args...) = nothing ReCo.gen_cell_list_box(::Float64, ::Float64) = nothing
ReCo.restrict_coordinate(value::Float64, args...) = value ReCo.push_to_verlet_list!(::Any, ::Any, ::Any) = nothing
ReCo.restrict_coordinates(v::SVector{2,Float64}, args...) = v ReCo.restrict_coordinate(value::Float64, ::Float64) = value
ReCo.restrict_coordinates!(args...) = nothing ReCo.restrict_coordinates(v::SVector{2,Float64}, ::Float64) = v
ReCo.minimum_image_coordinate(value::Float64, args...) = value ReCo.restrict_coordinates!(::Particle, ::Float64) = nothing
ReCo.minimum_image(v::SVector{2,Float64}, args...) = v ReCo.minimum_image_coordinate(value::Float64, ::Float64) = value
ReCo.minimum_image(v::SVector{2,Float64}, ::Float64) = v
function mean_squared_displacement(; function mean_squared_displacement(;
n_simulations::Int64, v₀s::AbstractVector{Float64}, T::Float64 n_simulations::Int64, v₀s::AbstractVector{Float64}, T::Float64
@ -49,7 +51,13 @@ function mean_squared_displacement(;
sim_dirs[sim_ind, v₀_ind] = dir sim_dirs[sim_ind, v₀_ind] = dir
ReCo.run_sim(dir; duration=T, seed=rand(1:typemax(Int64)), snapshot_at=0.01) ReCo.run_sim(
dir;
duration=T,
seed=rand(1:typemax(Int64)),
snapshot_at=0.01,
n_bundle_snapshots=200,
)
end end
end end

View file

@ -12,7 +12,7 @@ function push_to_verlet_list!(verlet_lists, i, j)
return nothing return nothing
end end
function update_verlet_lists!(args, cl) function update_verlet_lists!(args, cl::CellListMap.CellList)
@simd for pre_vec in args.verlet_lists @simd for pre_vec in args.verlet_lists
reset!(pre_vec) reset!(pre_vec)
end end