changeset 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 947f7579ba9c
children 0236f8e90567
files plotDerivative2d.jl
diffstat 1 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
diff -r 947f7579ba9c -r 2a7d0ed7ac10 plotDerivative2d.jl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plotDerivative2d.jl	Fri Jan 11 11:18:13 2019 +0100
@@ -0,0 +1,16 @@
+g = sbp.grid.EquidistantGrid((100,75),((0, 0), (2pi, 3/2*pi)))
+op = sbp.readOperator("d2_4th.txt","h_4th.txt")
+Laplace = sbp.Laplace2D(g,1,op)
+
+init(x,y) = sin(x) + cos(y)
+v = sbp.grid.evalOn(g,init)
+
+u = zeros(length(v))
+
+sbp.apply!(Laplace,u,v)
+
+@show u
+@show u'*u
+
+sbp.grid.plotgridfunction(g,u)
+