comparison src/Grids/grid.jl @ 1257:198ccda331a6 refactor/grids

Remove range dim as a type paratmeter on Grid as it is already encoded in T if available
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 23 Feb 2023 11:38:19 +0100
parents 3fc78ad26d03
children 5e28ae42caf2
comparison
equal deleted inserted replaced
1256:3fc78ad26d03 1257:198ccda331a6
1 """ 1 """
2 Grid{T,D,RD} <: AbstractArray{T,D} 2 Grid{T,D}
3 3
4 The top level type for grids. 4 The top level type for grids.
5 5
6 Should implement 6 Should implement
7 # TBD: 7 # TBD:
8 """ 8 """
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,RD} end 11 abstract type Grid{T,D} end
12 12
13 13
14 Base.ndims(::Grid{T,D,RD}) where {T,D,RD} = 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 # 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)
15 nrangedims(::Grid{T,D,RD}) where {T,D,RD} = RD 15 Base.eltype(::Grid{T,D}) where {T,D} = T # vad ska eltype vara? Inte T väl... en vektor? SVector{T,D}?
16 Base.eltype(::Grid{T,D,RD}) where {T,D,RD} = T # vad ska eltype vara? Inte T väl... en vektor? SVector{T,D}?
17 16
18 function refine(::Grid) end 17 function refine(::Grid) end
19 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?
20 19
21 """ 20 """