rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
demo_rb_steps_oop.m
Go to the documentation of this file.
1 % small collection of RBmatlab's rb-simulation abilities
2 % please inspect the source-file during execution, as the main
3 % purpose is to demonstrate the possibilities of RBmatlab's
4 % rb-philosophy
5 %
6 % this script demonstrates use for oop
7 % version of models. As example a thermalblock model is
8 % used.
9 %
10 % See also
11 % demo_rb_steps_struct.m for the same steps using a struct-oriented
12 % approach as model
13 
14 % Bernard Haasdonk 11.4.2007
15 
17 
18 disp('Small demonstration of RBmatlab reduced basis commands');
19 disp(['Please type dbcont after inspecting the workspace variables' ...
20  ' at different halt points.']);
21 disp('Opening figures can be closed.');
22 
23 % detailled simulation:
24 clear;
25 
26 % get problem description and generate model
27 disp('generation of problem description and model:');
28 params = [];
29 params.B1 = 2;
30 params.B2 = 2;
31 params.numintervals_per_block = 20;
32 descr = thermalblock_model(params);
33 [dmodel, rmodel] = gen_models(descr);
34 disp('Please type dbcont after inspecting the workspace variables');
35 keyboard;
36 
37 % generate model_data
38 disp('generation of model_data (grid, fem-info, etc.):');
39 model_data = gen_model_data(dmodel);
40 disp('Please type dbcont after inspecting the workspace variables');
41 keyboard;
42 
43 % perform detailed simulation and plot
44 plot_params = [];
45 plot_params.axis_equal = 1;
46 plot_params.axis_tight = 1;
47 sim_data = detailed_simulation(dmodel,model_data);
48 plot_sim_data(dmodel,model_data,sim_data,plot_params);
49 disp('Please type dbcont after inspecting the workspace variables');
50 keyboard;
51 
52 % generation of high dimensional offline data for RB-scheme
53 disp('computation of high dimensional offline-data (basis by greedy):');
54 detailed_data = gen_detailed_data(rmodel,model_data);
55 disp('Please type dbcont after inspecting the workspace variables');
56 keyboard;
57 
58 % generation of low dimensional offline data for RB-scheme
59 disp('computation of low dimensional offline-data:');
60 reduced_data = gen_reduced_data(rmodel,detailed_data);
61 disp('Please type dbcont after inspecting the workspace variables');
62 keyboard;
63 
64 % perform online simulation
65 rmodel.N = 4;
66 reduced_data = extract_reduced_data_subset(rmodel,reduced_data);
67 disp('Please type dbcont after inspecting the workspace variables');
68 keyboard;
69 
70 % mu-parameter variation: sets the fields of params:
71 % params.c_init = 0; params.beta = 1; params.k = 5e-8;
72 disp('Selection of mu and online-simulation');
73 set_mu(rmodel, [0.1,1,1,1]);
74 sim_data = rb_simulation(rmodel, reduced_data);
75 disp('Please type dbcont after inspecting the workspace variables');
76 keyboard;
77 
78 % reconstruction and plot of reduced simulation
79 disp('reconstruction of reduced simulation:');
80 sim_data = rb_reconstruction(rmodel,detailed_data,sim_data);
81 plot_sim_data(dmodel,model_data,sim_data,plot_params);
82 disp('Please type dbcont after inspecting the workspace variables');
83 keyboard;
84 
85 % complete interactive gui:
86 disp('complete interactive gui:');
87 demo_rb_gui(rmodel,detailed_data,[],plot_params);
88 
function [ dmodel , rmodel ] = gen_models(ModelDescr descr,BasisGenDescr bg_descr)
generates an IDetailedModel and an IReducedModel instance from description structures.
Definition: gen_models.m:17
function demo_rb_steps_oop()
small collection of RBmatlab's rb-simulation abilities please inspect the source-file during executio...
function demo_rb_gui(varargin)
reduced basis demo with sliders
Definition: demo_rb_gui.m:17
function demo_rb_steps_struct()
small collection of RBmatlab's rb-simulation abilities please inspect the source-file during executio...
function p = plot_sim_data(model, model_data, sim_data, plot_params)
function performing the plot of the simulation results as specified in model.
Definition: plot_sim_data.m:17
function model = thermalblock_model(params)
Thermal Block example similar as described in the book of A.T. patera and G. Rozza (just one paramete...
function p = plot(params)
plot of a rectgrid via plot_polygon_grid()
Definition: plot.m:18
function res = thermalblock(step, params)
thermalblock example
Definition: thermalblock.m:17