|
145 | 145 | @test neighbors5 == [36, 37, 38, 43, 44, 45] |
146 | 146 | end |
147 | 147 |
|
148 | | - @testset "Rectangular Point Cloud 3D" begin |
| 148 | + @testset verbose=true "Rectangular Point Cloud 3D" begin |
149 | 149 | #### Setup |
150 | 150 | # Rectangle of equidistantly spaced points |
151 | 151 | # from (x, y, z) = (-0.25, -0.25, -0.25) to (x, y, z) = (0.35, 0.35, 0.35). |
|
188 | 188 | @test neighbors3 == |
189 | 189 | [115, 116, 117, 122, 123, 124, 129, 130, 131, 164, 165, 166, 171, 172, |
190 | 190 | 173, 178, 179, 180, 213, 214, 215, 220, 221, 222, 227, 228, 229] |
| 191 | + |
| 192 | + update_strategies = (SerialUpdate(), ParallelUpdate()) |
| 193 | + @testset verbose=true "eachindex_y $update_strategy" for update_strategy in |
| 194 | + update_strategies |
| 195 | + # Test that `eachindex_y` is passed correctly to the neighborhood search. |
| 196 | + # This requires `SerialUpdate` or `ParallelUpdate`. |
| 197 | + min_corner = min.(minimum(coordinates1, dims = 2), |
| 198 | + minimum(coordinates2, dims = 2)) |
| 199 | + max_corner = max.(maximum(coordinates1, dims = 2), |
| 200 | + maximum(coordinates2, dims = 2)) |
| 201 | + cell_list = FullGridCellList(; min_corner, max_corner, search_radius) |
| 202 | + nhs2 = GridNeighborhoodSearch{3}(; search_radius, n_points, update_strategy, |
| 203 | + cell_list) |
| 204 | + |
| 205 | + # Initialize with all points |
| 206 | + initialize!(nhs2, coordinates1, coordinates1) |
| 207 | + |
| 208 | + # Update with a subset of points |
| 209 | + update!(nhs2, coordinates2, coordinates2; eachindex_y = 120:220) |
| 210 | + |
| 211 | + neighbors2 = sort(collect(PointNeighbors.eachneighbor(point_position1, nhs2))) |
| 212 | + neighbors3 = sort(collect(PointNeighbors.eachneighbor(point_position2, nhs2))) |
| 213 | + |
| 214 | + # Check that the neighbors are the intersection of the previous neighbors |
| 215 | + # with the `eachindex_y` range. |
| 216 | + @test neighbors2 == Int[] |
| 217 | + @test neighbors3 == |
| 218 | + [122, 123, 124, 129, 130, 131, 164, 165, 166, 171, 172, 173, |
| 219 | + 178, 179, 180, 213, 214, 215, 220] |
| 220 | + end |
191 | 221 | end |
192 | 222 |
|
193 | 223 | @testset verbose=true "Periodicity" begin |
|
0 commit comments