rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
p_part_model.m
1 function p_part_model = p_part_model(model,params);
2 %function p_part_model = p_part_model(model,params);
3 %
4 % function "inheriting" a p_part_model from the model,
5 % such that the model then is a model working on a
6 % parameter domain decomposition with several "detailed_data",
7 % i.e. reduced basis and several "reduced_data" sets and selecting
8 % the correct one during rb_simulation
9 %
10 % Optional fields of params:
11 % p_part_early_refinement: flag if early refinement should be activated
12 % (saves time)
13 % p_part_generation_mode: 'uniform','adaptive','adaptive_epsilon_fixed'
14 % p_part_numintervals: defines first grid in parameter space
15 %
16 
17 
18 % Bernard Haasonk 5.2.2010
19 
20 
21 % store base model
22 p_part_model.base_model = model;
23 p_part_model.mu_names = model.mu_names;
24 p_part_model.mu_ranges = model.mu_ranges;
25 if isfield(params,'p_part_early_refinement')
26  p_part_model.p_part_early_refinement = params.p_part_early_refinement;
27 else
28  p_part_model.p_part_early_refinement = 0;
29 end
30 
31 
32 %%%%% copy p_partition generation parameters
33 %possible generation modes: 'uniform', 'adaptive'(...with N fixed),'adaptive_epsilon_fixed'
34 p_part_model.p_part_generation_mode = params.p_part_generation_mode;
35 p_part_model.p_part_numintervals = params.p_part_numintervals;
36 
37 
38 %%%%% set modified model interface pointers
39 
40 % simply generate model data from base-model
41 p_part_model.gen_model_data = @(model) ...
42  model.base_model.gen_model_data(model.base_model);
43 
44 % simply call detailed_simulation on base-model
45 p_part_model.detailed_simulation = @(model,model_data) ...
46  model.base_model.detailed_simulation(model.base_model,model_data);
47 
48 p_part_model.set_mu=@set_mu_in_model_and_base_model;
49 p_part_model.get_mu = @get_mu_default;
50 
51 p_part_model.gen_reduced_data = @p_part_gen_reduced_data;
52 p_part_model.rb_simulation = @p_part_rb_simulation;
53 p_part_model.gen_detailed_data = @p_part_gen_detailed_data;
54 
55 % simply forward further pointers to base model
56 
57 %p_part_model.anypointer = model.base_model.anypointer;
58 % ...
59 
60 %| \docupdate