Mercurial > repos > public > sbplib
comparison +sbp/D2Variable.m @ 886:8894e9c49e40 feature/timesteppers
Merge with default for latest changes
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Thu, 15 Nov 2018 16:36:21 -0800 |
parents | 52a9dedb9171 |
children | 738de3a4058b |
comparison
equal
deleted
inserted
replaced
816:b5e5b195da1e | 886:8894e9c49e40 |
---|---|
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)'; |
27 | 27 |
28 switch order | 28 switch order |
29 | |
30 case 6 | |
31 | |
32 [obj.H, obj.HI, obj.D1, obj.D2, ... | |
33 ~, obj.e_l, obj.e_r, ~, ~, ~, ~, ~,... | |
34 obj.d1_l, obj.d1_r] = ... | |
35 sbp.implementations.d4_variable_6(m, obj.h); | |
36 obj.borrowing.M.d1 = 0.1878; | |
37 obj.borrowing.R.delta_D = 0.3696; | |
38 % Borrowing e^T*D1 - d1 from R | |
39 | |
29 case 4 | 40 case 4 |
30 [obj.H, obj.HI, obj.D1, obj.D2, obj.e_l,... | 41 [obj.H, obj.HI, obj.D1, obj.D2, obj.e_l,... |
31 obj.e_r, obj.d1_l, obj.d1_r] = ... | 42 obj.e_r, obj.d1_l, obj.d1_r] = ... |
32 sbp.implementations.d2_variable_4(m,obj.h); | 43 sbp.implementations.d2_variable_4(m,obj.h); |
33 obj.borrowing.M.S = 0.2505765857; | 44 obj.borrowing.M.d1 = 0.2505765857; |
45 | |
46 obj.borrowing.R.delta_D = 0.577587500088313; | |
47 % Borrowing e^T*D1 - d1 from R | |
34 case 2 | 48 case 2 |
35 [obj.H, obj.HI, obj.D1, obj.D2, obj.e_l,... | 49 [obj.H, obj.HI, obj.D1, obj.D2, obj.e_l,... |
36 obj.e_r, obj.d1_l, obj.d1_r] = ... | 50 obj.e_r, obj.d1_l, obj.d1_r] = ... |
37 sbp.implementations.d2_variable_2(m,obj.h); | 51 sbp.implementations.d2_variable_2(m,obj.h); |
38 obj.borrowing.M.S = 0.3636363636; | 52 obj.borrowing.M.d1 = 0.3636363636; |
39 % Borrowing const taken from Virta 2014 | 53 % Borrowing const taken from Virta 2014 |
54 | |
55 obj.borrowing.R.delta_D = 1.000000538455350; | |
56 % Borrowing e^T*D1 - d1 from R | |
40 | 57 |
41 otherwise | 58 otherwise |
42 error('Invalid operator order %d.',order); | 59 error('Invalid operator order %d.',order); |
43 end | 60 end |
44 | 61 obj.borrowing.H11 = obj.H(1,1)/obj.h; % First element in H/h, |
45 obj.m = m; | 62 obj.m = m; |
46 obj.M = []; | 63 obj.M = []; |
47 | 64 end |
65 function str = string(obj) | |
66 str = [class(obj) '_' num2str(obj.order)]; | |
48 end | 67 end |
49 end | 68 end |
69 | |
50 | 70 |
51 end | 71 end |
52 | 72 |
53 | 73 |
54 | 74 |