rbmatlab  1.13.10
 All Classes Namespaces Files Functions Variables Groups Pages
lin_stat_reduced_data_subset.m
Go to the documentation of this file.
1 function reduced_data_subset = lin_stat_reduced_data_subset(model,reduced_data)
2 %function reduced_data_subset = lin_evol_reduced_data_subset(model,reduced_data)
3 % method which modifies reduced_data, which is the data, that will
4 % be passed to the online-simulation algorithm.
5 %
6 % Typically, this routine only does a submatrix extraction of the 'Nmax' sized
7 % offline-objects to produce 'N' sized objects for the real simulation.
8 %
9 % Required fields of model:
10 % N : number of reduced basis vectors to choose
11 %
12 % Required fields of reduced_data:
13 % N : number of reduced basis vectors in the reduced_data,
14 % must be larger than model.N!!
15 
16 % Bernard Haasdonk 27.2.2011
17 
18 reduced_data_subset = reduced_data;
19 
20 if reduced_data.N ~= model.N
21  % extract correct N-sized submatrices and subvectors from reduced_data
22  if model.N > reduced_data.N
23  error('N too large for current size of reduced basis!');
24  end;
25  N = model.N;
26  if isfield(reduced_data, 'AN_comp')
27  reduced_data_subset.AN_comp = ...
28  subblock_sequence(reduced_data.AN_comp,1:N,1:N);
29  end
30  if isfield(reduced_data, 'fN_comp')
31  reduced_data_subset.fN_comp = subblock_sequence(reduced_data.fN_comp,1:N);
32  end
33  if isfield(reduced_data, 'lN_comp')
34  reduced_data_subset.lN_comp = subblock_sequence(reduced_data.lN_comp,1:N);
35  end
36  % inner product matrix of riesz-representers of residual components:
37  reduced_data_subset.Gff = reduced_data.Gff;
38  Q_f = length(reduced_data_subset.fN_comp);
39  Q_a = length(reduced_data_subset.AN_comp);
40  reduced_data_subset.G = reduced_data.G(1:(Q_f+N*Q_a),1:(Q_f+N*Q_a));
41 
42  reduced_data_subset.N = N;
43 
44 end
45