3 % method which modifies reduced_data, which is the data, that will
4 % be passed to the online-simulation algorithm.
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.
9 % Required fields of model:
10 % N : number of reduced basis vectors to choose
12 % Required fields of reduced_data:
13 % N : number of reduced basis vectors in the reduced_data,
14 % must be larger than model.N!!
16 % Bernard Haasdonk 27.2.2011
18 reduced_data_subset = reduced_data;
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!');
26 if isfield(reduced_data,
'AN_comp')
27 reduced_data_subset.AN_comp = ...
28 subblock_sequence(reduced_data.AN_comp,1:N,1:N);
30 if isfield(reduced_data, 'fN_comp')
31 reduced_data_subset.fN_comp = subblock_sequence(reduced_data.fN_comp,1:N);
33 if isfield(reduced_data, 'lN_comp')
34 reduced_data_subset.lN_comp = subblock_sequence(reduced_data.lN_comp,1:N);
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));
42 reduced_data_subset.N = N;