rbmatlab  1.13.10
 All Classes Namespaces Files Functions Variables Groups Pages
gen_nonlin_symmetry_mpg.m
Go to the documentation of this file.
1 % small script generating a movie of simulation sequences
2 %
3 % the problem with avi capturing is, that powerpoint cannot
4 % properly play these clips. So using package mpgwrite here.
5 % the first frame is chosen as the snapshot at end time in order
6 % to have a useful preview. As the initial dist will be identical
7 % for different parameters
8 
9 % Bernard Haasdonk 25.5.2008
10 
11 load nonlin_symmetry_detailed
12 params.no_lines = 1;
13 
14 movie = 2
15 text_sequence = {''};
16 
17 switch movie
18  case 1
19  outputfn = 'rb_nonlin_symmetry1.mpg';
20  mu_sequence = {[1]};
21  case 2
22  outputfn = 'rb_nonlin_symmetry2.mpg';
23  mu_sequence = {[2]};
24 % case 3
25 % outputfn = 'rb_burgers3.mpg';
26 % mu_sequence = {[-1,0]};
27 % case 4
28 % outputfn = 'rb_burgers4.mpg';
29 % mu_sequence = {[-1,-pi/4]};
30  otherwise
31  error('movie number not specified');
32 end;
33 %outputfn = 'rb_burgers1.avi';
34 %mu_sequence = {[1,0],[1,-pi/8],[1,-pi/4]};
35 %text_sequence = {'\phi = 0', '\phi = -\pi/8','\phi = -\pi/4'};
36 
37 offline_data = rb_offline_prep(detailed_data,params);
38 params.N = size(detailed_data.RB,2);
39 params.M = size(detailed_data.QM{1},2);
40 %params.M = 45;
41 %params.vrot_angle = 0;
42 %params.c_init_lo = 1;
43 params.clim = [0 1];
44 %quality = 75;
45 %compression = 'None';
46 %compression = 'Cinepak';
47 %compression = 'Indeo5';
48 %compression = 'IV50';
49 %compression = 'Indeo5'; % Indeo3, Cinepak, MSVC, RLE, None
50 %compression='TSCC';
51 fps = 15;
52 %mov = avifile(outputfn,'Fps',fps,'Quality',quality,...
53 % 'Compression',compression);
54 
55 %if movie == 5
56 % params.clim = [0,1];
57 % fps = 25;
58 %end;
59 params.show_colorbar = 1
60 
61 % cinit, vrot
62 
63 f = [];
64 
65 for i = 1:length(mu_sequence)
66 %for i = 1:25
67 
68  params = params.set_mu(mu_sequence{i},params);
69  reduced_data = rb_online_prep(offline_data,params);
70  simulation_data = rb_simulation(reduced_data,params);
71  Uappr = rb_reconstruction(detailed_data,simulation_data);
72 
73  cla;
74  plot_element_data(detailed_data.grid,Uappr(:,end),params);
75  text(0.1,0.9,text_sequence{i},'FontSize',30,'Color',[0,0,1])
76  % F = getframe(gcf);
77  F(1) = getframe(gca);
78 
79  for j = 1:size(Uappr,2)
80 % for j = 1:25
81  cla;
82  plot_element_data(detailed_data.grid,Uappr(:,j),params);
83  text(0.1,0.9,text_sequence{i},'FontSize',30,'Color',[0,0,1])
84 % F = getframe(gcf);
85  F(j+1) = getframe(gca);
86 % F = getframe(gca);
87 % pause(0.01);
88 % mov = addframe(mov,F);
89  end;
90 end;
91 
92 C = colormap;
93 %mov = close(mov);
94 mpgwrite(F,C,outputfn,...
95  [1, 0, 1, 0, 10, 1, 1, 1]);
96 %keyboard;
97 disp('finished!');
98 
99 %| \docupdate