comparison src/Grids/grid.jl @ 1131:560ff49ff17f

Merge with feature/grids
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Wed, 05 Oct 2022 22:03:54 +0200
parents dfbd62c7eb09
children 5f677cd6f0b6
comparison
equal deleted inserted replaced
1123:185911ca45f0 1131:560ff49ff17f
1 """
2 Grid
3
4 Should implement
5 Base.ndims(grid::Grid)
6 points(grid::Grid)
7
8 """
9 abstract type Grid end
10 function points end
11
12 """
13 dims(grid::Grid)
14
15 A range containing the dimensions of `grid`
16 """
17 dims(grid::Grid) = 1:ndims(grid)
18
19 """
20 evalOn(grid::Grid, f::Function)
21
22 Evaluate function `f` on `grid`
23 """
24 function evalOn(grid::Grid, f::Function)
25 F(x) = f(x...)
26 return F.(points(grid))
27 end