changeset 112:b7f40a0c6476

Added ability to see every timestep.
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 09 Dec 2015 15:49:25 +0100
parents 0e66299592cc
children a4e1608ae980
files +noname/animate.m
diffstat 1 files changed, 21 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/+noname/animate.m	Wed Dec 09 15:48:58 2015 +0100
+++ b/+noname/animate.m	Wed Dec 09 15:49:25 2015 +0100
@@ -18,6 +18,12 @@
         do_pause = false;
     end
 
+    if isinf(time_modifier)
+        do_step = true;
+    else
+        do_step = false;
+    end
+
     makemovies = ~strcmp(dirname,'');
     if makemovies
         dirname = ['mov/' dirname];
@@ -74,7 +80,21 @@
     fprintf('System size: %d\n',size(discretization));
     % waitforbuttonpress
 
-    anim.animate(@G, Tstart, Tend, time_modifier);
+
+    if ~do_step
+        anim.animate(@G, Tstart, Tend, time_modifier);
+    else
+        while true
+            ts.step();
+            sol = discretization.getTimeSnapshot(ts);
+            update(sol);
+            drawnow
+
+            if do_pause
+                pause
+            end
+        end
+    end
 
     % str = util.replace_string(str,'');