Mercurial > repos > public > sbplib
changeset 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 | f63b99f0729d |
children | 1e057b0f2fed |
files | +scheme/Burgers1D.m |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/+scheme/Burgers1D.m Mon Sep 17 11:08:23 2018 +0200 +++ b/+scheme/Burgers1D.m Tue Sep 18 10:32:00 2018 +0200 @@ -29,7 +29,9 @@ ops = sbp.D4Variable(m, lim, order); D1 = ops.D1; D2 = ops.D2; - DissipationOp = -1*sbp.dissipationOperator(m, order, ops.HI); + if (strcmp(dissipation,'on')) + DissipationOp = -1*sbp.dissipationOperator(m, order, ops.HI); + end d_l = ops.d1_l'; d_r = ops.d1_r'; case 'upwind' @@ -38,7 +40,9 @@ %D2eps = @(eps) ops.Dp*diag(eps)*ops.Dm; %D2eps = @(eps) ops.Dm*diag(eps)*ops.Dp; D2 = @(eps) (ops.Dp*diag(eps)*ops.Dm + ops.Dm*diag(eps)*ops.Dp)/2; - DissipationOp = (ops.Dp-ops.Dm)/2; + if (strcmp(dissipation,'on')) + DissipationOp = (ops.Dp-ops.Dm)/2; + end d_l = D1; d_r = D1; otherwise