5 %
case. Controlled via model.want_dual (being 1 or 0) the normal initial
6 % values or the riesz-representant of the current output functional is computed.
7 % In order of
this function working properly model.operators_output has to
8 % be affinely decomposed.
10 %
function computing the reduced basis initial values. If the
11 % decomposition mode is
'coefficients', the detailed_data are
12 % superfluous, can (and should
for H-independence) be empty.
14 % Required fields of model
15 % init_values_algorithm: name of function for computing the
16 % detailed initvalues-DOF with arguments (grid, params)
17 % example: init_values_cog
19 % Function supports affine decomposition, i.e. different operation modes
20 % guided by optional field decomp_mode in params. See also the
21 % contents.txt for general explanation
24 % Bernard Haasdonk 23.7.2006
25 % extension to primal/dual formulation by Dominik Garmatter 11.06 2012
27 % determine affine_decomposition_mode as integer
28 decomp_mode = model.decomp_mode;
30 if decomp_mode == 0 % complete: simple projection on RB
32 u0 = model.operators_output(model, detailed_data);
34 u0 = model.init_values_algorithm(model,detailed_data);
37 a0 = u0' * A * detailed_data.RB;
38 %a0 = feval(params.inner_product_name, ...
39 % detailed_data.RB,u0,detailed_data.grid,params);
40 % equivalent for fv: a0 = (RB.*repmat(grid.A(:),1,Nmax))' * u0(:);
41 elseif decomp_mode == 1
42 Nmax = size(detailed_data.RB,2);
44 u0 = model.operators_output(model, detailed_data);
46 u0 = model.init_values_algorithm(model,detailed_data);
50 a0(:) = {zeros(Nmax,1)};
51 % a0 : initial data projected on RB set: starting coefficients
54 a0{q} = u0{q}
' * A * detailed_data.RB;
56 if model.debug && length(u0) > 1
57 if max(abs(detailed_data.RB * a0{1}'-u0{1}))>0.001
59 U0_RB = [detailed_data.RB*a0{1}
',detailed_data.RB*a0{2}'];
61 plot_params.plot = model.plot;
62 plot_params.title =
'U0 Components';
64 plot_params.title =
'U0_RB';
66 error(
'rb initial data badly approximating initial data!!');
69 else % decomp_mode == 2 -> coefficients simply transfered from u0
71 u0 = model.operators_output(model, []);
73 u0 = model.init_values_algorithm(model, []);
function a0 = rb_init_values_default(model, detailed_data)
function computing the reduced basis initial values. If the decomposition mode is coefficients...
function p = plot_sequence(varargin)
plotting a sequence of data slices on polygonal 2d grid (constructed from params if empty) and provid...
function a0 = rb_init_values_primal_dual(model, detailed_data)
a0 = rb_init_values_primal_dual(model, detailed_data)