rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
lin_evol_reduced_data_subset.m
Go to the documentation of this file.
1 function reduced_data_subset = lin_evol_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 % Optional fields of model:
13 % name_output_functional : name of an output functional
14 %
15 % Required fields of reduced_data:
16 % N : number of reduced basis vectors in the reduced_data.
17 %
18 % optional fields of reduced_data:
19 % a0 : a cell array sequence of N-vector components of initial data
20 % projection
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
37 %
38 % generated fields of reduced_data_subset:
39 % a0 : a cell array sequence of N-vector components of initial data
40 % projection
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.
58 %
59 % \note The fields for 'reduced_data_subset' are only generated if they exist in
60 % 'reduced_data'.
61 
62 % Bernard Haasdonk 16.5.2008
63 
64 reduced_data_subset = reduced_data;
65 
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!');
70  end;
71  N = model.N;
72  if isfield(reduced_data, 'a0')
73  reduced_data_subset.a0 = subblock_sequence(reduced_data.a0,1:N);
74  end
75  if isfield(reduced_data, 'LL_I')
76  reduced_data_subset.LL_I = subblock_sequence(reduced_data.LL_I,1:N,1:N);
77  end
78  if isfield(reduced_data, 'LL_E')
79  reduced_data_subset.LL_E = subblock_sequence(reduced_data.LL_E,1:N,1:N);
80  end
81  if isfield(reduced_data, 'bb')
82  reduced_data_subset.bb = subblock_sequence(reduced_data.bb,1:N);
83  end
84  if isfield(reduced_data, 'bb_I')
85  reduced_data_subset.bb_I = subblock_sequence(reduced_data.bb_I,1:N);
86  end
87  if isfield(reduced_data, 'K_EE')
88  reduced_data_subset.K_EE = subblock_sequence(reduced_data.K_EE,1:N,1:N);
89  end
90  if isfield(reduced_data, 'K_IE')
91  reduced_data_subset.K_IE = subblock_sequence(reduced_data.K_IE,1:N,1:N);
92  end
93  if isfield(reduced_data, 'K_II')
94  reduced_data_subset.K_II = subblock_sequence(reduced_data.K_II,1:N,1:N);
95  end
96  if isfield(reduced_data, 'm_I')
97  reduced_data_subset.m_I = subblock_sequence(reduced_data.m_I,1:N);
98  end
99  if isfield(reduced_data, 'm_E')
100  reduced_data_subset.m_E = subblock_sequence(reduced_data.m_E,1:N);
101  end
102  if isfield(reduced_data, 'm')
103  reduced_data_subset.m = reduced_data.m;
104  end
105 
106  if isfield(reduced_data, 'T')
107  reduced_data_subset.T = reduced_data.T(1:N,1:N);
108  end
109 
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;
113  end;
114 
115  reduced_data_subset.N = N;
116 
117 end
118 
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...