rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
demo_rb_riemann_burgers.m
Go to the documentation of this file.
2 %
3 % Script demonstrating the RB-model for the discontinuous
4 % initial data for the nonlinear burgers equation.
5 % Both moving shock front and rarefaction waves can be modelled.
6 % discretization is with explicit fv scheme and empirical
7 % interpolation of the space operator.
8 % The model demonstrates the space-dimension reduction: the
9 % subgrid that is extracted in the offline phase is exactly the row
10 % of cells along the bottom line.
11 %
12 % To start: set u_left or u_right to some different value.
13 % Then observe either a moving shock or a rarefaction wave
14 % depending on the direction of the velocity.
15 
16 % Bernard Haasdonk 10.9.2008
17 
19 
20 detailedfname = 'riemann_burgers_detailed.mat';
21 load(detailedfname);
22 
23 % change/add some settings, if datafile has been generated by earlier versions
24 %extend = 1;
25 extend = 0;
26 if extend
27  detailed_data.grid = construct_grid(model);
28  % detailed_data.grid = extend_class_from_struct('triagrid',detailed_data.grid);
29  model.newton_solver = 0;
30  model.implicit_nonlinear = 0;
31  model.local_stencil_size = 1;
32  model.get_rb_size = @get_rb_size_default;
33  model.enable_error_estimator = 0;
34  model.get_mu = @get_mu_default;
35  % plot_params.axis_equal = 1;
36  % plot_params.axis_tight = 1;
37 % save(fullfile(rbmatlabhome,'demos','datafiles',detailedfname),'detailed_data','plot_params','model');
38 end;
39 
40 %[model,detailed_data,plot_params] = renew_model(model,detailed_data);
41 
42 %model = riemann_burgers_model;
43 
44 %model.N = model.get_rb_size(model,detailed_data);
45 %size(detailed_data.RB,2);
46 %model.M = size(detailed_data.QM{1},2);
47 
48 rb_plot_interpolation_points(detailed_data,model);
49 
50 %model.gen_reduced_data = @nonlin_evol_gen_reduced_data;
51 %model.rb_operators = @nonlin_evol_rb_operators;
52 %rb_plot_interpolation_points(detailed_data,model);
53 %model.set_time = @set_time_default;
54 %model.set_mu = @set_mu_default;
55 %model.reduced_data_subset = @nonlin_evol_reduced_data_subset;
56 %%model.rb_simulation = @nonlin_evol_rb_simulation;
57 
58 % temporary: transform to "model"
59 % [model, detailed_data, plot_params] = renew_model(params, detailed_data);
60 
61 demo_rb_gui(model,detailed_data); %,[],plot_params,'riemann burgers');
62 
function reduced_data = nonlin_evol_gen_reduced_data(model, detailed_data, params)
method which produces reduced_data, which is the data, that will be passed to an online-algorithm.
function demo_rb_gui(varargin)
reduced basis demo with sliders
Definition: demo_rb_gui.m:17
function demo_rb_riemann_burgers()
demo_rb_riemann_burgers
function reduced_data_subset = nonlin_evol_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 [ nmodel , nddata , plot_params ] = renew_model(model, detailed_data)
change fields of old param structure to new model structure with excessive use of function pointers...
Definition: renew_model.m:17