view sbpPlot.jl @ 347:0a95a829176c performance/lazy_elementwise_operation

lazy_array.jl: Bring back the concrete types in the LazyElementwiseOperation struct. We went this to be able to avoid dynamic dispatch
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 25 Sep 2020 21:51:14 +0200
parents d61bfc8cf6a5
children
line wrap: on
line source

include("sbp.jl")
using Makie
import .sbp.Grid
function plotgridfunction(grid::sbp.Grid.EquidistantGrid, gridfunction::AbstractArray)
    if sbp.Grid.dimension(grid) == 1
        plot(sbp.Grid.pointsalongdim(grid,1), gridfunction)
    elseif sbp.Grid.dimension(grid) == 2
        scene = surface(sbp.Grid.pointsalongdim(grid,1),sbp.Grid.pointsalongdim(grid,2), gridfunction)
    else
        error(string("Plot not implemented for dimension ", string(dimension(grid))))
    end
end