diff +time/Rungekutta4.m @ 816:b5e5b195da1e feature/timesteppers

Add getState to timesteppers, returning the relevant state of the timestepper - Add getState which returns the 'state' of the specialized timestepper.
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Mon, 10 Sep 2018 16:19:16 +0200
parents ef5c9870f386
children 50d5a3843099
line wrap: on
line diff
--- a/+time/Rungekutta4.m	Thu Sep 07 09:54:21 2017 +0200
+++ b/+time/Rungekutta4.m	Mon Sep 10 16:19:16 2018 +0200
@@ -38,6 +38,10 @@
             t = obj.t;
         end
 
+        function state = getState(obj)
+            state = struct('v', obj.v, 't', obj.t, 'k', obj.k);
+        end
+
         function obj = step(obj)
             obj.v = time.rk4.rungekutta_4(obj.v, obj.t, obj.k, obj.F);
             obj.t = obj.t + obj.k;