1 function t_model = t_part_model(model, params)
2 %
function t_model = t_part_model(model, params)
4 % model
for t-partition inheriting infos from base_model
5 % In
this model layer the repartition of the time domain is fixed.
7 % The implementation of the evolution scheme must accept fields
8 % model.starting_time_step and model.stopping_time_step to enable
9 % simulations restrained to specigfic partitions.
11 % The field
'basis_vector_overlap' fixes how many
12 % POD-Vectors/overlap-vectors are used
for the initial basis in the
13 % following partition.
14 % The field
't_part_rb_generation_cut_error' should be set to 1. It fixes
15 % that only the error produced in the actual partition is regarded during
16 % the basis generation process.
19 % Optional fields of params:
20 % transisition_model:
if this flag is set, then the projection between
21 % the reduced spaces is replaced by a transition
22 % phase (including projeciton in evolution
23 % step)(automatic creation only implemented
for first
24 % order time integration)
25 % no_middle_point_bisection:
if flag is set to one, the bisection is
26 % done, where half the error is reached.
28 % t_part_rb_generation_mode:
'fixed' or
'adaptive_error_restriction'
30 % Generated fields of t_model:
31 % t_part_range: cell-array giving the first and the last time step index in
32 % the respective time domain
33 % t_part_transition_range: cell-array giving the first and the last
34 % time step index of the transisiotn range
35 % between t-domains. (In Euler-time
36 % integrations the length of
this range is
40 % Markus Dihlmann 11.02.11
46 if isfield(params,
'transition_model')
47 if params.transition_model
53 %copy basically all information from the base model in the t-model (for
54 %basis generation this info is neccessary.)
57 t_model.t_part_middle_point_bisection=1;
63 if isfield(params,'no_middle_point_bisection')
64 if params.no_middle_point_bisection
65 t_model.t_part_middle_point_bisection=0;
69 if isfield(params,'t_part_rb_generation_mode')
70 t_model.t_part_rb_generation_mode = params.t_part_rb_generation_mode;
72 t_model.t_part_rb_generation_mode='adaptive_error_restriction';
75 %copy basically all information from the base model in the t-model (for
76 %basis generation this info is neccessary.)
79 t_model.base_model = model;
80 t_model.transition_model = transition_model;
81 %t_model.model_type = 't-part model';
83 %copy time information from model
85 %t_model.nt = model.nt;
86 %t_model.dt = model.dt;
87 %t_model.base_model.save_time_indices = 0:model.nt;
88 %t_model.mu_names = model.mu_names;
89 %t_model.mu_ranges = model.mu_ranges;
91 t_model.set_mu=@set_mu_in_model_and_base_model;
93 %Time domain information
94 %-----------------------
96 if (nargin==1)||(~isfield(params,'t_part_range'))
97 %initial t_part_model with only one time domain
98 t_model.t_part_range{1} = [0,t_model.nt];
100 %taking repartition of time domain from params
101 t_part_range = params.t_part_range;
102 t_model.t_part_range = t_part_range;
103 %fixing transisiton ranges (ranges between time domains)
104 if ~isfield(params,
't_part_transition_range')&&(length(t_part_range)>1)
106 %t_model.rb_operators = @rb_operators_t_part;
107 for i=2:(length(t_part_range))
108 %t_model.t_part_range{i} = [t_part_range{i}(1)+1,t_part_range{i}(2)];
109 t_model.t_part_transition_range{i-1} = [t_part_range{i-1}(2), t_part_range{i}(1)+1];
114 t_model.t_part_transition_range=params.t_part_transition_range;
122 % main
function pointers
123 t_model.gen_model_data = @t_part_gen_model_data;
124 t_model.detailed_simulation = @t_part_detailed_simulation;
125 t_model.gen_reduced_data = @t_part_gen_reduced_data;
126 t_model.rb_simulation = @t_part_rb_simulation;
128 t_model.plot_sim_data = model.plot_sim_data;
129 t_model.gen_detailed_data = @t_part_gen_detailed_data;
132 %RB_generation fields
133 %t_model.t_part_rb_generation_mode =
'fixed'; %
'adaptive'
134 t_model.t_part_rb_generation_cut_error = 1; %
if set, only the error produced in the actual partition is used in greedy algorithm
135 t_model.basis_vector_overlap = 5; %how many basis vectors are used from the foregoing t-part RB as initial basis in the next
137 t_model.get_estimator_from_sim_data = model.get_estimator_from_sim_data;
138 t_model.RB_stop_epsilon_global = model.RB_stop_epsilon;
139 t_model.t_part_middle_point_bisection=1;
function reduced_data_sub = t_part_reduced_data_subset(model, reduced_data)
reduced_data)
function sim_data = t_part_rb_reconstruction(model, detailed_data, sim_data)
sim_data)