Mercurial > repos > public > sbplib
comparison +time/RungekuttaRV.m @ 853:cda996e64925 feature/burgers1d
Minor renaming and clean up
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Fri, 12 Oct 2018 08:41:57 +0200 |
parents | ab2e5a24ddde |
children | e0560bc4fb7d |
comparison
equal
deleted
inserted
replaced
852:fbb8be3177c8 | 853:cda996e64925 |
---|---|
27 v = obj.v; | 27 v = obj.v; |
28 t = obj.t; | 28 t = obj.t; |
29 end | 29 end |
30 | 30 |
31 function state = getState(obj) | 31 function state = getState(obj) |
32 [residual, u_t, f_x] = obj.RV.getResidual(); | 32 [residual, u_t, grad_f] = 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, 'grad_f', grad_f, 'viscosity', obj.RV.getViscosity(), 't', obj.t); |
34 end | 34 end |
35 | 35 |
36 function obj = step(obj) | 36 function obj = step(obj) |
37 F = @(v,t) obj.F(v,t,obj.RV.getViscosity()); | 37 obj.v = time.rk.rungekuttaRV(obj.v, obj.t, obj.k, obj.F, obj.RV, obj.coeffs); |
38 v_p = obj.v; | |
39 obj.v = time.rk.rungekutta(obj.v, obj.t, obj.k, F, obj.coeffs); | |
40 obj.t = obj.t + obj.k; | 38 obj.t = obj.t + obj.k; |
41 obj.n = obj.n + 1; | 39 obj.n = obj.n + 1; |
42 obj.RV.update(obj.v,v_p,obj.k); | |
43 end | 40 end |
44 end | 41 end |
45 | 42 |
46 | 43 |
47 methods (Static) | 44 methods (Static) |