Mercurial > repos > public > sbplib
comparison +sbp/Upwind.m @ 47:ebd25e5a481a
Added upwind operators.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 05 Nov 2015 16:30:17 -0800 |
parents | |
children | 4f5a65f49035 |
comparison
equal
deleted
inserted
replaced
46:dd4db0c97a02 | 47:ebd25e5a481a |
---|---|
1 classdef Ordinary < 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 = Ordinary(m,h,order) | |
13 | |
14 if order == 3 | |
15 [H, HI, Dp, Dm, e_1, e_m] = sbp.upwind3(m,h); | |
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 obj.norms.Q = Q; | |
32 | |
33 obj.boundary.e_1 = e_1; | |
34 obj.boundary.e_m = e_m; | |
35 | |
36 obj.derivatives.Dp = Dp; | |
37 obj.derivatives.Dm = Dm; | |
38 end | |
39 end | |
40 | |
41 methods (Static) | |
42 function lambda = smallestGrid(obj) | |
43 error('Not implmented') | |
44 end | |
45 end | |
46 end | |
47 | |
48 | |
49 | |
50 | |
51 |