Mercurial > repos > public > sbplib
comparison +time/+rk/rungekuttaRV.m @ 847:1c6f1595bb94 feature/burgers1d
Clean up in RK time stepper schemes
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Thu, 20 Sep 2018 18:36:45 +0200 |
parents | c6fcee3fcf1b |
children |
comparison
equal
deleted
inserted
replaced
846:c6fcee3fcf1b | 847:1c6f1595bb94 |
---|---|
2 % starting from v_0 and where the function F(v,t,RV) gives the | 2 % starting from v_0 and where the function F(v,t,RV) gives the |
3 % time derivatives. coeffs is a struct holding the RK coefficients | 3 % time derivatives. coeffs is a struct holding the RK coefficients |
4 % for the specific method. RV is the residual viscosity which is updated | 4 % for the specific method. RV is the residual viscosity which is updated |
5 % in between the stages and after the updated solution is computed. | 5 % in between the stages and after the updated solution is computed. |
6 function v = rungekuttaRV(v, t , dt, F, RV, coeffs) | 6 function v = rungekuttaRV(v, t , dt, F, RV, coeffs) |
7 | |
8 % Move one stage outside to avoid branching for updating the | 7 % Move one stage outside to avoid branching for updating the |
9 % residual inside the loop. | 8 % residual inside the loop. |
10 k = zeros(length(v), coeffs.s); | 9 k = zeros(length(v), coeffs.s); |
11 k(:,1) = F(v,t,RV.getViscosity()); | 10 k(:,1) = F(v,t,RV.getViscosity()); |
12 | 11 |