Mercurial > repos > public > sbplib
changeset 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 | 354e40a8e1a5 |
children | f18142c1530b |
files | +sbp/D1Upwind.m +scheme/Euler1d.m |
diffstat | 2 files changed, 13 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
diff -r 354e40a8e1a5 -r f39f98b59f61 +sbp/D1Upwind.m --- a/+sbp/D1Upwind.m Mon Sep 12 15:18:25 2016 +0200 +++ b/+sbp/D1Upwind.m Thu Sep 29 16:27:33 2016 +0200 @@ -1,9 +1,8 @@ classdef D1Upwind < sbp.OpSet properties - D1 % SBP operator approximating first derivative + Dp, Dm % SBP operator approximating first derivative H % Norm matrix HI % H^-1 - Q % Skew-symmetric matrix e_l % Left boundary operator e_r % Right boundary operator m % Number of grid points. @@ -14,7 +13,7 @@ methods function obj = D1Upwind(m,lim,order) - + x_l = lim{1}; x_r = lim{2}; L = x_r-x_l;
diff -r 354e40a8e1a5 -r f39f98b59f61 +scheme/Euler1d.m --- a/+scheme/Euler1d.m Mon Sep 12 15:18:25 2016 +0200 +++ b/+scheme/Euler1d.m Thu Sep 29 16:27:33 2016 +0200 @@ -27,7 +27,7 @@ methods function obj = Euler1d(m,xlim,order,gama,opsGen,do_upwind) - default_arg('opsGen',@sbp.Ordinary); + default_arg('opsGen',@sbp.D2Standard); default_arg('gama', 1.4); default_arg('do_upwind', false); gamma = gama; @@ -35,21 +35,22 @@ [x, h] = util.get_grid(xlim{:},m); if do_upwind - ops = sbp.Upwind(m,h,order); - Dp = ops.derivatives.Dp; - Dm = ops.derivatives.Dm; + ops = sbp.D1Upwind(m,xlim,order); + Dp = ops.Dp; + Dm = ops.Dm; D1 = (Dp + Dm)/2; Ddisp = (Dp - Dm)/2; else - ops = opsGen(m,h,order); - D1 = sparse(ops.derivatives.D1); + ops = opsGen(m,xlim,order); + printExpr('issparse(ops.D1)'); + D1 = ops.D1; end - H = sparse(ops.norms.H); - Hi = sparse(ops.norms.HI); - e_l = sparse(ops.boundary.e_1); - e_r = sparse(ops.boundary.e_m); + H = sparse(ops.H); + Hi = sparse(ops.HI); + e_l = sparse(ops.e_l); + e_r = sparse(ops.e_r); I_x = speye(m); I_3 = speye(3);