diff +scheme/AdvectionRV1D.m @ 1012:1e437c9e5132 feature/advectionRV

Create residual viscosity package +rv and generalize the ResidualViscosity class - Generalize residual viscosity, by passing user-defined flux and calculating the time derivative outside of the update. - Create separate RungekuttaRV specifically using interior RV updates - Separate the artifical dissipation operator from the scheme AdvectionRV1D so that the same scheme can be reused for creating the diff op used by the ResidualViscosity class
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Wed, 05 Dec 2018 13:44:10 +0100
parents f753bada1a46
children
line wrap: on
line diff
--- a/+scheme/AdvectionRV1D.m	Thu Nov 15 13:49:11 2018 -0800
+++ b/+scheme/AdvectionRV1D.m	Wed Dec 05 13:44:10 2018 +0100
@@ -8,6 +8,8 @@
         Hi % Norm inverse
         e_l
         e_r
+
+        D2_visc % Artificial viscosity operator
     end
 
     methods
@@ -19,13 +21,14 @@
                     ops = sbp.D1Upwind(m, lim, order);
                     D1 = (ops.Dp + ops.Dm)/2;
                     B = ops.e_r*ops.e_r' - ops.e_l*ops.e_l';
-                    D2 = @(viscosity) ops.Dm*spdiag(viscosity)*ops.Dp-ops.HI*(B*spdiag(viscosity)*ops.Dp);
+                    obj.D2_visc = @(viscosity) ops.Dm*spdiag(viscosity)*ops.Dp-ops.HI*(B*spdiag(viscosity)*ops.Dp);
+                    % max(abs()) or just abs()?
                     DissipationOp = spdiag(abs(waveSpeed))*(ops.Dp-ops.Dm)/2;
                 otherwise
                     error('Other operator types not yet supported', operator_type);
             end
-            % max(abs()) or just abs()?
-            obj.D = @(viscosity) (-D1 + D2(viscosity) + DissipationOp);
+            
+            obj.D = -D1 + DissipationOp;
             
             obj.grid = grid;
             obj.order = order;