|
28 | 28 | # Create neighborhood search |
29 | 29 | nhs1 = GridNeighborhoodSearch{2}(radius, nparticles) |
30 | 30 |
|
31 | | - coords_fun(i) = coordinates1[:, i] |
32 | | - initialize_grid!(nhs1, coords_fun) |
| 31 | + initialize_grid!(nhs1, coordinates1) |
33 | 32 |
|
34 | 33 | # Get each neighbor for `particle_position1` |
35 | 34 | neighbors1 = sort(collect(PointNeighbors.eachneighbor(particle_position1, nhs1))) |
|
38 | 37 | coordinates2 = coordinates1 .+ [1.4, -3.5] |
39 | 38 |
|
40 | 39 | # Update neighborhood search |
41 | | - coords_fun2(i) = coordinates2[:, i] |
42 | | - update_grid!(nhs1, coords_fun2) |
| 40 | + update_grid!(nhs1, coordinates2) |
43 | 41 |
|
44 | 42 | # Get each neighbor for updated NHS |
45 | 43 | neighbors2 = sort(collect(PointNeighbors.eachneighbor(particle_position1, |
|
54 | 52 |
|
55 | 53 | # Double search radius |
56 | 54 | nhs2 = GridNeighborhoodSearch{2}(2 * radius, size(coordinates1, 2)) |
57 | | - initialize_grid!(nhs2, coords_fun) |
| 55 | + initialize!(nhs2, coordinates1, coordinates1) |
58 | 56 |
|
59 | 57 | # Get each neighbor in double search radius |
60 | 58 | neighbors4 = sort(collect(PointNeighbors.eachneighbor(particle_position1, |
|
64 | 62 | coordinates2 = coordinates1 .+ [0.4, -0.4] |
65 | 63 |
|
66 | 64 | # Update neighborhood search |
67 | | - update_grid!(nhs2, coords_fun2) |
| 65 | + update!(nhs2, coordinates2, coordinates2) |
68 | 66 |
|
69 | 67 | # Get each neighbor in double search radius |
70 | 68 | neighbors5 = sort(collect(PointNeighbors.eachneighbor(particle_position1, |
|
0 commit comments