Mercurial > repos > public > sbplib
diff +noname/animate.m @ 20:c7efff913935
Decoupled plotting and timesteppers. Added possibility of different plot_types. Added functions for printing and plotting solution file content.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 22 Sep 2015 17:35:58 +0200 |
parents | 48b6fb693025 |
children | cca09cc5121d |
line wrap: on
line diff
--- a/+noname/animate.m Tue Sep 22 17:10:51 2015 +0200 +++ b/+noname/animate.m Tue Sep 22 17:35:58 2015 +0200 @@ -25,7 +25,7 @@ ts = discretization.getTimestepper(time_method); fprintf(' - done %fs\n', toc()) - [update, figure_handle] = discretization.setupPlot(); + [update, figure_handle] = discretization.setupPlot('animation'); if makemovies save_frame = anim.setup_fig_mov(figure_handle,dirname); @@ -37,7 +37,8 @@ % Loop function function next_t = G(next_t) ts.evolve(next_t); - update(ts); + sol = discretization.getTimeSnapshot(ts); + update(sol); % waitforbuttonpress if makemovies save_frame(); @@ -46,7 +47,8 @@ str = util.replace_string(str,'t = %.2f',ts.t); end - update(ts); + sol = discretization.getTimeSnapshot(0); + update(sol); fprintf('Using time step k = %.6f\n',ts.k) fprintf('System size: %d\n',size(discretization))