1 % small script performing one time step in linear and nonlinear
2 % mode and comparing the error. The error should ideally only be in the
5 % Bernard Haasdonk 21.5.2007
7 % setup parameters, that switching between lin-evol and nonlin-evol
9 load demo_nonlin_evol_params
10 params.operators_algorithm = 'fv_operators_implicit_explicit';
11 %params.T = 100*params.T/params.nt;
13 params.c_init = 1; % in
case of no structure
16 %
get solution in linear
case:
17 params.rb_problem_type =
'lin_evol';
18 grid = construct_grid(params);
19 Ulin = detailed_simulation(grid,params);
21 %
get solution in nonlinear-case
22 params.rb_problem_type = 'nonlin_evol';
23 Unonlin = detailed_simulation(grid,params);
26 if ~isequal(Ulin(:,1),Unonlin(:,1))
27 error('initial data does not correspond!!');
31 params.title = 'difference Unonlin-Ulin';
32 plot_element_data_sequence(grid,Unonlin-Ulin,params);
34 disp('detailed_simulation for lin_evol and nonlin_evol give');
35 if max(max(abs(Unonlin-Ulin))) > 1e-14
36 disp('different results! Test failed');
38 disp('identical result! Test OK');
41 % TO BE ADJUSTED TO NEW SYNTAX