rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
step2_empirical_interpolation.m
Go to the documentation of this file.
1 % script constructing a collateral reduced basis space for localized
2 % space operators.
3 %
4 % required variables that need to be set:
5 % - 'model'
6 % - 'model_data'
7 % - 'plot_params'
8 %
9 % optional variables that can be set:
10 % - 'CRBfname': filename of MAT-file where the computed 'detailed_data'
11 % structure is stored. If this variable is empty, it is
12 % set to '[model.name, infix, '_CRB_interpol.mat'], where
13 % 'infix' is set to either 'model.model_type' if existent
14 % or the empty string.
15 %
16 % generated variables:
17 % - 'detailed_data': structure containing the collateral reduced basis
18 % spaces and information on the empirical
19 % interpolation computations
20 %
21 
22 disp('constructing collateral reduced basis')
23 %load(fullfile(rbmatlabtemp, params.step0file));
24 
25 old_generation_mode = model.RB_generation_mode;
26 model.RB_generation_mode = 'none';
27 tic;
28 detailed_data = gen_detailed_data(model, model_data);
29 t = toc;
30 model.RB_generation_mode = old_generation_mode;
31 detailed_data.ei_info{1}.elapsed_time = t;
32 if isempty(CRBfname)
33  if isfield(model, 'model_type')
34  infix = model.model_type;
35  else
36  infix = '';
37  end
38  CRBfname = [model.name, infix, '_CRB_interpol.mat'];
39 end
40 save(fullfile(rbmatlabresult,CRBfname),...
41  'detailed_data','model');
42 detailed_data.RB = zeros(detailed_data.grid.nelements,1);
43 plot_detailed_data(model,detailed_data,plot_params);
44 close(gcf-2);