comparison src/Grids/grid.jl @ 1262:5e28ae42caf2 refactor/grids

Clean up IteratorSize and eltype for EquidistantGrid, Grid, and ZeroDimGrid
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 23 Feb 2023 22:29:36 +0100
parents 198ccda331a6
children 7a67935d3f3a
comparison
equal deleted inserted replaced
1261:a4834779cd6d 1262:5e28ae42caf2
9 #TBD: Should it be an AbstractArray? See notes in grid_refactor.md 9 #TBD: Should it be an AbstractArray? See notes in grid_refactor.md
10 # TODO: Document that grids should implement the interfaces for iteration and indexing. 10 # TODO: Document that grids should implement the interfaces for iteration and indexing.
11 abstract type Grid{T,D} end 11 abstract type Grid{T,D} end
12 12
13 13
14 Base.ndims(::Grid{T,D}) where {T,D} = D # nidms borde nog vara antalet index som används för att indexera nätet. Snarare än vilken dimension nätet har (tänk ostrukturerat) 14 Base.ndims(::Grid{T,D}) where {T,D} = D
15 Base.eltype(::Grid{T,D}) where {T,D} = T # vad ska eltype vara? Inte T väl... en vektor? SVector{T,D}? 15 Base.eltype(::Type{<:Grid{T}}) where T = T
16 16
17 function refine(::Grid) end 17 function refine(::Grid) end
18 function coarsen(::Grid) end # Should this be here? What if it is not possible? 18 function coarsen(::Grid) end # Should this be here? What if it is not possible?
19 19
20 """ 20 """