rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
demo_rb_gui.m
Go to the documentation of this file.
1 function demo_rb_gui(varargin)
2 % function demo_rb_gui(model,detailed_data,[reduced_data],plot_params[,title, callbackfigure, cbhandle])
3 % reduced basis demo with sliders
4 %
5 % Function synposis:
6 %
7 % @code
8 % function demo_rb_gui(model,detailed_data,[reduced_data],plot_params[,title]) @endcode
9 %
10 % Creates a gui for RB-demo on a prescribed grid specified in 'detailed_data'.
11 % if a title is specified, this is set as the figure name. If further
12 % parameters are set, the call is assumed to stem from a callback-function if
13 % detailed_data, offline_data and params are empty, a default basis is chosen
14 % from matlab/datafiles/ if only detailed_data and params is specified, a
15 % offline_precomputation phase is performed.
16 
17 % Bernard Haasdonk 20.7.2006
18 
19 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
20 % open figure
21 if nargin < 6 % no callback,open new figure
22  f = figure;
23  ud = [];
24  list = varargin;
25  if nargin==0
26  % disp(['no arguments passed, so loading dummy reduced basis +' ...
27  % ' parameters']);
28  % disp('the basis is constructed from the upper range-parameters');
29  % disp('so this is approximated particularly well, other parameters bad.');
30  % fn = fullfile(rbmatlabhome,'tmpdata','dummy_reduced_basis.mat');
31  % tmp = load(fn);
32  % tmp.params.init_values_algorithm = 'init_values_cog';
33  % tmp.params.operators_algorithm = 'operators_conv_diff';
34  % tmp.params.lxf_lambda = 1.0194e+003;
35  % tmp.params.data_const_in_time = 1;
36  % tmp.params.T = 0.05;
37  % tmp.params.nt = 20;
38  % list{4}= ['RB suited for upper bounds' ...
39  % ' of parameters'];
40  % fn = fullfile(rbmatlabhome,'tmpdata','dummy_offline_data_const.mat');
41  % tmp = load(fn);
42  % list{2} = tmp.offline_data;
43  disp(['no arguments passed, so loading default reduced basis +' ...
44  ' parameters']);
45  disp('the basis contains vectors generated by PCAfixspace ');
46  disp('on an equidistant 5x5x5 grid in the mu-range');
47  % disp('guaranteeing the error estimator < 1e-7 on this grid ');
48  fn = fullfile(rbmatlabhome,'demos','datafiles',...
49  'test_rb_lin_evol_data');
50  % 'demo_lin_evol_detailed_data.mat');
51  % 'RB_extension_PCA_fixspace_extended.mat');
52  tmp = load(fn);
53  list{2} = tmp.detailed_data;
54  %tmp.model.axis_tight = 1;
55  %tmp.model.descr = [];
56  %tmp.model.get_rb_size = @get_rb_size_default;
57  %tmp.model.N = get_rb_size(tmp.model,tmp.detailed_data);
58  %%% the following will update the model, if fields have been missing:
59  % update_model_and_save_to_file = 1;
60  update_model_and_save_to_file = 0;
61  if update_model_and_save_to_file
62  model = lin_evol_model_default;
63  model = structcpy(model, tmp.model);
64  detailed_data = tmp.detailed_data;
65  save(fn,'model','detailed_data');
66  disp('transformed precomputed datafile successful');
67  tmp.model = model;
68  clear('detailed_data','model')
69  end;
70  if ~isfield(tmp.model,'descr')
71  tmp.model.descr = [];
72  end;
73  tmp.model.get_rb_size = @get_rb_size_default;
74 % keyboard;
75  list{1} = tmp.model;
76  list{5}= ['RB of ',num2str(size(tmp.detailed_data.RB,2)), ...
77  ' vectors obtained by PCAfixspace'];
78  end;
79  % keyboard;
80  if nargin <3
81  list{3} = [];
82  end;
83  if nargin <4
84  list{4} = [];
85  end;
86  if nargin <5
87  list{5} = 'RB Demo GUI';
88  end;
89 
90  ud.model = list{1};
91  if ~isfield(ud.model,'descr') && ~isa(ud.model, 'IReducedModel')
92  ud.model.descr = [];
93  end;
94  ud.descr = ud.model.descr;
95  if isempty(ud.descr) % copy model to descr for models with empty descr
96  ud.descr = ud.model;
97  end;
98  if isstruct(list{2}) || isa(list{2}, 'IDetailedData')
99  ud.detailed_data = list{2};
100  end;
101 
102  if ~isfield(ud.model,'crb_enabled')
103  ud.model.crb_enabled = 0;
104  end;
105 
106  if ud.model.crb_enabled
107  ud.model.set_Mratio(ud.detailed_data, 0.5);
108  end
109 
110  if ~isfield(ud.descr,'is_stationary')
111  ud.descr.is_stationary = 0; % for evolution problems
112  end
113 
114  ud.plot_params = list{4};
115  if isempty(ud.plot_params)
116  % copy some fields from model
117  if isfield(ud.descr,'yscale_uicontrols')
118  ud.plot_params.yscale_uicontrols = ud.descr.yscale_uicontrols;
119  end;
120  if isfield(ud.descr,'xscale_gui');
121  ud.plot_params.xscale_gui = ud.descr.xscale_gui;
122  end;
123  if isfield(ud.descr,'clim');
124  ud.plot_params.clim = ud.descr.clim;
125  end;
126  if isfield(ud.descr,'show_colorbar');
127  ud.plot_params.show_colorbar = ud.descr.show_colorbar;
128  end;
129  if isfield(ud.descr,'geometry_transformation');
130  ud.plot_params.geometry_transformation = ud.descr.geometry_transformation;
131  end;
132  if isfield(ud.model,'axis_tight')
133  ud.plot_params.axis_tight = ud.model.axis_tight;
134  end;
135  if isfield(ud.model,'axis_equal')
136  ud.plot_params.axis_tight = ud.model.axis_equal;
137  end;
138  if isfield(ud.model,'yscale_uicontrols')
139  ud.plot_params.yscale_uicontrols = ud.model.yscale_uicontrols;
140  end;
141  if isfield(ud.model,'xscale_gui');
142  ud.plot_params.xscale_gui = ud.model.xscale_gui;
143  end;
144  if isfield(ud.model,'clim');
145  ud.plot_params.clim = ud.descr.clim;
146  end;
147  if isfield(ud.model,'show_colorbar');
148  ud.plot_params.show_colorbar = ud.model.show_colorbar;
149  end;
150  if isfield(ud.model,'geometry_transformation');
151  ud.plot_params.geometry_transformation = ud.model.geometry_transformation;
152  end;
153  end;
154 
155 
156 % ud.grid = ud.detailed_data.grid;
157  if isempty(list{3})
158  disp('Preparing offline-quantities...')
159  % keyboard;
160  ud.reduced_data = gen_reduced_data(ud.model, ud.detailed_data);
161  else
162  ud.reduced_data = list{3};
163  end;
164  if length(list)>4;
165  set(f,'Name',list{5});
166  end;
167  ud.timestep = 0;
168  set(f,'Userdata',ud);
169  % disp(['set userdata to fig ',num2str(f)]);
170  % else
171  % disp(['userdata is not set to fig ',num2str(f)]);
172  %end;
173 
174 % if ~isfield(ud.model, 'geometry_transformation')
175 % ud.model.geometry_transformation = 'none';
176 % end
177 
178  di = 0.05; % relative distance between gui_objects
179  textwidth= 0.15;
180  textheight = 0.05;
181  yscale_uicontrols = 1.0;
182  xscale_gui = 1.0;
183  hide_N_ruler = 0;
184 
185  if isfield(ud.plot_params,'yscale_uicontrols')
186  yscale_uicontrols = ud.plot_params.yscale_uicontrols;
187  end;
188  if isfield(ud.plot_params,'xscale_gui')
189  xscale_gui = ud.plot_params.xscale_gui;
190  end;
191 
192  if isfield(ud.plot_params,'hide_N_ruler')
193  hide_N_ruler = 1;
194  end;
195 
196  % xscale gui
197  p = get(gcf,'Position');
198  p(3) = p(3) * xscale_gui;
199  set(gcf,'Position',p);
200 
201  % create one txt and slider for each mu_name
202  for i=1:length(ud.model.mu_names)
203  % set mu-param-values to minimum of ranges as the position of a
204  % slider does not seem to be adjustable
205  tmprange = cell2mat(ud.model.mu_ranges);
206  ud.model = set_mu(ud.model,tmprange(1:2:end));
207  mu = get_mu(ud.model);
208  val = mu(i);
209  %val = ud.model.(ud.model.mu_names{i});
210  ra = ud.model.mu_ranges{i};
211  norm_val = (val-ra(1))/(ra(2)-ra(1));
212  txt(i) = uicontrol(f,'Style','text','Units','normalized',...
213  'Position',...
214  [di,(i*di+(i-1)*textheight)*yscale_uicontrols,...
215  textwidth,textheight*yscale_uicontrols],...
216  'String',[ud.model.mu_names{i},'=',num2str(val)],...
217  'Tag',['text_',ud.model.mu_names{i}]);
218  slider(i) = uicontrol(f,'Style','slider','Units','normalized',...
219  'Position',...
220  [ 2*di+textwidth, ...
221  (i*di+(i-1)*textheight)*yscale_uicontrols, ...
222  1-3*di-textwidth,...
223  textheight*yscale_uicontrols],...
224  'Tag',['slider_',ud.model.mu_names{i}],...
225  'Min',0, ...
226  'Max',1, ...
227  'value',norm_val, ...
228  'Callback','demo_rb_gui([],[],[],[],[], gcbf,gcbo)');
229  % 'Min',ud.model.mu_ranges{i}(1), ...
230 % 'Max',ud.model.mu_ranges{i}(2), ...
231 
232  end;
233  set(f,'Userdata',ud);
234 
235  if ~hide_N_ruler
236  % N = number of RB slider
237  i = length(ud.model.mu_names)+1;
238  if isstruct(ud.model) && ~isfield(ud.model,'N')
239  ud.model.N = get_rb_size(ud.model,ud.detailed_data);
240  end;
241  Nmax = get_rb_size(ud.model, ud.detailed_data);
242  if ud.model.N == 0
243  ud.model.N = 1;
244  end
245  set(f,'Userdata',ud);
246  txt(i) = uicontrol(f,'Style','text','Units','normalized',...
247  'Position', ...
248  [di,(i*di+(i-1)*textheight)*yscale_uicontrols,...
249  textwidth,textheight*yscale_uicontrols],...
250  'String',['RB-size N = ',num2str(ud.model.N)],...
251  'Tag','text_N');
252  N = get_rb_size(ud.model,ud.detailed_data);
253  if N>1
254  slider_increment = [1/((get_rb_size(ud.model, ...
255  ud.detailed_data))-1), ...
256  0.1];
257  else
258  slider_increment = [0,0];
259  end;
260  slider(i) = uicontrol(f,'Style','slider','Units','normalized',...
261  'Position',...
262  [2*di+textwidth, ...
263  (i*di + (i-1)*textheight)*yscale_uicontrols, ...
264  1-3*di-textwidth,textheight*yscale_uicontrols],...
265  'Tag','slider_N',...
266  'min',1,'max', ...
267  Nmax,...
268  'value',ud.model.N, ...
269  'Callback','demo_rb_gui([],[],[],[],[],gcbf,gcbo)',...
270  'sliderstep',...
271  slider_increment);
272  end; % of hide_N_slider
273  % M = number of CRB slider
274 % if isequal(ud.model.rb_problem_type,'nonlin_evol')...
275 % || isequal(ud.model.rb_problem_type,'richards')
276  if ud.model.crb_enabled
277  i = length(ud.model.mu_names)+2;
278  txt(i) = uicontrol(f,'Style','text','Units','normalized',...
279  'Position', ...
280  [di,(i*di+(i-1)*textheight)*yscale_uicontrols,...
281  textwidth,textheight*yscale_uicontrols],...
282  'String',['CRB-size M = ',num2str(get_Mratio(ud.model,ud.detailed_data))],...
283  'Tag','text_M');
284  slider(i) = uicontrol(f,'Style','slider','Units','normalized',...
285  'Position',...
286  [2*di+textwidth, ...
287  (i*di + (i-1)*textheight)*yscale_uicontrols, ...
288  1-3*di-textwidth,textheight*yscale_uicontrols],...
289  'Tag','slider_M',...
290  'min',0,'max',1,'value',...
291  get_Mratio(ud.model,ud.detailed_data), ...
292  'Callback','demo_rb_gui([],[],[],[],[],gcbf,gcbo)',...
293  'sliderstep',[1/100,0.1]);
294  end; % if nonlin-evol
295 
296  % time slider
297  if ~ud.descr.is_stationary
298  i = i+1; %length(ud.params.mu_names)+2; % or +3 if M-slider available!
299  txt(i) = uicontrol(f,'Style','text','Units','normalized',...
300  'Position', ...
301  [di,(i*di+(i-1)*textheight)*yscale_uicontrols,...
302  textwidth,textheight*yscale_uicontrols],...
303  'String','timestep 0','Tag','text_time');
304  slider(i) = uicontrol(f,'Style','slider','Units','normalized',...
305  'Position',...
306  [2*di+textwidth, ...
307  (i*di + (i-1)*textheight)*yscale_uicontrols, ...
308  1-3*di-textwidth,textheight*yscale_uicontrols],...
309  'Tag','slider_time',...
310  'min',0,'max',ud.descr.nt,'value',0, ...
311  'Callback','demo_rb_gui([],[],[],[],[],gcbf,gcbo)',...
312  'sliderstep',[1/ud.descr.nt,0.1]);
313  end;
314  % graphics axes
315  ax = axes('Units','normalized',...
316  'Position',[di,((i+2)*di+i*textheight)*yscale_uicontrols,...
317  1-2*di,1-((i+3)*di + i*textheight)*yscale_uicontrols],...
318  'Tag','axes1');
319 
320  % cb = colorbar;
321 
322 % sl = findobj(f,'Tag','slider1');
323  %set(sl,'min',0);
324  %set(sl,'max',ud.params.nt);
325  %set(sl,'sliderstep',[1/ud.params.nt,1]);
326 % set(sl,'min',1);
327 % if size(ud.U,2)>1
328 % set(sl,'max',size(ud.U,2));
329 % set(sl,'sliderstep',[1/(size(ud.U,2)-1),1]);
330 % else
331 % set(sl,'max',size(ud.U,2)+eps);
332 % set(sl,'visible','off');
333 % % set(sl,'sliderstep',[0,0]);
334 % end;
335 % set(sl,'value',1);
336 % th = findobj(f,'Tag','text1');
337 % set(th,'String',['data slice 1']);
338  replot(f,'new');
339 % set(f,'Resize','on');
340 end; % nargin < 6
341 
342 if nargin >=6 % callback-function
343  cbf = varargin{6};
344  cbo = varargin{7};
345  ud = get(cbf,'Userdata');
346 % disp('performing callback call of plot_fv_data');
347  % set new parameters in ud.params
348  tag = get(cbo,'Tag');
349  if isequal(tag,'slider_time')
350  val = round(get(cbo,'value'));
351  set(cbo,'value',val);
352 % disp('check value of timestep!');
353 % keyboard;
354  ud.timestep = val;
355  txt = findobj(cbf,'Tag','text_time');
356  set(txt,'String',['timestep = ',num2str(val)]);
357  sourcestr = 'time';
358  elseif isequal(tag,'slider_N')
359  val = round(get(cbo,'value'));
360  set(cbo,'value',val);
361  ud.model.N = val;
362  txt = findobj(cbf,'Tag','text_N');
363  set(txt,'String',['RB-size N = ',num2str(val)]);
364  sourcestr = 'N';
365  elseif isequal(tag,'slider_M')
366  val = get(cbo,'value');
367  set(cbo,'value',val);
368  ud.model.M = ceil(val * get_ei_size(ud.detailed_data.datatree));
369  txt = findobj(cbf,'Tag','text_M');
370  set(txt,'String',['CRB-size M = ',num2str(val)]);
371  sourcestr = 'M';
372  else
373  found_cbo = 0;
374  for i=1:length(ud.model.mu_names)
375  if isequal(tag,['slider_',ud.model.mu_names{i}])
376 % keyboard;
377  found_cbo = 1;
378  val = get(cbo,'value')*...
379  (ud.model.mu_ranges{i}(2)-...
380  ud.model.mu_ranges{i}(1)) + ...
381  ud.model.mu_ranges{i}(1);
382 
383  mu = get_mu(ud.model);
384  mu(i) = val;
385  ud.model = set_mu(ud.model,mu);
386 % ud.model.(char(ud.model.mu_names(i))) = val;
387 
388  txt = findobj(cbf,'Tag',['text_',ud.model.mu_names{i}]);
389  set(txt,'String',[ud.model.mu_names{i},' = ',num2str(val)]);
390  sourcestr = 'mu';
391  end;
392  end;
393  if ~found_cbo
394  error('callback object unknown!!');
395  end;
396  end;
397  set(cbf,'Userdata',ud);
398  % th = findobj(gcbf,'Tag','text1');
399  % v = round(get(gcbo,'value'));
400  % set(gcbo,'value',v)
401  % set(th,'String',['data slice ',num2str(v)]);
402  replot(cbf,sourcestr);
403 end;
404 
405 function replot(f,tag)
406 ud = get(f,'Userdata');
407 
408 enable_error_estimator = ud.model.enable_error_estimator;
409 
410 if isfield(ud.plot_params,'hide_N_ruler')
411  hide_N_ruler = ud.plot_params.hide_N_ruler;
412 else
413  hide_N_ruler = 0;
414 end;
415 
416 % if required perform new RB simulation
417 if ismember(tag,{'new','mu','N','M'})
418  % in our problem the two bounds can be chosen 1
419 % ud.model.L_I_inv_norm_bound = 1;
420 % ud.model.L_E_norm_bound = 1;
421  % ud.model.descr.error_norm = 'l2';
422 
423  % no affine decomposition: complete mu-dependent matrices are computed
424  %ud.params.decomp_mode = 0;
425  % in case of 0, the mu must be set reasonably in advance, as the
426  % current parameters are used.
427 
428  % compute offline-data (mu-independent!)
429  %offline_data = rb_offline_preparation(ud.RB,ud.grid,ud.params);
430 
431 % mu = [];
432 % for i=1:length(ud.model.mu_names)
433 % mu = [mu, ud.model.(ud.model.mu_names{i})];
434 % end;
435  mu = get_mu(ud.model);
436  % prepare mu-independent but N-dependent online-data
437  %ud.params.N = size(ud.detailed_data.RB,2);
438  if ud.model.crb_enabled
439  disp(['performing RB simulation with N = ',num2str(ud.model.N),...
440  ', M = ', num2str(ud.model.M),...
441  ' for mu = [',num2str(mu(:)'),']']);
442  else
443  if ~hide_N_ruler
444  disp(['performing RB simulation with N = ',num2str(ud.model.N),...
445  ' for mu = [',num2str(mu(:)'),']']);
446  else
447  disp(['performing simulation for mu = [',num2str(mu(:)'),']']);
448  end;
449  end;
450  reduced_data = extract_reduced_data_subset(ud.model,ud.reduced_data);
451 
452  % perform RB-simulation
453  ud.model = set_mu(ud.model,mu);
454 
455  simulation_data = rb_simulation(ud.model,reduced_data);
456 
457  rb_sim_data = rb_reconstruction(ud.model,ud.detailed_data,simulation_data);
458  % please remove later this U explicitly, instead use ud.sim_data;
459  %U = ud.model.get_dofs_from_sim_data(rb_sim_data);
460  ud.sim_data = rb_sim_data;
461  if enable_error_estimator
462  ud.Delta = simulation_data.Delta;
463  if isfield(simulation_data,'reslog')
464  ud.reslog = simulation_data.reslog;
465  ud.eilog = simulation_data.eilog;
466  end;
467  end;
468  if isfield(ud.descr,'name_output_functional')
469  ud.s = simulation_data.s;
470  if enable_error_estimator
471  ud.Delta_s = simulation_data.Delta_s;
472  end;
473  end;
474  if ~isfield(ud.plot_params,'clim')
475  U = ud.model.get_dofs_from_sim_data(rb_sim_data);
476  ud.cmin = min(min(U));
477  ud.cmax = max(max(U));
478  if (ud.cmin==ud.cmax)
479  ud.cmin = ud.cmin-eps;
480  ud.cmax = ud.cmax+eps;
481  end;
482  clear('U');
483  else
484  ud.cmin = ud.plot_params.clim(1);
485  ud.cmax = ud.plot_params.clim(2);
486  end
487  set(f,'Userdata',ud);
488 
489 end
490 
491 % plot current slice;
492 
493 if enable_error_estimator
494  disp(['error_estimator Delta(',num2str(ud.timestep),') = ',...
495  num2str(ud.Delta(ud.timestep+1))]);
496  if isfield(ud.descr,'name_output_functional')
497  disp(['output-estimator s(U(',num2str(ud.timestep),')) = ',...
498  num2str(ud.s(ud.timestep+1))]);
499  disp(['output-error-estimator Delta_s(',num2str(ud.timestep),...
500  ') = ', num2str(ud.Delta_s(ud.timestep+1))]);
501  end;
502  if isfield(ud,'reslog')
503  disp(['error_estimator reslog(',num2str(ud.timestep),') = ',...
504  num2str(ud.reslog(ud.timestep+1))]);
505  disp(['error_estimator eilog(',num2str(ud.timestep),') = ',...
506  num2str(ud.eilog(ud.timestep+1))]);
507  end
508 end
509 fprintf('plotting...');
510 % in the following we use pcolor as builtin, as it is faster...
511 % for non-cartesian grids, the plot_element_data function must be used...
512 ax = findobj(f,'Tag','axes1');
513 cla(ax);
514 % ud.plot_params is an overlay to the default plot data of the model
515 % not only in case of "bind to model", but always:
516 %ud.plot_params = merge_model_plot_params(ud.model,ud.plot_params);
517 if isfield(ud.plot_params, 'bind_to_model') && ud.plot_params.bind_to_model
518  ud.plot_params = copy_model_descr_to_plot_params(ud.model, ...
519  ud.plot_params);
520 end
521 if ~isfield(ud.plot_params,'axis_equal')
522  ud.plot_params.axis_equal = 1;
523 end;
524 if isequal(ud.descr.gridtype,'rectgrid') ...
525  && ( ~isfield(ud.plot_params, 'geometry_transformation') || ...
526  isequal(ud.plot_params.geometry_transformation, 'none') )...
527  && ( ~isfield(ud.plot_params, 'plot_type') || ...
528  isequal(ud.plot_params.plot_type, 'none') )
529  U = ud.model.get_dofs_from_sim_data(ud.sim_data);
530  d = reshape(U(:,ud.timestep+1),...
531  ud.descr.xnumintervals,ud.descr.ynumintervals)';
532  xr = ud.descr.xrange;
533  x = xr(1):(xr(2)-xr(1))/(ud.descr.xnumintervals):xr(2);
534  yr = ud.descr.yrange;
535  y = yr(1):(yr(2)-yr(1))/(ud.descr.ynumintervals):yr(2);
536  p=pcolor(x,y,[d,zeros(size(d,1),1);zeros(1,size(d,2)+1)]);
537 else
538  if (~isfield(ud.descr, 'geometry_transformation') || ...
539  isequal(ud.descr.geometry_transformation, 'none')) && ...
540  ~isfield(ud.plot_params,'no_lines')
541  ud.plot_params.no_lines = 1;
542  end
543  % must be set externally, if wanted:
544  % ud.params.show_colorbar = 1;
545 
546  if ud.descr.is_stationary
547  % p = plot_sim_data(ud.model.detailed_model, ...
548  % reduced model itself must allow plotting:
549  p = plot_sim_data(ud.model, ...
550  ud.detailed_data, ...
551  ud.sim_data, ...
552  ud.plot_params);
553  else % evolution problem
554  if isfield(ud.plot_params,'plot_slice')
555  % timestep in range 0... nt!!
556  ud.plot_params.timestep = ud.timestep;
557  p = ud.plot_params.plot_slice(ud.descr,...
558  ud.detailed_data, ...
559  ud.sim_data, ...
560  ud.plot_params);
561  else
562  U = ud.sim_data.U;
563  p = ud.plot_params.plot(ud.detailed_data.grid, ...
564  U(:,ud.timestep+1), ...
565  ud.plot_params);
566  end
567  end
568 
569 end
570 ax = gca;
571 if ud.plot_params.axis_equal;
572  axis equal;
573 end;
574 if isfield(ud.plot_params,'axis_tight') && ud.plot_params.axis_tight
575  axis tight;
576 end;
577 if isfield(ud.plot_params,'clim')
578  set(ax,'Clim',ud.plot_params.clim);
579 else
580  set(ax,'Clim',[ud.cmin, ud.cmax]);
581 end;
582 ax2 = ax;
583 if isfield(ud.plot_params,'show_colorbar') && (ud.plot_params.show_colorbar)
584  if isfield(ud.plot_params,'colorbar_mode')
585  colorbar(ud.plot_params.colorbar_mode);
586  else
587  colorbar;
588  end;
589  ax2 = gca;
590 end;
591 if isfield(ud.plot_params,'no_lines') && (ud.plot_params.no_lines)
592  set(p,'LineStyle','None');
593 end;
594 fprintf('done\n');
595 %keyboard;
596 
597 %| \docupdate
function demo_rb_gui(varargin)
reduced basis demo with sliders
Definition: demo_rb_gui.m:17
A cartesian rectangular grid in two dimensions with axis parallel elements.
Definition: rectgrid.m:17
function s1 = structcpy(s1, s2)
copies the fields of structure s2 into structure s1. If the field to be copied does not exist in s1 y...
Definition: structcpy.m:17
function p = plot_sim_data(model, model_data, sim_data, plot_params)
function performing the plot of the simulation results as specified in model.
Definition: plot_sim_data.m:17