Skip to content

Commit 0808489

Browse files
committed
Throw error if too many dimensions are used in FullGridCellList
1 parent 1d1bb30 commit 0808489

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/cell_lists/full_grid.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,15 @@ function FullGridCellList(; min_corner, max_corner,
4747
search_radius = zero(eltype(min_corner)),
4848
backend = DynamicVectorOfVectors{Int32},
4949
max_points_per_cell = 100)
50+
if length(min_corner) != length(max_corner)
51+
throw(ArgumentError("min_corner and max_corner must have the same length"))
52+
end
53+
54+
if length(min_corner) > 100
55+
throw(ArgumentError("FullGridCellList only supports up to 100 dimensions, " *
56+
"check your `min_corner` and `max_corner`"))
57+
end
58+
5059
# Add one layer in each direction to make sure neighbor cells exist.
5160
# Also pad domain a little more to avoid 0 in cell indices due to rounding errors.
5261
# We can't just use `eps()`, as one might use lower precision types.

0 commit comments

Comments
 (0)