Mercurial > repos > public > sbplib_julia
comparison plotDerivative2d.jl @ 50:2a7d0ed7ac10
Add script for differentiation and plotting of 2d function
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 11 Jan 2019 11:18:13 +0100 |
parents | |
children | 4300a3fbd818 |
comparison
equal
deleted
inserted
replaced
49:947f7579ba9c | 50:2a7d0ed7ac10 |
---|---|
1 g = sbp.grid.EquidistantGrid((100,75),((0, 0), (2pi, 3/2*pi))) | |
2 op = sbp.readOperator("d2_4th.txt","h_4th.txt") | |
3 Laplace = sbp.Laplace2D(g,1,op) | |
4 | |
5 init(x,y) = sin(x) + cos(y) | |
6 v = sbp.grid.evalOn(g,init) | |
7 | |
8 u = zeros(length(v)) | |
9 | |
10 sbp.apply!(Laplace,u,v) | |
11 | |
12 @show u | |
13 @show u'*u | |
14 | |
15 sbp.grid.plotgridfunction(g,u) | |
16 |