Mercurial > repos > public > sbplib_julia
comparison src/Grids/grid.jl @ 1401:dba1e8c95bbb feature/grids/scalar_eval_on
Merge default
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 22 Aug 2023 15:30:29 +0200 |
parents | 86026367a9ff 4d628c83987e |
children | 2d9eb2d07802 |
comparison
equal
deleted
inserted
replaced
1397:86026367a9ff | 1401:dba1e8c95bbb |
---|---|
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`. |