rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
comsol_lin_stat_gen_reduced_data.m
1 function reduced_data = comsol_lin_stat_gen_reduced_data(model,detailed_data)
2 %function reduced_data = comsol_lin_stat_gen_reduced_data(model,detailed_data)
3 %
4 % This function uses lin_stat_gen_reduced_data to generate the reduced data
5 % and then adds some comsol_specific fields to the reduced _data, the
6 % indices-vectors
7 % In order for the error estimators to work properly, it is needed, to cut
8 % off the comsol_DBC_data and only pass the eliminated data to
9 % lin_stat_gen_reduced_data! That is the main purpose of this function!
10 %
11 %
12 % Oliver Zeeb, 19.09.2012
13 
14 
15 
16 %Preparation: Cut the data in the comsol_matrices that belong to DBC-Dofs
17 % --> needed for correct error estimators!
18 if size(detailed_data.RB,1) == detailed_data.grid_info.ndofs %full vectors? --> eliminate DBC_data!
19  detailed_data.RB=detailed_data.RB(detailed_data.ind_vectors.com_DOF_ind,:);% DBC eliminated from reduced Basis!
20  in_prod_mat_string = char(model.get_inner_product_matrix);
21  eval(['model.get_inner_product_matrix =',in_prod_mat_string,'_eliminated;']);
22  model.get_dofs_from_sim_data = @(sim_data) sim_data.U(sim_data.ind_vectors.com_DOF_ind);
23  model.comsol_get_eliminated_data = 1;
24 end
25 
26 %use rbmatlab function to compute reduced_data
27 reduced_data = lin_stat_gen_reduced_data(model,detailed_data);
28 
29 reduced_data.ind_vectors = detailed_data.ind_vectors;