Mercurial > repos > public > sbplib
comparison +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 |
comparison
equal
deleted
inserted
replaced
720:07f8311374c6 | 743:f4595f14d696 |
---|---|
44 default_arg('opSet',{@sbp.D2Variable, @sbp.D2Variable}); | 44 default_arg('opSet',{@sbp.D2Variable, @sbp.D2Variable}); |
45 default_arg('a',1); | 45 default_arg('a',1); |
46 dim = 2; | 46 dim = 2; |
47 | 47 |
48 assert(isa(g, 'grid.Cartesian')) | 48 assert(isa(g, 'grid.Cartesian')) |
49 if isa(a, 'function_handle') | |
50 a = grid.evalOn(g, a); | |
51 a = spdiag(a); | |
52 end | |
49 | 53 |
50 m = g.size(); | 54 m = g.size(); |
51 m_tot = g.N(); | 55 m_tot = g.N(); |
52 | 56 |
53 h = g.scaling(); | 57 h = g.scaling(); |
176 d = obj.d1_l; | 180 d = obj.d1_l; |
177 end | 181 end |
178 | 182 |
179 Hi = obj.Hi; | 183 Hi = obj.Hi; |
180 H_gamma = obj.H_boundary{j}; | 184 H_gamma = obj.H_boundary{j}; |
181 a = obj.a; | 185 a = e{j}'*obj.a*e{j}; |
182 | 186 |
183 switch type | 187 switch type |
184 | 188 |
185 % Dirichlet boundary condition | 189 % Dirichlet boundary condition |
186 case {'D','d','dirichlet','Dirichlet'} | 190 case {'D','d','dirichlet','Dirichlet'} |