Mercurial > repos > public > sbplib
diff +noname/animate.m @ 112:b7f40a0c6476
Added ability to see every timestep.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 09 Dec 2015 15:49:25 +0100 |
parents | 14bf01b7a068 |
children | 1035c190e8de |
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,'');