Mercurial > repos > public > sbplib
view +time/Rungekutta4RV.m @ 845:1e057b0f2fed feature/burgers1d
Add RK6 with residual viscosity update and reduce computational effort of spatial scheme
- Add RK6 with residual updates
- Change the D2 operator for upwind schemes to one less computationally expensive.
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Wed, 19 Sep 2018 16:32:05 +0200 |
parents | 008496ca38f3 |
children |
line wrap: on
line source
classdef Rungekutta4RV < time.Timestepper properties F k t v m n % Additional members used for the RV update RV end methods function obj = Rungekutta4RV(F, k, t0, v0, RV) obj.F = F; obj.k = k; obj.t = t0; obj.v = v0; obj.m = length(v0); obj.n = 0; obj.RV = RV; end function [v, t] = getV(obj) v = obj.v; t = obj.t; end function state = getState(obj) [residual, u_t, f_x] = obj.RV.getResidual(); state = struct('v', obj.v, 'residual', residual, 'u_t', u_t, 'f_x', f_x, 'viscosity', obj.RV.getViscosity(), 't', obj.t); end function obj = step(obj) obj.v = time.rk4.rungekutta_6RV(obj.v, obj.t, obj.k, obj.F, obj.RV); obj.t = obj.t + obj.k; obj.n = obj.n + 1; end end methods (Static) function k = getTimeStep(lambda) k = rk4.get_rk4_time_step(lambda); end end end