comparison +sbp/Upwind.m @ 52:4f5a65f49035

Fixed the upwind operators.
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 11 Nov 2015 15:43:15 -0800
parents ebd25e5a481a
children c56437d097de
comparison
equal deleted inserted replaced
51:0be702829bb9 52:4f5a65f49035
1 classdef Ordinary < sbp.OpSet 1 classdef Upwind < sbp.OpSet
2 properties 2 properties
3 norms % Struct containing norm matrices such as H,Q, M 3 norms % Struct containing norm matrices such as H,Q, M
4 boundary % Struct contanging vectors for boundry point approximations 4 boundary % Struct contanging vectors for boundry point approximations
5 derivatives % Struct containging differentiation operators 5 derivatives % Struct containging differentiation operators
6 borrowing % Struct with borrowing limits for different norm matrices 6 borrowing % Struct with borrowing limits for different norm matrices
7 m % Number of grid points. 7 m % Number of grid points.
8 h % Step size 8 h % Step size
9 end 9 end
10 10
11 methods 11 methods
12 function obj = Ordinary(m,h,order) 12 function obj = Upwind(m,h,order)
13 13
14 if order == 3 14 if order == 3
15 [H, HI, Dp, Dm, e_1, e_m] = sbp.upwind3(m,h); 15 [H, HI, Dp, Dm, e_1, e_m] = sbp.upwind3_3bp(m,h);
16 elseif order == 4 16 elseif order == 4
17 [H, HI, Dp, Dm, e_1, e_m] = sbp.upwind4(m,h); 17 [H, HI, Dp, Dm, e_1, e_m] = sbp.upwind4(m,h);
18 elseif order == 6 18 elseif order == 6
19 [H, HI, Dp, Dm, e_1, e_m] = sbp.upwind6(m,h); 19 [H, HI, Dp, Dm, e_1, e_m] = sbp.upwind6(m,h);
20 elseif order == 8 20 elseif order == 8
26 obj.h = h; 26 obj.h = h;
27 obj.m = m; 27 obj.m = m;
28 28
29 obj.norms.H = H; 29 obj.norms.H = H;
30 obj.norms.HI = HI; 30 obj.norms.HI = HI;
31 obj.norms.Q = Q;
32 31
33 obj.boundary.e_1 = e_1; 32 obj.boundary.e_1 = e_1;
34 obj.boundary.e_m = e_m; 33 obj.boundary.e_m = e_m;
35 34
36 obj.derivatives.Dp = Dp; 35 obj.derivatives.Dp = Dp;