Mercurial > repos > public > sbplib
comparison +sbp/D2Variable.m @ 263:21a180acbd49 operator_remake
Renamed standard class to D2Standard etc, Rewrote class properties.
author | Martin Almquist <martin.almquist@it.uu.se> |
---|---|
date | Thu, 08 Sep 2016 17:50:30 +0200 |
parents | 23051a86faa4 |
children | 8a625c5a3633 |
comparison
equal
deleted
inserted
replaced
262:23051a86faa4 | 263:21a180acbd49 |
---|---|
1 classdef D2Variable < sbp.OpSet | 1 classdef D2Variable < sbp.OpSet |
2 properties | 2 properties |
3 norms % Struct containing norm matrices such as H,Q, M | 3 D1 % SBP operator approximating first derivative |
4 boundary % Struct contanging vectors for boundry point approximations | 4 H % Norm matrix |
5 derivatives % Struct containging differentiation operators | 5 HI % H^-1 |
6 borrowing % Struct with borrowing limits for different norm matrices | 6 Q % Skew-symmetric matrix |
7 e_1 % Left boundary operator | |
8 e_m % Right boundary operator | |
9 D2 % SBP operator for second derivative | |
10 M % Norm matrix, second derivative | |
11 S_1 % Left boundary first derivative | |
12 S_m % Right boundary first derivative | |
7 m % Number of grid points. | 13 m % Number of grid points. |
8 h % Step size | 14 h % Step size |
15 x % grid | |
16 borrowing % Struct with borrowing limits for different norm matrices | |
9 end | 17 end |
10 | 18 |
11 methods | 19 methods |
12 function obj = D2Variable(m,h,order) | 20 function obj = D2Variable(m,L,order) |
21 | |
22 obj.h = L/(m-1); | |
23 obj.x = linspace(0,L,m)'; | |
13 | 24 |
14 switch order | 25 switch order |
15 case 4 | 26 case 4 |
16 [H, HI, D1, D2, e_1, e_m, S_1, S_m] = ... | 27 [obj.H, obj.HI, obj.D1, obj.D2, obj.e_1,... |
17 sbp.implementations.d2_variable_4(m,h); | 28 obj.e_m, obj.S_1, obj.S_m] = ... |
29 sbp.implementations.d2_variable_4(m,obj.h); | |
18 obj.borrowing.M.S = 0.2505765857; | 30 obj.borrowing.M.S = 0.2505765857; |
19 otherwise | 31 otherwise |
20 error('Invalid operator order %d.',order); | 32 error('Invalid operator order %d.',order); |
21 end | 33 end |
22 | 34 |
23 obj.h = h; | |
24 obj.m = m; | 35 obj.m = m; |
25 | 36 obj.M = []; |
26 obj.norms.H = H; | |
27 obj.norms.HI = HI; | |
28 % obj.norms.Q = Q; | |
29 % obj.norms.M = M; | |
30 | |
31 obj.boundary.e_1 = e_1; | |
32 obj.boundary.S_1 = S_1; | |
33 | |
34 obj.boundary.e_m = e_m; | |
35 obj.boundary.S_m = S_m; | |
36 | |
37 obj.derivatives.D1 = D1; | |
38 obj.derivatives.D2 = D2; | |
39 | 37 |
40 end | 38 end |
41 end | 39 end |
42 | 40 |
43 end | 41 end |