comparison +sbp/D1Nonequidistant.m @ 264:8a625c5a3633 operator_remake

Changed input parameter L (domain length) to lim (cell with domain boundaries)
author Martin Almquist <martin.almquist@it.uu.se>
date Fri, 09 Sep 2016 10:39:12 +0200
parents 23051a86faa4
children 4b9310edcdf8
comparison
equal deleted inserted replaced
263:21a180acbd49 264:8a625c5a3633
11 x % grid 11 x % grid
12 borrowing % Struct with borrowing limits for different norm matrices 12 borrowing % Struct with borrowing limits for different norm matrices
13 end 13 end
14 14
15 methods 15 methods
16 function obj = D1Nonequidistant(m,L,order,option) 16 function obj = D1Nonequidistant(m,lim,order,option)
17 17
18 default_arg('option','Accurate'); 18 default_arg('option','Accurate');
19 % 'Accurate' operators are optimized for accuracy 19 % 'Accurate' operators are optimized for accuracy
20 % 'Minimal' operators have the smallest possible boundary 20 % 'Minimal' operators have the smallest possible boundary
21 % closure 21 % closure
22
23 x_l = lim{1};
24 x_r = lim{2};
25 L = x_r-x_l;
22 26
23 switch option 27 switch option
24 28
25 case {'Accurate','accurate','A'} 29 case {'Accurate','accurate','A'}
26 30
64 error('Invalid operator order %d.',order); 68 error('Invalid operator order %d.',order);
65 end 69 end
66 70
67 end 71 end
68 72
73 obj.x = obj.x + x_l;
74
69 obj.e_1 = sparse(m,1); 75 obj.e_1 = sparse(m,1);
70 obj.e_m = sparse(m,1); 76 obj.e_m = sparse(m,1);
71 obj.e_1(1) = 1; 77 obj.e_1(1) = 1;
72 obj.e_m(m) = 1; 78 obj.e_m(m) = 1;
73 79