view sbpPlot.jl @ 1354:150313ed2cae

Merge refactor/grids (missed delete of a note) Changes from previous merge: * `EquidistantGrid` is now only a 1D thing. * Higher dimensions are supported through `TensorGrid`. * The old behavior of `EquidistantGrid` has been moved to the function `equidistant_grid`. * Grids embedded in higher dimensions are now supported through tensor products with `ZeroDimGrid`s. * Vector valued grid functions are now supported and the default element type is `SVector`. * Grids are now expected to support Julia's indexing and iteration interface. * `eval_on` can be called with both `f(x,y,...)` and `f(x̄)`.
author Jonatan Werpers <jonatan@werpers.com>
date Sat, 20 May 2023 14:19:20 +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