mirror of
https://gitlab.rlp.net/mobitar/ReCo.jl.git
synced 2024-11-08 22:21:08 +00:00
Better constant naming
This commit is contained in:
parent
9c26795790
commit
574cb561c3
2 changed files with 8 additions and 8 deletions
|
@ -84,10 +84,10 @@ function run_sim(
|
||||||
skin_r=sim_consts.skin_r,
|
skin_r=sim_consts.skin_r,
|
||||||
skin_r²=sim_consts.skin_r^2,
|
skin_r²=sim_consts.skin_r^2,
|
||||||
n_snapshots=n_snapshots,
|
n_snapshots=n_snapshots,
|
||||||
c₁=4 * sim_consts.ϵ * 6 * sim_consts.σ^6 * sim_consts.δt * sim_consts.μₜ,
|
ϵσ⁶δtμₜ24=24 * sim_consts.ϵ * sim_consts.σ^6 * sim_consts.δt * sim_consts.μₜ,
|
||||||
c₂=2 * sim_consts.σ^6,
|
σ⁶2=2 * sim_consts.σ^6,
|
||||||
c₃=sqrt(2 * sim_consts.Dₜ * sim_consts.δt),
|
sqrt_Dₜδt2=sqrt(2 * sim_consts.Dₜ * sim_consts.δt),
|
||||||
c₄=sqrt(2 * sim_consts.Dᵣ * sim_consts.δt),
|
sqrt_Dᵣδt2=sqrt(2 * sim_consts.Dᵣ * sim_consts.δt),
|
||||||
v₀δt=sim_consts.v₀ * sim_consts.δt,
|
v₀δt=sim_consts.v₀ * sim_consts.δt,
|
||||||
μₜ=sim_consts.μₜ,
|
μₜ=sim_consts.μₜ,
|
||||||
interaction_r=sim_consts.interaction_r,
|
interaction_r=sim_consts.interaction_r,
|
||||||
|
|
|
@ -57,7 +57,7 @@ function euler!(
|
||||||
state_update_helper_hook!(env_helper, id1, id2, r⃗₁₂)
|
state_update_helper_hook!(env_helper, id1, id2, r⃗₁₂)
|
||||||
|
|
||||||
if overlapping
|
if overlapping
|
||||||
factor = args.c₁ / (distance²^4) * (args.c₂ / (distance²^3) - 1.0)
|
factor = args.ϵσ⁶δtμₜ24 / (distance²^4) * (args.σ⁶2 / (distance²^3) - 1.0)
|
||||||
dc = factor * r⃗₁₂
|
dc = factor * r⃗₁₂
|
||||||
|
|
||||||
p1.tmp_c -= dc
|
p1.tmp_c -= dc
|
||||||
|
@ -71,8 +71,8 @@ function euler!(
|
||||||
@simd for p in args.particles
|
@simd for p in args.particles
|
||||||
si, co = sincos(p.φ)
|
si, co = sincos(p.φ)
|
||||||
p.tmp_c += SVector(
|
p.tmp_c += SVector(
|
||||||
args.v₀δt * co + args.c₃ * rand_normal01(),
|
args.v₀δt * co + args.sqrt_Dₜδt2 * rand_normal01(),
|
||||||
args.v₀δt * si + args.c₃ * rand_normal01(),
|
args.v₀δt * si + args.sqrt_Dₜδt2 * rand_normal01(),
|
||||||
)
|
)
|
||||||
|
|
||||||
restrict_coordinates!(p, args.half_box_len)
|
restrict_coordinates!(p, args.half_box_len)
|
||||||
|
@ -81,7 +81,7 @@ function euler!(
|
||||||
|
|
||||||
RL.act_hook!(p, env_helper, args.δt, si, co)
|
RL.act_hook!(p, env_helper, args.δt, si, co)
|
||||||
|
|
||||||
p.φ += args.c₄ * rand_normal01()
|
p.φ += args.sqrt_Dᵣδt2 * rand_normal01()
|
||||||
|
|
||||||
p.c = p.tmp_c
|
p.c = p.tmp_c
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue