@@ -5,17 +5,17 @@ struct NeighborListsNeighborhoodSearch{NDIMS, NHS, NL, PB}
55
66 function NeighborListsNeighborhoodSearch {NDIMS} (search_radius, n_particles;
77 periodic_box_min_corner = nothing ,
8- periodic_box_max_corner = nothing ) where {
9- NDIMS
10- }
8+ periodic_box_max_corner = nothing
9+ backend = VectorOfVectors{Int}) where {
10+ NDIMS
11+ }
1112 nhs = GridNeighborhoodSearch {NDIMS} (search_radius, n_particles,
1213 periodic_box_min_corner = periodic_box_min_corner,
1314 periodic_box_max_corner = periodic_box_max_corner)
1415
15- neighbor_lists = Vector {Vector{Int}} ()
16+ neighbor_lists = backend ()
1617
17- new{NDIMS, typeof (nhs),
18- typeof (neighbor_lists),
18+ new{NDIMS, typeof (nhs), typeof (neighbor_lists),
1919 typeof (nhs. periodic_box)}(nhs, neighbor_lists, nhs. periodic_box)
2020 end
2121end
@@ -59,6 +59,17 @@ function initialize_neighbor_lists!(neighbor_lists, neighborhood_search, x, y)
5959 end
6060end
6161
62+ function initialize_neighbor_lists! (neighbor_lists:: VectorOfVectors , neighborhood_search, x,
63+ y)
64+ neighbor_lists_ = Vector {Vector{Int}} ()
65+ initialize_neighbor_lists! (neighbor_lists_, neighborhood_search, x, y)
66+
67+ empty! (neighbor_lists)
68+ for i in eachindex (neighbor_lists_)
69+ push! (neighbor_lists, neighbor_lists_[i])
70+ end
71+ end
72+
6273@inline function foreach_neighbor (f, system_coords, neighbor_system_coords,
6374 neighborhood_search:: NeighborListsNeighborhoodSearch ,
6475 particle, search_radius = nothing )
0 commit comments