view sbpPlot.jl @ 1056:fe83ea1db953 feature/nested_stencils

Add argument restrictions to stencil constructors to get clearer error messages (grafted from f74189c954d65eb5e2ce8de4e9210f74390b8cb7)
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 20 Jan 2022 15:17:37 +0100
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