Mercurial > repos > public > sbplib
comparison +sbp/D2Variable.m @ 425:e56dbd9e4196 feature/grids
Merge feature/beams
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 07 Feb 2017 16:09:02 +0100 |
parents | 359861563866 |
children | 43ea848b6aa1 |
comparison
equal
deleted
inserted
replaced
423:a2cb0d4f4a02 | 425:e56dbd9e4196 |
---|---|
16 borrowing % Struct with borrowing limits for different norm matrices | 16 borrowing % Struct with borrowing limits for different norm matrices |
17 end | 17 end |
18 | 18 |
19 methods | 19 methods |
20 function obj = D2Variable(m,lim,order) | 20 function obj = D2Variable(m,lim,order) |
21 | 21 |
22 x_l = lim{1}; | 22 x_l = lim{1}; |
23 x_r = lim{2}; | 23 x_r = lim{2}; |
24 L = x_r-x_l; | 24 L = x_r-x_l; |
25 obj.h = L/(m-1); | 25 obj.h = L/(m-1); |
26 obj.x = linspace(x_l,x_r,m)'; | 26 obj.x = linspace(x_l,x_r,m)'; |
28 switch order | 28 switch order |
29 case 4 | 29 case 4 |
30 [obj.H, obj.HI, obj.D1, obj.D2, obj.e_l,... | 30 [obj.H, obj.HI, obj.D1, obj.D2, obj.e_l,... |
31 obj.e_r, obj.d1_l, obj.d1_r] = ... | 31 obj.e_r, obj.d1_l, obj.d1_r] = ... |
32 sbp.implementations.d2_variable_4(m,obj.h); | 32 sbp.implementations.d2_variable_4(m,obj.h); |
33 obj.borrowing.M.S = 0.2505765857; | 33 obj.borrowing.M.d1 = 0.2505765857; |
34 case 2 | 34 case 2 |
35 [obj.H, obj.HI, obj.D1, obj.D2, obj.e_l,... | 35 [obj.H, obj.HI, obj.D1, obj.D2, obj.e_l,... |
36 obj.e_r, obj.d1_l, obj.d1_r] = ... | 36 obj.e_r, obj.d1_l, obj.d1_r] = ... |
37 sbp.implementations.d2_variable_2(m,obj.h); | 37 sbp.implementations.d2_variable_2(m,obj.h); |
38 obj.borrowing.M.S = 0.3636363636; | 38 obj.borrowing.M.d1 = 0.3636363636; |
39 % Borrowing const taken from Virta 2014 | 39 % Borrowing const taken from Virta 2014 |
40 | 40 |
41 otherwise | 41 otherwise |
42 error('Invalid operator order %d.',order); | 42 error('Invalid operator order %d.',order); |
43 end | 43 end |
44 | 44 |
45 obj.m = m; | 45 obj.m = m; |
46 obj.M = []; | 46 obj.M = []; |
47 | 47 end |
48 function str = string(obj) | |
49 str = [class(obj) '_' num2str(obj.order)]; | |
48 end | 50 end |
49 end | 51 end |
52 | |
50 | 53 |
51 end | 54 end |
52 | 55 |
53 | 56 |
54 | 57 |