2 %
class generating the reduced basis space for the
LinEvol problem with a
5 % Parameters given by the constructor argument
'bg_descr' of type
7 % - trainings sample (#train_sample_mode, #train_num_intervals, #train_seed)
8 % - trainings sample refinement (#refinement_mode, #val_size, #val_seed,
9 % #stop_max_val_train_ratio)
10 % - the error indicator (#indicator_mode)
11 % - general greedy controls (#Nmax, #stop_timeout, #stop_epsilon)
13 properties (Dependent, SetAccess=private)
14 % a basis generation algorithm of type
Greedy.Interface used to generated
15 % the reduced basis space.
19 properties (Access=private)
25 % flag indicating whether the parameter sampling for the training set
26 % `M_{\text{train}}` type.
31 train_sample_mode =
'uniform';
34 % set `M_{\text{train}}` of the parameter space `{\cal M}`.
35 train_num_intervals = 3;
38 %
for the training set `M_{\text{val}}` with size
'train_num_intervals' and
43 % validation set `M_{\text{val}}` with size
'val_size' and seed
'val_seed'.
47 % generated
for the validation set `M_{\text{val}}` with size
'val_size'
48 % and seed
'val_seed'.
57 indicator_mode =
'estimator';
67 % If
this value is set to something less than
'inf', parameter sampling
68 % adaptation should be activated, by setting the
'refinement_mode' to
69 %
'adaptive' or
'uniform'.
70 stop_max_val_train_ratio = 1;
74 % Possible values are:
75 % -
'uniform': the parameter sampling is refined uniformly
76 % -
'adaptive': the parameter sampling is refined adaptively, such that
77 % only regions of the parameter space with high estimated
80 refinement_mode =
'adaptive';
88 % constructor constructing the reduced basis spaces and storing it in a
98 if isa(rmodel,
'LinEvolDune.ReducedModel')
102 dd.datatree = gen_detailed_data(dd.bg_algorithm, rmodel, model_data);
110 function basis_gen = get.bg_algorithm(this)
111 % generates a default @ref
Greedy.Interface "basis generation
object" for
114 % This function generates a
Greedy.Interface implementation, with at least
115 % a POD-
Greedy extension algorithm for the reduced basis.
118 if isequal(this.train_sample_mode, 'uniform')
120 elseif isequal(this.train_sample_mode, 'random')
123 error('unknown train_sample_mode');
132 rb_extension =
Greedy.Plugin.PODDune(this.rb_generator);
134 rb_extension =
Greedy.Plugin.POD(this.rb_generator);
136 rb_extension.stop_Nmax = this.Nmax;
137 % decide, whether estimator or true error is error-indicator for greedy
138 rb_extension.indicator_mode = this.indicator_mode; %'estimator'; % Delta from rb_simulation
140 pod_greedy =
Greedy.Algorithm(rb_extension, M_train, M_val);
141 pod_greedy.stop_timeout = this.stop_timeout; % 60*60;
142 pod_greedy.stop_epsilon = this.stop_epsilon; % 1e-9; % 0.003 is already realized by init data!!
143 pod_greedy.stop_max_val_train_ratio = this.stop_max_val_train_ratio; % 1.00;
145 if ~isequal(this.refinement_mode, 'none')
146 basis_gen =
Greedy.TrainingSetAdaptation(pod_greedy);
147 basis_gen.refinement_mode = this.refinement_mode;
149 basis_gen = pod_greedy;
154 function rb_size = get_rb_size(this, rmodel)
155 leaf_dd = get_leaf(this, rmodel);
156 rb_size = get_rb_size(leaf_dd);
reduced model for linear evolution problems as given by a LinEvol.DetailedModel.
refinement_mode
string specifying the method type for the adaptation of the parameter sampling. uniform or adaptive ...
Implementation of a SnapshotsGenerator.Cached for reduced basis generation. The generate() method ret...
stop_max_val_train_ratio
positive double value specifying the maximum ratio between the maximum error indicator over the valid...
Reduced basis implementation for linear evolution equations.
Struct with control fields for the reduced basis generation.
stop_epsilon
double specifying the maximum error indicator for which the basis generation shall be stopped...
extension class implementing the POD-greedy algorithm extension routines
stop_timeout
integer specifying the number of seconds after which the basis generation shall be stopped...
stop_Nmax
maximum number of generated reduced basis vectors.
an interface specialization for detailed data objects used with the Greedy algorithm.
Interface classes to be implemented by the Greedy.Algorithm user.
Cacheable generators of detailed data snapshots.
Parameter sampling class producing randomly distributed parameter samples in sparameter space ...
greedy basis generation extension which adaptively refines the trainings parameter set...
class generating the reduced basis space for the LinEvol problem with a Greedy algorithm.
indicator_mode
string specifying which indicators shall be used by the error_indicators() method.
Customizable implementation of an abstract greedy algorithm.
Detailed model for a linear evolution problem with a Finite volume discretization.