1 classdef EiRbReducedDataNode < Greedy.User.IReducedDataNode
2 % Reduced data implementation
for non-linear evolution problems with finite
3 % volume discretizations.
5 % See @ref DHO11 for details on the implementations of the reduced matrices
8 properties(Dependent, SetAccess=private)
9 % Dof vectors of projections `\left\{{ \cal P }_{\text{red}}[u_0^q]
10 % \right\}_{q=1}^{Q_{u_0}}`.
12 % @sa NonlinEvol.ReducedModel.rb_init_values()
for details.
15 % `Q_I` reduced matrix
for implicit
operator `{\cal L}_{h,I}`
if it is
16 % affinely decomposable.
18 % The matrix entries are:
19 % ``({ \bf L}_I^q)_{ij} = \int \varphi_i {\cal L}^q_{h,I}[\varphi_j]``
20 %
for `i,j=1,\ldots,N` and `q=1,\ldots,Q_I`.
23 % `Q_b`-sequence of reduced vectors for constant contributions `b_h`
25 % The matrix entries are:
26 % ``({ \bf b})_{i} = \int \varphi_i b^q_h``
27 %
for `i=1,\ldots,N` and `q=1,\ldots,Q_b`.
30 % reduced basis mass matrix.
32 % The matrix entries are:
33 % ``({ \bf M })_{ij} = \int \varphi_i \varphi_j``
34 %
for `i,j=1,\ldots,N`
37 % empirical interpolation matrix `{\bf B}`
39 % The matrix entries are:
40 % ``({\bf B})_{ij} = q_i(x_j)``
41 %
for `1 \leq i \leq j \leq N` and vanish elsewhere.
44 % local grid of type .gridbase with added neighbours such that a sparse
45 % evaluation of the empirically interpolated operators in the interpolation
46 % points is possible on
this grid.
49 % synonym
for #grid_local_ext of type .gridbase
52 % indices of grid entities in the #grid_local_ext structure where the
53 % interpolation points are situated.
56 % indices of grid entities in the the global grid structure where the
57 % interpolation points are situated.
60 % empirical interpolation mass matrix.
62 % The matrix entries are:
63 % ``({ \bf M })_{ij} = \int q_i q_j``
64 %
for `i,j=1,\ldots,M`
69 properties(Dependent, SetAccess=
private)
70 % number of reduced basis vectors stored in
this data node.
73 % number of collateral reduced basis vectors stored in
this data node.
76 % number of collateral reduced basis vectors used
for error estimation.
81 % handle of
object of type NonlinEvol.RbReducedDataNode storing all reduced
82 % magnitudes based only on the reduced basis.
85 % handle of
object of type NonlinEvol.EiReducedDataNode storing all reduced
86 % magnitudes based only on the collateral reduced basis.
90 %
"transition" mass matrix
92 % The matrix entries are:
93 % ``({ \bf D })_{ij} = \int q_i \varphi_j``
94 %
for `i=1,\ldots,M, j=1,\ldots,N`
97 % empirical interpolation matrix
for operator with projection to reduced
98 % basis space with `M+M'` basis vectors.
100 % This matrix is the solution `{\bf C}`of the equation system
101 % ``{ \bf B C } = { \bf D }``
102 % with @ref #BM
"empirical interpolation matrix" `{ \bf B }` and @ref #DE
103 %
"transition matrix" `{\bf D}`.
105 % In
case you have a vector of interpolation evaluations `\bf l` at
106 % interpolation points, the interpolation can the be calculated as
110 % empirical interpolation matrix
for operator with projection to reduced
111 % basis space
for the empirical interpolation with only `M` basis vectors.
116 % restriction of the reduced basis vectors to interpolation DOFs of the
117 % local grid #grid_local_ext.
123 ei_reduced_data, ei_detailed_data)
124 % Constructor
for the generation of the reduced matrices and vectors.
127 % rb_reduced_data: pure reduced basis reduced data structure of type NonlinEvol.RbReducedDataNode
128 % rb_detailed_data: detailed data structure of type Greedy.DataTree.Detailed.RbLeafNode
129 % storing the reduced basis.
130 % ei_reduced_data: pure EI reduced data structure of type NonlinEvol.EiReducedDataNode
131 % ei_detailed_data: detailed data structure of type Greedy.DataTree.Detailed.EiLeafNode
132 % storing the collateral reduced basis.
134 error(
'NonlinEvol.EiRbReducedDataNode constructor needs an argument');
135 elseif nargin == 4 && isa(rb_reduced_data,
'IReducedModel') ...
136 && isa(rb_detailed_data,
'NonlinEvol.EiRbReducedDataNode')
137 rmodel = rb_reduced_data;
138 copy = rb_detailed_data;
139 copy_extract(rd, copy, rmodel, ei_reduced_data, ei_detailed_data);
141 fill_fields(rd, rb_reduced_data, rb_detailed_data, ei_reduced_data, ei_detailed_data);
143 error('Did not find constructor for your arguments');
147 function conds = get_conds(this)
148 conds_rb = get_conds(this.rb_rd);
149 conds_ei = get_conds(this.ei_rd);
151 conds.CE = condest(this.CE);
153 if ~isempty(this.CE_red)
154 conds.CE_red = condest(this.CE_red);
161 methods(Access=private)
163 function fill_fields(this, rb_red, rb_det, ei_red, ei_det)
167 A = rb_det.model_data.W;
168 this.DE = rb_det.RB' * A * ei_det.QM;
170 this.RB_local_ext = rb_det.RB(this.ei_rd.TM_global, :);
173 function copy_extract(this, copy, rmodel, rb_reduced_data, ei_reduced_data)
174 MM = rmodel.M + rmodel.Mstrich;
175 this.rb_rd = rb_reduced_data;
176 this.ei_rd = ei_reduced_data;
178 this.DE = copy.DE(1:rmodel.N, 1:MM);
179 if rmodel.M == copy.M && rmodel.Mstrich == copy.Mstrich
180 this.RB_local_ext = copy.RB_local_ext(:, 1:rmodel.N);
182 eind = compute_TM_global(this.ei_rd, copy.ei_rd.grid, copy.ei_rd.TM_local(1:MM), rmodel);
183 this.RB_local_ext = copy.RB_local_ext(eind, 1:rmodel.N);
190 function N = get.N(this)
194 function M = get.M(this)
198 function Mstrich = get.Mstrich(this)
199 Mstrich = this.ei_rd.Mstrich;
202 function BM = get.BM(this)
206 % function this = set.BM(this, BM)
207 % this.ei_rd.BM = BM;
210 function Mmass = get.Mmass(this)
211 Mmass = this.ei_rd.Mmass;
214 % function this = set.Mmass(this, Mmass)
215 % this.ei_rd.Mmass = Mmass;
218 function grid_local_ext = get.grid_local_ext(this)
219 grid_local_ext = this.ei_rd.grid_local_ext;
222 % function this = set.grid_local_ext(this, grid_local_ext)
223 % this.ei_rd.grid_local_ext = grid_local_ext;
226 function grid_local_ext = get.grid(this)
227 grid_local_ext = this.ei_rd.grid_local_ext;
230 % function this = set.grid(this, grid_local_ext)
231 % this.ei_rd.grid_local_ext = grid_local_ext;
234 function TM_local = get.TM_local(this)
235 TM_local = this.ei_rd.TM_local;
238 function TM_global = get.TM_global(this)
239 TM_global = this.ei_rd.TM_global;
242 function a0 = get.a0(this)
246 function Nmass = get.Nmass(this)
247 Nmass = this.rb_rd.Nmass;
250 function LL_I = get.LL_I(this)
251 LL_I = this.rb_rd.LL_I;
254 function bb_I = get.bb_I(this)
255 bb_I = this.rb_rd.bb_I;
258 function yesno = needs_subset_copy(this, rmodel)
259 % function yesno = needs_subset_copy(this, rmodel)
260 % @copybrief .Greedy.User.IReducedDataNode.needs_subset_copy()
262 % @copydetails .Greedy.User.IReducedDataNode.needs_subset_copy()
267 yesno = needs_subset_copy(this.rb_rd, rmodel) || needs_subset_copy(this.ei_rd, rmodel);