mirror of
https://gitlab.rlp.net/mobitar/ReCo.jl.git
synced 2024-12-21 00:51:21 +00:00
Better variable defintions
This commit is contained in:
parent
ce81dd932b
commit
750be2d914
1 changed files with 5 additions and 5 deletions
|
@ -12,8 +12,8 @@ function update_verlet_list!(args)
|
||||||
end
|
end
|
||||||
|
|
||||||
for i in 1:(args.N - 1)
|
for i in 1:(args.N - 1)
|
||||||
for j in (i + 1):(args.N)
|
|
||||||
p1 = args.particles[i]
|
p1 = args.particles[i]
|
||||||
|
for j in (i + 1):(args.N)
|
||||||
p2 = args.particles[j]
|
p2 = args.particles[j]
|
||||||
|
|
||||||
overlapping = are_overlapping(p1, p2, args.skin_r², args.l).overlapping
|
overlapping = are_overlapping(p1, p2, args.skin_r², args.l).overlapping
|
||||||
|
@ -29,14 +29,14 @@ end
|
||||||
|
|
||||||
function euler!(args)
|
function euler!(args)
|
||||||
for i in 1:(args.N - 1)
|
for i in 1:(args.N - 1)
|
||||||
p = args.particles[i]
|
p1 = args.particles[i]
|
||||||
verlet_list = args.verlet_list[p.id]
|
verlet_list = args.verlet_list[p1.id]
|
||||||
|
|
||||||
for j in 1:(verlet_list.last_ind)
|
for j in 1:(verlet_list.last_ind)
|
||||||
p2 = args.particles[verlet_list.v[j]]
|
p2 = args.particles[verlet_list.v[j]]
|
||||||
|
|
||||||
overlapping, r⃗₁₂, distance² = are_overlapping(
|
overlapping, r⃗₁₂, distance² = are_overlapping(
|
||||||
p, p2, args.interaction_r², args.l
|
p1, p2, args.interaction_r², args.l
|
||||||
)
|
)
|
||||||
|
|
||||||
if overlapping
|
if overlapping
|
||||||
|
@ -45,7 +45,7 @@ function euler!(args)
|
||||||
@turbo for k in 1:2
|
@turbo for k in 1:2
|
||||||
dc = c * r⃗₁₂[k]
|
dc = c * r⃗₁₂[k]
|
||||||
|
|
||||||
p.tmp_c[k] -= dc
|
p1.tmp_c[k] -= dc
|
||||||
p2.tmp_c[k] += dc
|
p2.tmp_c[k] += dc
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue