rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
comsol_ThermalBlock3D_model.m
1 function model = comsol_ThermalBlock3D_model(varargin)
2 %function model = comsol_ThermalBlock3D_model(varargin)
3 %
4 % This function defines the Comsol-3D-ThermalBlock-Model and adds the
5 % necessary fields to the model!
6 %
7 % Oliver Zeeb, 2012
8 
9 
10 
11 %%%%%%%%%%%%%%%%%%%%%%%%%%
12 % CHOOSE THE MODEL HERE!!!
13 %%%%%%%%%%%%%%%%%%%%%%%%%%
14 
15 if isempty(varargin)
16  model=gen_rbmatlab_model_from_comsol_model('ThermalBlock_3D_5x5x5_LinLagr_Einfluss_unten_3Params');
17  %model=gen_rbmatlab_model_from_comsol_model('ThermalBlock_3D_5x5x5_LinLagr_Einfluss_unten_8Params');
18  %model=gen_rbmatlab_model_from_comsol_model('ThermalBlock_3D_5x5x5_LinLagr_Einfluss_unten_125Params');
19 else
20  model=gen_rbmatlab_model_from_comsol_model(varargin{1});
21 end
22 
23 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
24 %%% RB_GENERATION_MODE
25 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
26 model.RB_generation_mode = 'greedy_uniform_fixed';
27 model.RB_numintervals = 3 * ones(size(model.RB_numintervals));
28 
29 
30 
31 %%%%%%%%%%%%%%%%%%%
32 %BASIS GENERATION
33 %%%%%%%%%%%%%%%%%%%
34 
35 %set initial mu and mu_ranges
36 length_mu = length(get_mu(model));
37 model.mu_ranges = cell(length_mu,1);
38 mu_min = 1;
39 mu_max = 100;
40 for k=1:length_mu
41  model.mu_ranges{k} = [mu_min, mu_max];
42 end
43 model=set_mu(model, ones(1,length_mu)*(mu_min+mu_max)/2);
44 
45 model.get_inner_product_matrix = @(detailed_data)detailed_data.inner_product_matrices.L2;
46 model.RB_stop_epsilon = 1e-12;
47 model.RB_stop_Nmax = 20;
48 
49 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
50 % MODEL OPERATORS
51 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
52 
53 % set model operator
54 model.operators = @comsol_ThermalBlock3D_operators;
55 model.comsol_calculate_inner_product_matrices = @comsol_ThermalBlock3D_calculate_inner_product_matrices;
56 model.operators_output = @comsol_ThermalBlock3D_operators_output;
57 model.compute_output_functional = 1;
58 
59 %error estimation quantities
60 model.coercivity_alpha = @(model) min(get_mu(model));
61 model.coercivity_alpha_LB = min(min(cell2mat(model.mu_ranges)));
62