comparison +time/RungekuttaRV.m @ 851:ab2e5a24ddde feature/burgers1d

- Fix bug when constructing closure for narrow stencils - Update the residual outside of the RK time steps. At least for the inner convergence rate, updating the residual inside does not seem to be required.
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Fri, 21 Sep 2018 15:33:15 +0200
parents c6fcee3fcf1b
children cda996e64925
comparison
equal deleted inserted replaced
850:4e5e53d6336c 851:ab2e5a24ddde
32 [residual, u_t, f_x] = obj.RV.getResidual(); 32 [residual, u_t, f_x] = obj.RV.getResidual();
33 state = struct('v', obj.v, 'residual', residual, 'u_t', u_t, 'f_x', f_x, 'viscosity', obj.RV.getViscosity(), 't', obj.t); 33 state = struct('v', obj.v, 'residual', residual, 'u_t', u_t, 'f_x', f_x, 'viscosity', obj.RV.getViscosity(), 't', obj.t);
34 end 34 end
35 35
36 function obj = step(obj) 36 function obj = step(obj)
37 obj.v = time.rk.rungekuttaRV(obj.v, obj.t, obj.k, obj.F, obj.RV, obj.coeffs); 37 F = @(v,t) obj.F(v,t,obj.RV.getViscosity());
38 v_p = obj.v;
39 obj.v = time.rk.rungekutta(obj.v, obj.t, obj.k, F, obj.coeffs);
38 obj.t = obj.t + obj.k; 40 obj.t = obj.t + obj.k;
39 obj.n = obj.n + 1; 41 obj.n = obj.n + 1;
42 obj.RV.update(obj.v,v_p,obj.k);
40 end 43 end
41 end 44 end
42 45
43 46
44 methods (Static) 47 methods (Static)