Mercurial > repos > public > sbplib
annotate +sbp/Upwind.m @ 54:2194cd385419
Euler1d: Fixed russian dissipation. Cleaned up. Added non-working BC.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 11 Nov 2015 19:21:38 -0800 |
parents | 4f5a65f49035 |
children | c56437d097de |
rev | line source |
---|---|
52
4f5a65f49035
Fixed the upwind operators.
Jonatan Werpers <jonatan@werpers.com>
parents:
47
diff
changeset
|
1 classdef Upwind < sbp.OpSet |
47 | 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 | |
52
4f5a65f49035
Fixed the upwind operators.
Jonatan Werpers <jonatan@werpers.com>
parents:
47
diff
changeset
|
12 function obj = Upwind(m,h,order) |
47 | 13 |
14 if order == 3 | |
52
4f5a65f49035
Fixed the upwind operators.
Jonatan Werpers <jonatan@werpers.com>
parents:
47
diff
changeset
|
15 [H, HI, Dp, Dm, e_1, e_m] = sbp.upwind3_3bp(m,h); |
47 | 16 elseif order == 4 |
17 [H, HI, Dp, Dm, e_1, e_m] = sbp.upwind4(m,h); | |
18 elseif order == 6 | |
19 [H, HI, Dp, Dm, e_1, e_m] = sbp.upwind6(m,h); | |
20 elseif order == 8 | |
21 [H, HI, Dp, Dm, e_1, e_m] = sbp.upwind8(m,h); | |
22 else | |
23 error('Invalid operator order %d.',order); | |
24 end | |
25 | |
26 obj.h = h; | |
27 obj.m = m; | |
28 | |
29 obj.norms.H = H; | |
30 obj.norms.HI = HI; | |
31 | |
32 obj.boundary.e_1 = e_1; | |
33 obj.boundary.e_m = e_m; | |
34 | |
35 obj.derivatives.Dp = Dp; | |
36 obj.derivatives.Dm = Dm; | |
37 end | |
38 end | |
39 | |
40 methods (Static) | |
41 function lambda = smallestGrid(obj) | |
42 error('Not implmented') | |
43 end | |
44 end | |
45 end | |
46 | |
47 | |
48 | |
49 | |
50 |