view AbstractGrid.jl @ 128:7c0b9bb7ab4d cell_based_test

Improve stencil application code to make it more friendly to compiler optimizations
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 14 Feb 2019 12:46:58 +0100
parents 631eb9b35d72
children
line wrap: on
line source

abstract type AbstractGrid end

function dimension(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