view src/Grids/grid.jl @ 1127:5490d0a38007 feature/grids

Remove export of boundary_size och orthogonal_dims
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Wed, 05 Oct 2022 21:26:37 +0200
parents aeeffca46b94
children dfbd62c7eb09
line wrap: on
line source

"""
     Grid

Should implement
    dim(grid::Grid)
    points(grid::Grid)

"""
abstract type Grid end
function dim end # TODO: Rename to Base.ndims instead? That's the name used for arrays.
function points end

"""
    dims(grid::Grid)

A range containing the dimensions of `grid`
"""
dims(grid::Grid) = 1:dim(grid)

"""
    evalOn(grid::Grid, f::Function)

Evaluate function `f` on `grid`
"""
function evalOn(grid::Grid, f::Function)
    F(x) = f(x...)
    return F.(points(grid))
end