Mercurial > repos > public > sbplib_julia
comparison src/Grids/equidistant_grid.jl @ 1344:760a4a1ec4b7 refactor/grids
Add 2D tests for dissipation operators and fix bug
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Mon, 15 May 2023 22:37:55 +0200 |
parents | cca45af5e724 |
children | 08f06bfacd5c |
comparison
equal
deleted
inserted
replaced
1343:fa3695f634de | 1344:760a4a1ec4b7 |
---|---|
12 """ | 12 """ |
13 struct EquidistantGrid{T,R<:AbstractRange{T}} <: Grid{T,1} | 13 struct EquidistantGrid{T,R<:AbstractRange{T}} <: Grid{T,1} |
14 points::R | 14 points::R |
15 end | 15 end |
16 | 16 |
17 Base.eachindex(g::EquidistantGrid) = eachindex(g.points) | |
18 | |
19 # Indexing interface | 17 # Indexing interface |
20 Base.getindex(g::EquidistantGrid, i) = g.points[i] | 18 Base.getindex(g::EquidistantGrid, i) = g.points[i] |
19 Base.eachindex(g::EquidistantGrid) = eachindex(g.points) | |
21 Base.firstindex(g::EquidistantGrid) = firstindex(g.points) | 20 Base.firstindex(g::EquidistantGrid) = firstindex(g.points) |
22 Base.lastindex(g::EquidistantGrid) = lastindex(g.points) | 21 Base.lastindex(g::EquidistantGrid) = lastindex(g.points) |
23 | 22 |
24 # Iteration interface | 23 # Iteration interface |
25 Base.iterate(g::EquidistantGrid) = iterate(g.points) | 24 Base.iterate(g::EquidistantGrid) = iterate(g.points) |