diff +scheme/Schrodinger2d.m @ 743:f4595f14d696 feature/utux2D

Change schemes to work for special coefficients.
author Martin Almquist <malmquist@stanford.edu>
date Mon, 21 May 2018 23:11:34 -0700
parents b3f8fb9cefd2
children 459eeb99130f
line wrap: on
line diff
--- a/+scheme/Schrodinger2d.m	Wed Mar 14 21:01:34 2018 -0700
+++ b/+scheme/Schrodinger2d.m	Mon May 21 23:11:34 2018 -0700
@@ -46,6 +46,10 @@
             dim = 2;
 
             assert(isa(g, 'grid.Cartesian'))
+            if isa(a, 'function_handle')
+                a = grid.evalOn(g, a);
+                a = spdiag(a);
+            end
 
             m = g.size();
             m_tot = g.N();
@@ -178,7 +182,7 @@
 
             Hi = obj.Hi;
             H_gamma = obj.H_boundary{j};
-            a = obj.a;
+            a = e{j}'*obj.a*e{j};
 
             switch type