view AbstractGrid.jl @ 94:84b1ad5a3755 stencil_index

Made everything work(?) but also go really slow. And also not type-stable.
author Ylva Rydin <ylva.rydin@telia.com>
date Mon, 04 Feb 2019 16:09:07 +0100
parents 614b56a017b9
children 631eb9b35d72
line wrap: on
line source

abstract type AbstractGrid end

function numberOfDimensions(grid::AbstractGrid)
    error("Not implemented for abstact type AbstractGrid")
end

function numberOfPoints(grid::AbstractGrid)
    error("Not implemented for abstact type AbstractGrid")
end

function points(grid::AbstractGrid)
    error("Not implemented for abstact type AbstractGrid")
end

# Evaluate function f on the grid g
function evalOn(g::AbstractGrid, f::Function)
    F(x) = f(x...)
    return F.(points(g))
end