1 function [LL_I, bb_I] = rb_operators(rmodel, detailed_data, decomp_mode)
2 %
function [LL_I, bb_I] = rb_operators(rmodel, detailed_data, decomp_mode)
3 %
function computing the time-dependent reduced basis
operator and
4 % vector. If the decomposition mode is
'coefficients' (2), the detailed data
5 % are superfluous, can (and should
for `H`-independence) be empty.
7 % required fields of descr:
8 % implicit_operators_algorithm: function_handle for computing the
9 % 'L_I','b_I'-operators with arguments '(grid, params)'.
10 % c.f. for example fv_operators_implicit()
11 % inner_product_name: name of inner-product function for
12 % discrete function l2-scalar-product
15 % LL_I: matrix, components or coefficients for implicit operator.
16 % bb_I: vector, components or coefficients for affine shift of implicit operator.
21 % Bernard Haasdonk 23.7.2006
23 % determine affine_decomposition_mode as integer
24 %decomp_mode = get_affine_decomp_mode(model);
27 model.decomp_mode = decomp_mode;
31 [L_I, b_I] = model.implicit_operators_algorithm(model, []);
33 % rb-operator coefficients can simply be forwarded
39 model_data = detailed_data.model_data;
41 if decomp_mode == 0 % complete: simple projection on RB
45 RBtranspA = detailed_data.RB' * A;
47 % if isequal(params.model_type, 'implicit_nonaffine_linear')
48 % L_I = detailed_data.implicit_operator;
49 % b_I = detailed_data.implicit_constant;
51 [L_I, b_I] = model.implicit_operators_algorithm(model, model_data);
54 % apply all operator contributions to RB:
55 L_I_RB = L_I * detailed_data.RB;
57 % fill output quantities
59 LL_I = RBtranspA * L_I_RB;
62 bb_I = RBtranspA * b_I;
64 elseif decomp_mode == 1
66 if model.newton_solver || model.implicit_nonlinear
67 % disp('what is the use of the flag implicit_nonlinear ??');
68 % [dummy, b_I{1}] = fv_operators_diff_implicit(model, detailed_data, [], []);
72 [L_I, b_I] = model.implicit_operators_algorithm(model, ...
79 RB = detailed_data.RB;
85 % init output quantities
88 bb_I(:) = {zeros(Nmax,1)};
91 LL_I(:) = {zeros(Nmax,Nmax)};
93 % apply all operator contributions to RB:
94 L_I_RB = cell(Q_L_I,1);
95 L_I_RB(:) = {zeros(size(RB))};
97 L_I_RB{q}(:,:)= L_I{q} * RB;
100 % fill output quantities
103 LL_I{q} = RBtranspA * L_I_RB{q};
108 bb_I{q} = RBtranspA * b_I{q};
Customizable implementation of an abstract greedy algorithm.