view plotDerivative.jl @ 962:1bb28e47990f feature/laplace_opset

Revew: Consider review comments for laplace(grid,...). Keeping the method separate (instead of inlining it) allows for users to create custom operators w.o. first defining a stencil set. Having both methods is also similar to how other types of operators can be constructed.
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Mon, 14 Mar 2022 10:00:25 +0100
parents 8d505e9bc715
children
line wrap: on
line source

g = sbp.Grid.EquidistantGrid((200,), (0.0,), (2pi,))
op =sbp.readOperator("d2_4th.txt","h_4th.txt")
Laplace = sbp.Laplace(g,1.0,op)

init(x) = cos(x)
v = sbp.Grid.evalOn(g,init)
u = zeros(length(v))

sbp.apply!(Laplace,u,v)

@show u
sbp.Grid.plotgridfunction(g,u)