@@ -31,17 +31,17 @@ struct NeighborListsNeighborhoodSearch{NDIMS, NHS, NL, PB}
3131
3232 function NeighborListsNeighborhoodSearch {NDIMS} (search_radius, n_particles;
3333 periodic_box_min_corner = nothing ,
34- periodic_box_max_corner = nothing ) where {
35- NDIMS
36- }
34+ periodic_box_max_corner = nothing
35+ backend = VectorOfVectors{Int}) where {
36+ NDIMS
37+ }
3738 nhs = GridNeighborhoodSearch {NDIMS} (search_radius, n_particles,
3839 periodic_box_min_corner = periodic_box_min_corner,
3940 periodic_box_max_corner = periodic_box_max_corner)
4041
41- neighbor_lists = Vector {Vector{Int}} ()
42+ neighbor_lists = backend ()
4243
43- new{NDIMS, typeof (nhs),
44- typeof (neighbor_lists),
44+ new{NDIMS, typeof (nhs), typeof (neighbor_lists),
4545 typeof (nhs. periodic_box)}(nhs, neighbor_lists, nhs. periodic_box)
4646 end
4747end
@@ -88,6 +88,17 @@ function initialize_neighbor_lists!(neighbor_lists, neighborhood_search, x, y)
8888 end
8989end
9090
91+ function initialize_neighbor_lists! (neighbor_lists:: VectorOfVectors , neighborhood_search, x,
92+ y)
93+ neighbor_lists_ = Vector {Vector{Int}} ()
94+ initialize_neighbor_lists! (neighbor_lists_, neighborhood_search, x, y)
95+
96+ empty! (neighbor_lists)
97+ for i in eachindex (neighbor_lists_)
98+ push! (neighbor_lists, neighbor_lists_[i])
99+ end
100+ end
101+
91102@inline function foreach_neighbor (f, system_coords, neighbor_system_coords,
92103 neighborhood_search:: NeighborListsNeighborhoodSearch ,
93104 particle; search_radius = nothing )
0 commit comments