Mercurial > repos > public > sbplib_julia
comparison src/Grids/grid.jl @ 1143:9275d95e2d90 refactor/grids
Merge with default
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 19 Oct 2022 22:36:02 +0200 |
parents | dfbd62c7eb09 |
children | 5f677cd6f0b6 |
comparison
equal
deleted
inserted
replaced
1092:c4ea28d904f5 | 1143:9275d95e2d90 |
---|---|
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 |