3 %
function computing the reduced basis initial values. If the
4 % decomposition mode is
'coefficients', the detailed_data are
5 % superfluous, can (and should
for H-independence) be empty.
8 % Bernard Haasdonk 23.7.2006
10 % determine affine_decomposition_mode as integer
11 %model.decomp_mode = decomp_mode;
12 decomp_mode = model.decomp_mode;
14 if decomp_mode == 0 % complete: simple projection on RB
15 Nmax = size(detailed_data.RB,2);
16 u0 = model.init_values_algorithm(model,detailed_data);
18 a0 = u0' * A * detailed_data.RB;
19 %a0 = feval(params.inner_product_name, ...
20 % detailed_data.RB,u0,detailed_data.grid,params);
21 % equivalent for fv: a0 = (RB.*repmat(grid.A(:),1,Nmax))' * u0(:);
22 elseif decomp_mode == 1
23 Nmax = size(detailed_data.RB,2);
24 u0 = model.init_values_algorithm(model,detailed_data);
27 a0(:) = {zeros(Nmax,1)};
28 % a0 : initial data projected on RB set: starting coefficients
31 a0{q} = u0{q}
' * A * detailed_data.RB;
33 if model.debug && length(u0) > 1
34 if max(abs(detailed_data.RB * a0{1}'-u0{1}))>0.001
36 U0_RB = [detailed_data.RB*a0{1}
',detailed_data.RB*a0{2}'];
38 plot_params.plot = model.plot;
39 plot_params.title =
'U0 Components';
41 plot_params.title =
'U0_RB';
43 error(
'rb initial data badly approximating initial data!!');
46 % disp(
'halt in rb_init_values')
48 else % decomp_mode== 2 -> coefficients simply transfered from u0
49 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...