rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
nonlin_symmetry_descr.m
1 function descr=nonlin_symmetry_descr(params)
2 % function descr=nonlin_symmetry_model(params)
3 %
4 % optional fields of params:
5 % size: problem size ( 0.1, 0.2, 0.5, 1, 2, 3, ... )
6 
7 if nargin < 1 || ~isfield(params, 'size')
8  params.size = 1;
9 end
10 
11 descr = NonlinEvol.descr_default;
12 descr.rb_problem_type = 'NonlinEvol';
13 
14 descr.name = 'nonlin_symmetry';
15 descr.gridtype = 'rectgrid';
16 descr.xnumintervals = 120 * params.size;
17 descr.ynumintervals = 60 * params.size;
18 descr.xrange = [0,2];
19 descr.yrange = [0,1];
20 
21 % set all to neuman-boundary by specifying "rectangles", all
22 % boundary within is set to boundary type
23 %descr.bnd_rect_corner1 = [-1; ...
24 % -1];
25 %descr.bnd_rect_corner2 = [ 2; ...
26 % 2];
27 
28 % -1 means dirichlet, -2 means neumann
29 %descr.bnd_rect_index = [-2]; % first is dirichlet, second neuman
30 
31 % time discretization
32 descr.T = 0.3;
33 descr.nt = 100 * params.size; % guess and adjust later
34 %descr.nt = 25 * params.size; % guess and adjust later
35 
36 %descr.T = 0.4;
37 %descr.nt = 80; % guess and adjust later
38 %descr.nt = 100; % guess and adjust later
39 %descr.T = 0.1;
40 %descr.nt = 50; % guess and adjust later
41 %descr.400 => non-bounded u
42 
43 % output settings
44 descr.verbose = 1;
45 descr.debug = 0;
46 
47 % data functions
48 %descr.name_init_values = 'blobs';
49 %descr.radius = 0.1;
50 %descr.gamma = 100;
51 %descr.beta = 1; % init data weight between 0 and 1
52 
53 % name of function in rbmatlab/datafunc/init_values
54 descr.init_values_ptr = @init_values_waveproduct;
55 % parameters for data functions
56 descr.c_init_min = 0.0;
57 descr.c_init_max = 1.0;
58 descr.c_init_phase_x = 0.0;
59 descr.c_init_phase_y = 0.0;
60 descr.c_init_freq_x = 2*pi;
61 descr.c_init_freq_y = 2*pi;
62 %descr.c_init_lo = 1.0;
63 %descr.c_init_lo = 0.0;
64 %descr.c_init_lo = -1.0;
65 
66 % name of function in RBmatlab/datafunc/dirichlet_values
67 %descr.name_dirichlet_values = 'homogeneous';
68 %descr.c_dir = 0;
69 
70 % name of function in RBmatlab/datafunc/neuman_values
71 %descr.name_neuman_values = 'homogeneous';
72 %descr.c_neu = 0;
73 
74 %descr.name_neuman_values = 'homogeneous';
75 %descr.c_neu = 0;
76 
77 % convective flux
78 %descr.name_flux = 'burgers_parabola';
79 descr.conv_flux_ptr = @conv_flux_burgers;
80 %| \todo this could also be done explicitly (analytic derivative)
81 descr.conv_flux_derivative_ptr = @conv_flux_forward_difference;
82 % for simplifying computation in case of linear flux:
83 descr.flux_linear = 0;
84 % diagonal velocity field
85 descr.flux_vx = 1;
86 descr.flux_vy = 1;
87 %descr.flux_quad_degree = 2;
88 descr.flux_pdeg = 1; % burgers exponent
89 
90 % rb-formulation
91 %descr.mu_names = {'c_init_lo','vrot_angle'};
92 descr.mu_names = {'flux_pdeg'};
93 descr.mu_ranges = {[1,2]};
94 
95 % finite volume settings
96 %descr.name_convective_num_flux = 'lax-friedrichs';
97 %descr.lxf_lambda = 1.66
98 %descr.lxf_lambda = 1.25;
99 %descr.lxf_lambda = 0.35355;
100 %descr.lxf_lambda = fv_search_max_lxf_lambda([],model);
101 %keyboard;
102 descr.stencil_mode = 'edge';
103 descr.local_stencil_size = 1;
104 descr.implicit_nonlinear = false;
105 
106 descr.num_conv_flux_ptr = @fv_num_conv_flux_engquist_osher;
107 if params.explicit
108  descr.fv_expl_conv_weight = 1.0;
109  descr.fv_impl_conv_weight = 0.0;
110  descr.ei_space_operators = { descr.L_E_local_ptr };
111  descr.newton_solver = false;
112 else
113  descr.fv_expl_conv_weight = 0.0;
114  descr.fv_impl_conv_weight = 1.0;
115  descr.ei_space_operators = { descr.L_I_local_ptr };
116  descr.newton_solver = true;
117 end
118 descr.newton_steps = 60;
119 descr.operators_conv_implicit = ...
121 descr.implicit_gradient_operators_algorithm = ...
123 
124 % projection of analytical initial data to discrete function
125 descr.init_values_algorithm = @fv_init_values;
126 descr.implicit_operators_algorithm = @fv_operators_implicit;
127 % get mass matrix for inner product computation from DOF-vectors
128 descr.data_const_in_time = 1;
129 
130 descr.flux_quad_degree = 1;
131 
132 % settings for reduced basis generation
133 %descr.operators_algorithm = 'fv_operators_implicit_explicit';
134 %descr.init_values_algorithm = 'fv_init_values';
135 %descr.inner_product_matrix_algorithm = 'fv_inner_product_matrix';
136 %descr.lxf_lambda = 1.0194e+003;
137 %descr.data_const_in_time = 1;
138 descr.error_norm = 'l2';
139 % 'RB_extension_max_error_snapshot'};
140 
141 descr.t = 0;
142 descr.dt = descr.T/descr.nt;
143 descr.tstep = 1;
144 descr.decomp_mode = 0;
145 
146 descr.orthonormalize = @model_orthonormalize_qr;
147 descr.plot = @fv_plot;
148 %descr.mu = zeros(size(model.mu_names));
149 
150 descr.enable_error_estimator = 1;
151 descr.Mstrich = 1;
152 
153 descr.ei_numintervals = [9]; % 8x8 parameter grid
154 descr.RB_stop_timeout = 2*60*60; % 2 hours
155 descr.RB_stop_epsilon = 1e-5;
156 descr.RB_error_indicator = 'error'; % true error
157 %descr.RB_error_indicator = 'estimator'; % Delta from rb_simulation
158 descr.RB_stop_Nmax = 135;
159 descr.RB_train_numintervals = descr.ei_numintervals;
160 %descr.ei_time_indices = 1:model.nt+1;
161 %descr.Mmax = 160; % take 150 for sim, 10 for error-est
162 %descr.CRB_generation_mode = 'param-time-space-grid';
163 %descr.ei_target_error = 'interpol';
164 
165 %| \docupdate
function [ L_E_conv , bdir_E_conv ] = fv_operators_conv_explicit_engquist_osher(model, model_data, U, NU_ind)
computes convection contribution to finite volume time evolution matrices, or their Frechet derivati...
function Udirichlet = dirichlet_values(model, X, Y)
UDIRICHLET = DIRICHLET_VALUES([X],[Y], MODEL) Examples dirichlet_values([0,1,2],[1,1,1],struct(name_dirichlet_values, homogeneous, ... c_dir, 1)) dirichlet_values([0:0.1:1],[0],struct(name_dirichlet_values, xstripes, ... c_dir, [0 1 2], ... dir_borders, [0.3 0.6])) dirichlet_values([0:0.1:1],[0],struct(name_dirichlet_values, box, ... c_dir, 1, ... dir_box_xrange, [0.3 0.6], ... dir_box_yrange, [-0.1 0.1]))
function p = fv_plot(gridbase grid, dofs, params)
routine plotting a single fv function of fv_functions.
Definition: fv_plot.m:17
function num_flux = fv_num_conv_flux_engquist_osher(model, model_data, U, NU_ind)
Function computing a numerical convective Engquist-Osher flux matrix.