3 % depending on collateral reduced basis space information only (e.g.
4 % interpolation DOFs and a local grid).
38 % interpolation basis was generated.
53 TM_reduction_args = {};
56 properties (SetAccess =
private, Dependent)
71 % constructor
for the generation of the reduced data.
77 % Alternative synopsis:
79 % a reduced data node and (optionally) extracting smaller matrices.
85 copy_extract(rd, copy, rmodel);
87 fill_fields(rd, rmodel, detailed_data);
89 error('Did not find constructor for your arguments');
93 function conds = get_conds(this)
94 if ~isempty(this.Mmass)
95 conds.Mmass = condest(this.Mmass);
98 conds.BM = condest(this.BM);
101 function grid = get.grid(this)
102 grid = this.grid_local_ext;
105 function M = get.M(this)
106 M = size(this.BM, 2) - this.Mstrich;
109 function yesno = needs_subset_copy(this, rmodel)
110 % function yesno = needs_subset_copy(this, rmodel)
111 % @copybrief ::
GreedyUser.IReducedDataNode.needs_subset_copy()
113 % @copydetails ::
GreedyUser.IReducedDataNode.needs_subset_copy()
118 MM = get_by_description(rmodel.M, this.ophandle.
id);
119 yesno = isempty(MM) || (this.M ~= MM);
123 methods(Access=private)
125 function fill_fields(this, rmodel, detailed_data)
126 model_data = detailed_data.model_data;
127 if size(model_data.W, 1) == size(detailed_data.QM, 1)
130 A = model_data.diamondW;
133 this.ophandle = detailed_data.ophandle;
134 MM = get_by_description(rmodel.M, this.ophandle.
id);
135 this.BM = detailed_data.BM(1:MM,1:MM);
137 [nmd, eind, eind_local] = this.ophandle.compute_TM_global(model_data, detailed_data.TM(1:MM));
139 this.grid_local_ext = nmd.grid_local_ext;
140 this.TM_global_args = nmd.TM_global_args;
142 this.gn_edges = nmd.gn_edges;
143 this.gn_inner_edges = nmd.gn_inner_edges;
144 this.gn_boundary_edges = nmd.gn_boundary_edges;
145 this.TM_global = eind;
146 this.TM_local = eind_local;
148 this.Mmass = detailed_data.QM(:,1:MM)' * A * detailed_data.QM(:,1:MM);
151 function copy_extract(this, reduced_data, rmodel)
152 this.ophandle = reduced_data.ophandle;
153 this.
id = reduced_data.
id;
155 MM = get_by_description(rmodel.M, this.ophandle.
id);
157 grid = reduced_data.grid_local_ext;
159 % new version with external routine index_ext:
160 [nmd, eind, eind_local] = this.ophandle.compute_TM_global(reduced_data, reduced_data.TM_local(1:MM));
162 reduced_data_subset.TM_global = reduced_data.TM_global(1:MM);
163 reduced_data_subset.grid_local_ext = nmd.grid_local_ext;
164 [this.gEI, this.gn_inner_edges, this.gn_boundary_edges] ...
166 this.gn_edges = this.gn_inner_edges + this.gn_boundary_edges;
168 glob2loc = zeros(grid.nelements,1);
169 glob2loc(eind) = 1:length(eind);
170 this.TM_global_args = cell(1, length(nmd.TM_global_args));
171 for i = 1:length(nmd.TM_global_args)
172 oldTM_global = reduced_data.TM_global_args{i};
173 this.TM_global_args{i} = oldTM_global(nmd.TM_global_args{i});
174 this.TM_reduction_args{i} = nmd.TM_global_args{i};
176 this.TM_local = glob2loc(reduced_data.TM_local(1:MM));
177 this.BM = reduced_data.BM(1:MM,1:MM);
178 this.Mmass = reduced_data.Mmass(1:MM,1:MM);
180 %
get Q^t W Q
for M to M+M'
181 if rmodel.Mstrich > 0
182 QWQ = this.Mmass(rmodel.M+1:end,MM);
183 % this.factor = norm(QWQ);
Interface for a localized operator that fulfills the so-called -independent DOF dependence.
function [ gEI , in_edges , b_edges , i_ints_bigger , b_ints ] = compute_edge_indices(gridbase grid)
edge index matrix. This matrix maps each edge specified by the tuple (element_id, local_edge_id) to a...
gridbase grid
synonym for grid_local_ext
Mstrich
number of collateral reduced basis vectors used for error estimation.
reduced model for non-linear evolution problems as given by a TwoPhaseFlow.DetailedModel.
M
number of collateral reduced basis vectors stored in this data node.
gridbase grid_local_ext
local grid with added neighbours such that a sparse evaluation of the empirically interpolated operat...
TM_local
indices of grid entities in the grid_local_ext structure where the interpolation points are situated...
Interface for leaf nodes of the DataTree in Greedy.User.ReducedData objects.
Implementation of a Greedy.User.IReducedDataNode storing reduced data depending on collateral reduc...
Interface classes to be implemented by the Greedy.Algorithm user.
This is the interface for a reduced model providing methods to compute low dimensional reduced simula...
TM_global
indices of grid entities in the the global grid structure where the interpolation points are situated...
BM
empirical interpolation matrix
Mmass
empirical interpolation mass matrix.
Customizable implementation of an abstract greedy algorithm.
Interface class for the generation and storage of reduced basis spaces as described in Module (M2)...