comparison src/Grids/grid.jl @ 1394:60857d8338cb bugfix/grids/complete_interface_impl

Merge default
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 15 Aug 2023 22:45:58 +0200
parents 4d628c83987e
children dba1e8c95bbb
comparison
equal deleted inserted replaced
1391:9da927271752 1394:60857d8338cb
19 """ 19 """
20 abstract type Grid{T,D} end 20 abstract type Grid{T,D} end
21 21
22 Base.ndims(::Grid{T,D}) where {T,D} = D 22 Base.ndims(::Grid{T,D}) where {T,D} = D
23 Base.eltype(::Type{<:Grid{T}}) where T = T 23 Base.eltype(::Type{<:Grid{T}}) where T = T
24
25 Base.getindex(g::Grid, I::CartesianIndex) = g[Tuple(I)...]
24 26
25 """ 27 """
26 coordinate_size(g) 28 coordinate_size(g)
27 29
28 The lenght of the coordinate vector of `Grid` `g`. 30 The lenght of the coordinate vector of `Grid` `g`.