1 function detailed_data=lin_evol_gen_detailed_data(model,model_data)
2 %
function detailed_data=lin_evol_gen_detailed_data(model,model_data)
4 % method, which prepares reduced_data, which is meant as
5 % data, that may be dependent on H only, and is not required during the
6 % online-simulation, but it may be used
for reconstruction purposes or
7 % computation of online_quantities. i.e. reduced basis vectors,
8 % colateral reduced basis spaces, grid, etc. can be stored here.
10 % So detailed_data is produced and used only in offline-phase algorithms.
12 % allowed dependency of data: H
13 % allowed dependency of computation: H
14 % Unknown at
this stage: mu, Nmax, N
16 % Required fields of model:
18 % mu_names : cell array of parameter-names
19 % mu_ranges : cell array of parameter-intervals
21 % Further fields are required
for rb generation,
24 % generated fields of detailed_data:
26 % RB : reduced basis columns 1,...,Nmax
27 % grid : grid to be used in the subsequent stages
28 % RB_info : depending on generation method some detailed information
30 % Bernard Haasdonk 15.5.2007
31 % edited by Dominik Garmatter 11.09 2012
33 if(isempty(model_data))
34 model_data = gen_model_data(model);
38 %% begin of edit by Dominik Garmatter 11.09 2012
39 % components are now computet and stored in the detailed_data.
41 if ~isfield(model,
'want_dual')
44 % computing the operators dependant on the controlfield 'model.want_dual'
45 % 1 = dual Operators are computet, 0 = primal ones are.
46 % special Note: in the european_option_pricing model a functional named
47 % 'theta' includes a partial timederivative and therefore produces a
48 % slightly different dual problem. Therefore the 'theta'-case is sometimes
49 % treated differently. Don't care about this case if you don't use the
50 % european_option_pricing model.
51 model.decomp_mode = 1;
52 if model.want_dual % dual case
53 [~, ~, ~, detailed_data.L_I_comp, detailed_data.L_E_comp] = model.operators_ptr(model, model_data);
54 if strcmp(model.name_output_functional, 'theta') == 1
55 detailed_data.b_comp = model.operators_output(model, model_data); % v_l the Riesz_representant of the theta-functional
58 [detailed_data.L_I_comp, detailed_data.L_E_comp, detailed_data.b_comp] = model.operators_ptr(model, model_data);
62 skip_rb_generation = false;
63 detailed_data =
structcpy(detailed_data, model_data);
64 if isfield(model_data, 'mexptr') && isfield(model, 'detailedfname')
65 if model_data.mexptr('is_valid_rb')
66 if exist(model.detailedfname, 'file')
67 tmp = load(model.detailedfname);
68 if length(tmp.detailed_data.RB) == model_data.mexptr('get_rb_size')
69 disp('loading already generated rb space!');
70 detailed_data = tmp.detailed_data;
71 skip_rb_generation = true;
73 model.mexptr('reset_rb');
76 model.mexptr('reset_rb');
80 if ~skip_rb_generation
82 if isfield(model, 'detailedfname')
83 save(model.detailedfname, 'model', 'detailed_data');
A triangular conforming grid in two dimensions.
A cartesian rectangular grid in two dimensions with axis parallel elements.
function s1 = structcpy(s1, s2)
copies the fields of structure s2 into structure s1. If the field to be copied does not exist in s1 y...
function detailed_data = rb_basis_generation(model, detailed_data)
reduced basis construction with different methods