Skip to content

Commit f57337b

Browse files
committed
Revert "Use Sets instead of Vectors in the exclusion Dict"
This reverts commit d3b392b.
1 parent d3b392b commit f57337b

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/basic_potentials.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ function pairwise_electrostatic_acceleration!(dv,
115115
n::Integer,
116116
qs::Vector{<:Real},
117117
ms::Vector{<:Real},
118-
exclude::Dict{Int, Set{Int}},
118+
exclude::Dict{Int, Vector{Int}},
119119
p::ElectrostaticParameters,
120120
pbc::BoundaryConditions)
121121

src/nbody_simulation_result.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ function lennard_jones_potential(p::LennardJonesParameters, indxs::Vector{<:Inte
198198
return 4 * p.ϵ * e_lj
199199
end
200200

201-
function electrostatic_potential(p::ElectrostaticParameters, indxs::Vector{<:Integer}, exclude::Dict{Int,Set{Int}}, qs, rs, pbc::BoundaryConditions)
201+
function electrostatic_potential(p::ElectrostaticParameters, indxs::Vector{<:Integer}, exclude::Dict{Int,Vector{Int}}, qs, rs, pbc::BoundaryConditions)
202202
e_el = 0.0
203203

204204
n = length(indxs)

src/nbody_to_ode.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,11 @@ function obtain_data_for_electrostatic_interaction(system::PotentialNBodySystem)
179179
qs = zeros(typeof(first(bodies).q), n)
180180
ms = zeros(typeof(first(bodies).m), n)
181181
indxs = collect(1:n)
182-
exclude = Dict{Int, Set{Int}}()
182+
exclude = Dict{Int, Vector{Int}}()
183183
for i = 1:n
184184
qs[i] = bodies[i].q
185185
ms[i] = bodies[i].m
186-
exclude[i] = Set{Int}(i)
186+
exclude[i] = [i]
187187
end
188188
return (qs, ms, indxs, exclude)
189189
end
@@ -194,7 +194,7 @@ function obtain_data_for_electrostatic_interaction(system::WaterSPCFw)
194194
qs = zeros(3 * n)
195195
ms = zeros(3 * n)
196196
indxs = collect(1:3*n)
197-
exclude = Dict{Int, Set{Int}}()
197+
exclude = Dict{Int, Vector{Int}}()
198198
for i = 1:n
199199
Oind = 3 * (i - 1) + 1
200200
qs[Oind] = system.qO
@@ -203,9 +203,9 @@ function obtain_data_for_electrostatic_interaction(system::WaterSPCFw)
203203
ms[Oind] = system.mO
204204
ms[Oind + 1] = system.mH
205205
ms[Oind + 2] = system.mH
206-
exclude[Oind] = Set{Int}((Oind, Oind+1, Oind+2,3*n+1))
207-
exclude[Oind+1] = Set{Int}((Oind, Oind+1, Oind+2,3*n+1))
208-
exclude[Oind+2] = Set{Int}((Oind, Oind+1, Oind+2,3*n+1))
206+
exclude[Oind] = [Oind, Oind+1, Oind+2,3*n+1]
207+
exclude[Oind+1] = [Oind, Oind+1, Oind+2,3*n+1]
208+
exclude[Oind+2] = [Oind, Oind+1, Oind+2,3*n+1]
209209
end
210210
return (qs, ms, indxs, exclude)
211211
end

0 commit comments

Comments
 (0)