Mercurial > repos > public > sbplib
comparison +noname/animate.m @ 57:9a647dcccbdd
Added pausing option to noname.animate. Added characteristic bc to Euler1d.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 12 Nov 2015 17:31:33 -0800 |
parents | cca09cc5121d |
children | f87003695677 |
comparison
equal
deleted
inserted
replaced
56:ce90abc350c5 | 57:9a647dcccbdd |
---|---|
11 end | 11 end |
12 | 12 |
13 default_arg('Tend',Inf); | 13 default_arg('Tend',Inf); |
14 default_arg('time_modifier',1); | 14 default_arg('time_modifier',1); |
15 default_arg('time_method',[]); | 15 default_arg('time_method',[]); |
16 | |
17 if time_modifier < 0 | |
18 do_pause = true; | |
19 time_modifier = -time_modifier; | |
20 else | |
21 do_pause = false; | |
22 end | |
16 | 23 |
17 | 24 |
18 fprintf('Animating: %s\n',discretization.name); | 25 fprintf('Animating: %s\n',discretization.name); |
19 fprintf('Tend : %.2f\n',Tend); | 26 fprintf('Tend : %.2f\n',Tend); |
20 fprintf('order : %d\n',discretization.order); | 27 fprintf('order : %d\n',discretization.order); |
42 % waitforbuttonpress | 49 % waitforbuttonpress |
43 if makemovies | 50 if makemovies |
44 save_frame(); | 51 save_frame(); |
45 end | 52 end |
46 % pause(0.1) | 53 % pause(0.1) |
47 str = util.replace_string(str,'t = %.2f',ts.t); | 54 str = util.replace_string(str,'t = %.5f',ts.t); |
55 | |
56 if do_pause | |
57 pause | |
58 end | |
48 | 59 |
49 end | 60 end |
50 sol = discretization.getTimeSnapshot(0); | 61 sol = discretization.getTimeSnapshot(0); |
51 update(sol); | 62 update(sol); |
52 | 63 |