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 % Optional fields of model:
13 % name_output_functional : name of an output functional
15 % Required fields of reduced_data:
16 % N : number of reduced basis vectors in the reduced_data.
18 % optional fields of reduced_data:
19 % a0 : a cell array sequence of N-vector components of initial data
21 % LL_E : a cell array sequence of N x N component-Matrices of
explicit
22 %
operator evaluations.
23 % LL_I : a cell array sequence of N x N component-Matrices of implicit
24 %
operator evaluations.
25 % bb : a cell array sequence of N-vector components of the offset
26 % bb_I : a cell array sequence of N-vector components of the implicit offset
27 % K_II : a cell array sequence sequence of N x N matrices
28 % K_IE : a cell array sequence of N x N matrices
29 % K_EE : a cell array sequence of N x N matrices
30 % m_I : a cell array sequence of N-vector components of offset
31 % m_E : a cell array sequence of N-vector components of offset
32 % m : a cell array sequence of scalars (simply copied from
'reduced_data')
33 % s_RB : in
case of a given output functional,
this is a vector of output
34 % functional values of the reduced basis
35 % s_l2norm : in
case of a given output functional,
this is the `L^2`-norm of
36 % the output functional
38 % generated fields of reduced_data_subset:
39 % a0 : a cell array sequence of N-vector components of initial data
41 % LL_E : a cell array sequence of N x N component-Matrices of
explicit
42 %
operator evaluations.
43 % LL_I : a cell array sequence of N x N component-Matrices of implicit
44 %
operator evaluations.
45 % bb : a cell array sequence of N-vector components of the offset
46 % bb_I : a cell array sequence of N-vector components of the implicit offset
47 % K_II : a cell array sequence sequence of N x N matrices
48 % K_IE : a cell array sequence of N x N matrices
49 % K_EE : a cell array sequence of N x N matrices
50 % m_I : a cell array sequence of N-vector components of offset
51 % m_E : a cell array sequence of N-vector components of offset
52 % m : a cell array sequence of scalars (simply copied from
'reduced_data')
53 % s_RB : in
case of a given output functional,
this is a vector of output
54 % functional values of the reduced basis
55 % s_l2norm : in
case of a given output functional,
this is the `L^2`-norm of
56 % the output functional
57 % N : number of reduced basis vectors in the reduced_data.
59 % \note The fields
for 'reduced_data_subset' are only generated
if they exist in
62 % Bernard Haasdonk 16.5.2008
64 reduced_data_subset = reduced_data;
66 if reduced_data.N ~= model.N
67 % extract correct N-sized submatrices and subvectors from reduced_data
68 if model.N > length(reduced_data.a0{1})
69 error('N too large for current size of reduced basis!');
72 if isfield(reduced_data, 'a0')
73 reduced_data_subset.a0 = subblock_sequence(reduced_data.a0,1:N);
75 if isfield(reduced_data, 'LL_I')
76 reduced_data_subset.LL_I = subblock_sequence(reduced_data.LL_I,1:N,1:N);
78 if isfield(reduced_data, 'LL_E')
79 reduced_data_subset.LL_E = subblock_sequence(reduced_data.LL_E,1:N,1:N);
81 if isfield(reduced_data, 'bb')
82 reduced_data_subset.bb = subblock_sequence(reduced_data.bb,1:N);
84 if isfield(reduced_data, 'bb_I')
85 reduced_data_subset.bb_I = subblock_sequence(reduced_data.bb_I,1:N);
87 if isfield(reduced_data, 'K_EE')
88 reduced_data_subset.K_EE = subblock_sequence(reduced_data.K_EE,1:N,1:N);
90 if isfield(reduced_data, 'K_IE')
91 reduced_data_subset.K_IE = subblock_sequence(reduced_data.K_IE,1:N,1:N);
93 if isfield(reduced_data, 'K_II')
94 reduced_data_subset.K_II = subblock_sequence(reduced_data.K_II,1:N,1:N);
96 if isfield(reduced_data, 'm_I')
97 reduced_data_subset.m_I = subblock_sequence(reduced_data.m_I,1:N);
99 if isfield(reduced_data, 'm_E')
100 reduced_data_subset.m_E = subblock_sequence(reduced_data.m_E,1:N);
102 if isfield(reduced_data, 'm')
103 reduced_data_subset.m = reduced_data.m;
106 if isfield(reduced_data, 'T')
107 reduced_data_subset.T = reduced_data.T(1:N,1:N);
110 if isfield(model,'name_output_functional')
111 reduced_data_subset.s_RB = reduced_data.s_RB(1:N);
112 reduced_data_subset.s_l2norm = reduced_data.s_l2norm;
115 reduced_data_subset.N = N;
function reduced_data_subset = lin_evol_reduced_data_subset(model, reduced_data)
method which modifies reduced_data, which is the data, that will be passed to the online-simulation a...