rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
unit_ball_model.m
1 function model = unit_ball_model(params)
2 %function model = unit_ball_model(params)
3 %
4 % parametric model in R^p to be used as an elliptic model. Example,
5 % where exact solution is known, manifold mapping is non-bijective.
6 %
7 % input parameter params.p: the dimension (and number of components
8 % of f, and parameter dimension)
9 
10 % B. Haasdonk 12.6.2014
11 
12 model = [];
13 p = params.p;
14 model.p = p;
15 model.ndofs = p;
16 
17 %model.rb_problem_type = 'lin_stat';
18 %model.mu_names = {}; perhaps later
19 mu_ranges = {};
20 
21 for i=1:p
22  mu_ranges = [mu_ranges, {[-1,1]}];
23 end;
24 model.mu_ranges = mu_ranges;
25 
26 model.set_mu = @my_set_mu;
27 
28 
29 model.get_mu = @(model) model.mus;
30 
31 model.gen_model_data = @my_gen_model_data;
32 model.detailed_simulation = @my_detailed_simulation;
33 model.decomp_mode = 0; % default: complete evaluation
34 
35 %model.plot_sim_data = @lin_stat_plot_sim_data;
36 %model.plot_detailed_data = @lin_stat_plot_detailed_data;
37 
38 %model.gen_detailed_data = @lin_stat_gen_detailed_data;
39 %model.gen_reduced_data = @lin_stat_gen_reduced_data;
40 %model.reduced_data_subset = @lin_stat_reduced_data_subset;
41 %model.rb_simulation = @lin_stat_rb_simulation;
42 %model.rb_reconstruction = @lin_stat_rb_reconstruction;
43 %model.compute_output_functional = 0;
44 model.operators = @my_operators;
45 %model.operators_output = @fem_operators_output;
46 
47 %model.get_dofs_from_sim_data = @(sim_data) sim_data.uh;
48 %model.set_dofs_in_sim_data = @my_set_dofs_in_sim_data;
49 %model.get_inner_product_matrix = @(detailed_data) ...
50 % detailed_data.df_info.regularized_h10_inner_product_matrix;
51 %model.RB_generation_mode = 'lagrangian';
52 %model.set_rb_in_detailed_data=@lin_stat_set_rb_in_detailed_data;
53 %model.get_rb_size= @(model,detailed_data) size(detailed_data.RB,2);
54 %model.get_estimators_from_sim_data= @(sim_data) sim_data.Delta;
55 % for demo_rb_gui:
56 %model.is_stationary = 1;
57 %model.axes_tight = 1;
58 % for use of scm (standard is 0, i.e. no scm - for the configuration fields of scm see scm_offline.m):
59 %model.use_scm = 0;
60 
61 function model = my_set_mu(model,mu,dummy)
62 model.mus = mu;
63 
64 function [A,f] = my_operators(model,model_data);
65 switch model.decomp_mode
66  case 0
67  A = eye(model.p);
68  f = model.mus/norm(model.mus);
69  case 1 % components
70  E = eye(model.p);
71  A = {E};
72  for i=1:model.p
73  f = [f,{E(:,i)}];
74  end;
75  case 2 % coefficients
76  A = 1;
77  f = mu/norm(mu);
78 end;
79 
80 function model_data = my_gen_model_data(model);
81 model_data = [];
82 
83 function sim_data = my_detailed_simulation(model,model_data);
84 [A,f] = model.operators(model,model_data);
85 sim_data.u = A\f;
86 
87 
function demo_rb_gui(varargin)
reduced basis demo with sliders
Definition: demo_rb_gui.m:17
function reduced_data_subset = lin_stat_reduced_data_subset(model, reduced_data)
method which modifies reduced_data, which is the data, that will be passed to the online-simulation a...
function scm_offline_data = scm_offline(model, detailed_data, M_train, D_train)
scm_offline_data = scm_offline(model, detailed_data, M_train, D_train)
Definition: scm_offline.m:17