comparison src/Grids/grid.jl @ 1244:eb19cd128157 refactor/grids

Group eval_on with other gridfunction functionality
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 21 Feb 2023 21:37:37 +0100
parents 917cb8acbc17
children 3fc78ad26d03
comparison
equal deleted inserted replaced
1243:783284b3e438 1244:eb19cd128157
12 12
13 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) 13 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 nrangedims(::Grid{T,D,RD}) where {T,D,RD} = RD 14 nrangedims(::Grid{T,D,RD}) where {T,D,RD} = RD
15 Base.eltype(::Grid{T,D,RD}) where {T,D,RD} = T # vad ska eltype vara? Inte T väl... en vektor? SVector{T,D}? 15 Base.eltype(::Grid{T,D,RD}) where {T,D,RD} = T # vad ska eltype vara? Inte T väl... en vektor? SVector{T,D}?
16 16
17 function eval_on(::Grid) end # TODO: Should return a LazyArray and index the grid
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 """
22 # TODO 21 # TODO
36 Enumerate the dimensions of the grid. 35 Enumerate the dimensions of the grid.
37 """ 36 """
38 dims(grid::Grid) = 1:ndims(grid) 37 dims(grid::Grid) = 1:ndims(grid)
39 38
40 39
40 # TBD: New file grid_functions.jl?
41 41
42 # TBD: New file grid_functions.jl? 42 function eval_on(::Grid) end # TODO: Should return a LazyArray and index the grid
43 43
44 """ 44 """
45 getcomponent(gfun, I::Vararg{Int}) 45 getcomponent(gfun, I::Vararg{Int})
46 46
47 Return one of the components of gfun as a grid function. 47 Return one of the components of gfun as a grid function.