changeset 13:4e5319cbe04b

Merge
author Jonatan Werpers <jonatan@werpers.com>
date Mon, 17 Dec 2018 14:48:17 +0100
parents aafc4bdbe675 (diff) c4bc1165fdf7 (current diff)
children 3d032081832d
files
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/diffOp.jl	Mon Dec 17 14:47:24 2018 +0100
+++ b/diffOp.jl	Mon Dec 17 14:48:17 2018 +0100
@@ -29,19 +29,23 @@
 end
 
 # u = L*v
-function apply(L::Laplace1D, u::AbstractVector, v::AbstractVector)::AbstractVector
+function apply(L::Laplace1D, u::AbstractVector, v::AbstractVector)
     N = closureSize(L.op)
     M = length(v)
 
+    h = scaling(L.grid)
+
     for i ∈ 1:N
-        u[i] = apply(L.op.closureStencils[i], v, i)
+        u[i] = apply(L.op.closureStencils[i], v, i)/h^2
     end
 
     for i ∈ N+1:M-N
-        u[i] = apply(L.op.innerStencil, i);
+        u[i] = apply(L.op.innerStencil, i)/h^2
     end
 
     for i ∈ M:-1:M-N+1
-        u[i] = apply(flip(L.op.closureStencils[M-i+1]), v, i)
+        u[i] = apply(flip(L.op.closureStencils[M-i+1]), v, i)/h^2
     end
+
+    return nothing
 end