comparison +scheme/Euler1d.m @ 302:f39f98b59f61

Fixes in Upwind operators and Euler1D scheme.
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 29 Sep 2016 16:27:33 +0200
parents 0e66299592cc
children 459eeb99130f
comparison
equal deleted inserted replaced
289:354e40a8e1a5 302:f39f98b59f61
25 SUPERSONIC_OUTFLOW = -2; 25 SUPERSONIC_OUTFLOW = -2;
26 end 26 end
27 27
28 methods 28 methods
29 function obj = Euler1d(m,xlim,order,gama,opsGen,do_upwind) 29 function obj = Euler1d(m,xlim,order,gama,opsGen,do_upwind)
30 default_arg('opsGen',@sbp.Ordinary); 30 default_arg('opsGen',@sbp.D2Standard);
31 default_arg('gama', 1.4); 31 default_arg('gama', 1.4);
32 default_arg('do_upwind', false); 32 default_arg('do_upwind', false);
33 gamma = gama; 33 gamma = gama;
34 34
35 [x, h] = util.get_grid(xlim{:},m); 35 [x, h] = util.get_grid(xlim{:},m);
36 36
37 if do_upwind 37 if do_upwind
38 ops = sbp.Upwind(m,h,order); 38 ops = sbp.D1Upwind(m,xlim,order);
39 Dp = ops.derivatives.Dp; 39 Dp = ops.Dp;
40 Dm = ops.derivatives.Dm; 40 Dm = ops.Dm;
41 41
42 D1 = (Dp + Dm)/2; 42 D1 = (Dp + Dm)/2;
43 Ddisp = (Dp - Dm)/2; 43 Ddisp = (Dp - Dm)/2;
44 else 44 else
45 ops = opsGen(m,h,order); 45 ops = opsGen(m,xlim,order);
46 D1 = sparse(ops.derivatives.D1); 46 printExpr('issparse(ops.D1)');
47 end 47 D1 = ops.D1;
48 48 end
49 H = sparse(ops.norms.H); 49
50 Hi = sparse(ops.norms.HI); 50 H = sparse(ops.H);
51 e_l = sparse(ops.boundary.e_1); 51 Hi = sparse(ops.HI);
52 e_r = sparse(ops.boundary.e_m); 52 e_l = sparse(ops.e_l);
53 e_r = sparse(ops.e_r);
53 54
54 I_x = speye(m); 55 I_x = speye(m);
55 I_3 = speye(3); 56 I_3 = speye(3);
56 57
57 D1 = kr(D1, I_3); 58 D1 = kr(D1, I_3);