rbmatlab  1.13.10
 All Classes Namespaces Files Functions Variables Groups Pages
gen_burgers_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 
6 % Bernard Haasdonk 25.5.2008
7 
8 load burgers_fv_detailed_data
9 
10 movie = 4
11 text_sequence = {''};
12 
13 switch movie
14  case 1
15  outputfn = 'rb_burgers1.mpg';
16  mu_sequence = {[1,0]};
17  case 2
18  outputfn = 'rb_burgers2.mpg';
19  mu_sequence = {[1,-pi/4]};
20  case 3
21  outputfn = 'rb_burgers3.mpg';
22  mu_sequence = {[-1,0]};
23  case 4
24  outputfn = 'rb_burgers4.mpg';
25  mu_sequence = {[-1,-pi/4]};
26  otherwise
27  error('movie number not specified');
28 end;
29 %outputfn = 'rb_burgers1.avi';
30 %mu_sequence = {[1,0],[1,-pi/8],[1,-pi/4]};
31 %text_sequence = {'\phi = 0', '\phi = -\pi/8','\phi = -\pi/4'};
32 
33 offline_data = rb_offline_prep(detailed_data,params);
34 params.N = size(detailed_data.RB,2);
35 params.M = size(detailed_data.QM{1},2);
36 %params.M = 45;
37 %params.vrot_angle = 0;
38 %params.c_init_lo = 1;
39 params.clim = [-1 1];
40 %quality = 75;
41 %compression = 'None';
42 %compression = 'Cinepak';
43 %compression = 'Indeo5';
44 %compression = 'IV50';
45 %compression = 'Indeo5'; % Indeo3, Cinepak, MSVC, RLE, None
46 %compression='TSCC';
47 fps = 15;
48 %mov = avifile(outputfn,'Fps',fps,'Quality',quality,...
49 % 'Compression',compression);
50 
51 %if movie == 5
52 % params.clim = [0,1];
53 % fps = 25;
54 %end;
55 params.show_colorbar = 1
56 
57 % cinit, vrot
58 
59 f = [];
60 
61 for i = 1:length(mu_sequence)
62 %for i = 1:25
63 
64  params = params.set_mu(mu_sequence{i},params);
65  reduced_data = rb_online_prep(offline_data,params);
66  simulation_data = rb_simulation(reduced_data,params);
67  Uappr = rb_reconstruction(detailed_data,simulation_data);
68 
69  for j = 1:size(Uappr,2)
70 % for j = 1:25
71  cla;
72  plot_element_data(detailed_data.grid,Uappr(:,j),params);
73  text(0.1,0.9,text_sequence{i},'FontSize',30,'Color',[0,0,1])
74 % F = getframe(gcf);
75  F(j) = getframe(gca);
76 % F = getframe(gca);
77 % pause(0.01);
78 % mov = addframe(mov,F);
79  end;
80 end;
81 
82 C = colormap;
83 %mov = close(mov);
84 mpgwrite(F,C,outputfn,...
85  [1, 0, 1, 0, 10, 1, 1, 1]);
86 
87 
88 %| \docupdate