comparison +sbp/D1Upwind.m @ 252:07fa0d6a05bb operator_remake

Renamned class files and added nonequidistant operators.
author Martin Almquist <martin.almquist@it.uu.se>
date Wed, 07 Sep 2016 13:40:41 +0200
parents
children 6009f2712d13
comparison
equal deleted inserted replaced
251:6a5e94bb5e13 252:07fa0d6a05bb
1 classdef D1Upwind < sbp.OpSet
2 properties
3 norms % Struct containing norm matrices such as H,Q, M
4 boundary % Struct contanging vectors for boundry point approximations
5 derivatives % Struct containging differentiation operators
6 borrowing % Struct with borrowing limits for different norm matrices
7 m % Number of grid points.
8 h % Step size
9 end
10
11 methods
12 function obj = D1Upwind(m,h,order)
13
14 switch order
15 case 2
16 [H, HI, Dp, Dm, e_1, e_m] = sbp.upwind2(m,h);
17 case 3
18 [H, HI, Dp, Dm, e_1, e_m] = sbp.upwind3(m,h);
19 case 4
20 [H, HI, Dp, Dm, e_1, e_m] = sbp.upwind4(m,h);
21 case 5
22 [H, HI, Dp, Dm, e_1, e_m] = sbp.upwind5(m,h);
23 case 6
24 [H, HI, Dp, Dm, e_1, e_m] = sbp.upwind6(m,h);
25 case 7
26 [H, HI, Dp, Dm, e_1, e_m] = sbp.upwind7(m,h);
27 case 8
28 [H, HI, Dp, Dm, e_1, e_m] = sbp.upwind8(m,h);
29 case 9
30 [H, HI, Dp, Dm, e_1, e_m] = sbp.upwind9(m,h);
31 otherwise
32 error('Invalid operator order %d.',order);
33 end
34
35 obj.h = h;
36 obj.m = m;
37
38 obj.norms.H = H;
39 obj.norms.HI = HI;
40
41 obj.boundary.e_1 = e_1;
42 obj.boundary.e_m = e_m;
43
44 obj.derivatives.Dp = Dp;
45 obj.derivatives.Dm = Dm;
46 end
47 end
48
49 methods (Static)
50 function lambda = smallestGrid(obj)
51 error('Not implmented')
52 end
53 end
54 end
55
56
57
58
59