comparison +scheme/Burgers1D.m @ 844:9e4e0576ca0f feature/burgers1d

Only compute dissipation operator when requested
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Tue, 18 Sep 2018 10:32:00 +0200
parents f1f0bf087e1c
children 1e057b0f2fed
comparison
equal deleted inserted replaced
843:f63b99f0729d 844:9e4e0576ca0f
27 switch operator_type 27 switch operator_type
28 case 'narrow' 28 case 'narrow'
29 ops = sbp.D4Variable(m, lim, order); 29 ops = sbp.D4Variable(m, lim, order);
30 D1 = ops.D1; 30 D1 = ops.D1;
31 D2 = ops.D2; 31 D2 = ops.D2;
32 DissipationOp = -1*sbp.dissipationOperator(m, order, ops.HI); 32 if (strcmp(dissipation,'on'))
33 DissipationOp = -1*sbp.dissipationOperator(m, order, ops.HI);
34 end
33 d_l = ops.d1_l'; 35 d_l = ops.d1_l';
34 d_r = ops.d1_r'; 36 d_r = ops.d1_r';
35 case 'upwind' 37 case 'upwind'
36 ops = sbp.D1Upwind(m, lim, order); 38 ops = sbp.D1Upwind(m, lim, order);
37 D1 = (ops.Dp + ops.Dm)/2; 39 D1 = (ops.Dp + ops.Dm)/2;
38 %D2eps = @(eps) ops.Dp*diag(eps)*ops.Dm; 40 %D2eps = @(eps) ops.Dp*diag(eps)*ops.Dm;
39 %D2eps = @(eps) ops.Dm*diag(eps)*ops.Dp; 41 %D2eps = @(eps) ops.Dm*diag(eps)*ops.Dp;
40 D2 = @(eps) (ops.Dp*diag(eps)*ops.Dm + ops.Dm*diag(eps)*ops.Dp)/2; 42 D2 = @(eps) (ops.Dp*diag(eps)*ops.Dm + ops.Dm*diag(eps)*ops.Dp)/2;
41 DissipationOp = (ops.Dp-ops.Dm)/2; 43 if (strcmp(dissipation,'on'))
44 DissipationOp = (ops.Dp-ops.Dm)/2;
45 end
42 d_l = D1; 46 d_l = D1;
43 d_r = D1; 47 d_r = D1;
44 otherwise 48 otherwise
45 error('Other operator types not yet supported', operator_type); 49 error('Other operator types not yet supported', operator_type);
46 end 50 end