rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
demo_rb_steps_struct.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 struct
7 % version of models. As example a thermalblock model is
8 % used.
9 %
10 % See also
11 % demo_rb_steps_oop.m for the same steps using a object-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 model = thermalblock_model_struct(params)
33 disp('Please type dbcont after inspecting the workspace variables');
34 keyboard;
35 
36 % generate model_data
37 disp('generation of model_data (grid, fem-info, etc.):');
38 model_data = gen_model_data(model)
39 disp('Please type dbcont after inspecting the workspace variables');
40 keyboard;
41 
42 % perform detailed simulation and plot
43 plot_params = [];
44 plot_params.axis_equal = 1;
45 plot_params.axis_tight = 1;
46 sim_data = detailed_simulation(model,model_data)
47 plot_sim_data(model,model_data,sim_data,plot_params);
48 disp('Please type dbcont after inspecting the workspace variables');
49 keyboard;
50 
51 % generation of high dimensional offline data for RB-scheme
52 disp('computation of high dimensional offline-data (basis by greedy):');
53 detailed_data = gen_detailed_data(model,model_data)
54 disp('Please type dbcont after inspecting the workspace variables');
55 keyboard;
56 
57 % generation of low dimensional offline data for RB-scheme
58 disp('computation of low dimensional offline-data:');
59 reduced_data = gen_reduced_data(model,detailed_data)
60 disp('Please type dbcont after inspecting the workspace variables');
61 keyboard;
62 
63 % perform online simulation
64 model.N = 4
65 reduced_data = model.reduced_data_subset(model,reduced_data)
66 disp('Please type dbcont after inspecting the workspace variables');
67 keyboard;
68 
69 % mu-parameter variation: sets the fields of params:
70 % params.c_init = 0; params.beta = 1; params.k = 5e-8;
71 disp('Selection of mu and online-simulation');
72 set_mu(model, [0.1,1,1,1]);
73 sim_data = rb_simulation(model, reduced_data)
74 disp('Please type dbcont after inspecting the workspace variables');
75 keyboard;
76 
77 % reconstruction and plot of reduced simulation
78 disp('reconstruction of reduced simulation:');
79 sim_data = rb_reconstruction(model,detailed_data,sim_data)
80 plot_sim_data(model,model_data,sim_data,plot_params);
81 disp('Please type dbcont after inspecting the workspace variables');
82 keyboard;
83 
84 % complete interactive gui:
85 disp('complete interactive gui:');
86 demo_rb_gui(model,detailed_data,[],plot_params);
87 
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 model = thermalblock_model_struct(params)
Thermal Block example similar as described in the book of A.T. patera and G. Rozza (just one paramete...
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 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