Mercurial > repos > public > sbplib
diff +rv/+time/rungekuttaRV.m @ 1152:010bb2677230 feature/rv
Clean up in +rv/+time. Make the time stepping more efficient by not storing unnessecary properties in the RK-RV time steppers
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Tue, 05 Mar 2019 10:53:34 +0100 |
parents | 2d7c1333bd6c |
children |
line wrap: on
line diff
--- a/+rv/+time/rungekuttaRV.m Mon Feb 18 09:00:00 2019 +0100 +++ b/+rv/+time/rungekuttaRV.m Tue Mar 05 10:53:34 2019 +0100 @@ -7,7 +7,7 @@ % Move one stage outside to avoid branching for updating the % residual inside the loop. k = zeros(length(v), coeffs.s); - k(:,1) = F(v,t,RV.evaluate(v,DvDt(v))); + k(:,1) = F(v,t,RV.evaluateViscosity(v,DvDt(v))); % Compute the intermediate stages k for i = 2:coeffs.s @@ -15,8 +15,7 @@ for j = 1:i-1 u = u + dt*coeffs.a(i,j)*k(:,j); end - %RV.update(0.5*(u+v),(u-v)/(coeffs.c(i)*dt)); % Crank-Nicholson for time discretization - k(:,i) = F(u,t+coeffs.c(i)*dt, RV.evaluate(u,DvDt(u))); + k(:,i) = F(u,t+coeffs.c(i)*dt, RV.evaluateViscosity(u,DvDt(u))); end % Compute the updated solution as a linear combination @@ -25,6 +24,5 @@ for i = 1:coeffs.s u = u + dt*coeffs.b(i)*k(:,i); end - %RV.update(0.5*(u+v),(u-v)/dt); % Crank-Nicholson for time discretization v = u; end