1 classdef Interface < handle
2 % %Interface
class for all kind of reduced basis generation algorithms
6 properties (Abstract, SetAccess=
private, Dependent)
8 %
string specifying the detailed data produced by
this basis generation
11 % This should be one of
12 % -
'ei' :
for empirical interpolation basis
13 % -
'rb' :
for reduced basis
14 % -
'eirb' :
for combination fo empirical interpolation and reduced basis
17 % This is an
id string inherited by the underlying extension algorithm
20 % At the moment
this id is not used.
25 properties (SetAccess =
protected)
26 % control variable of type
boolean variable controlling whether check
27 % points shall be created after every reduced basis extension step.
28 enable_checkpointing =
true;
33 function summ = horzcat(varargin)
34 %
function summ = horzcat(varargin)
35 % combines an arbitrary number of basis generation algorithms
38 % concatenation of basis generation objects.
42 % sum = [ [ ei_greedy1, ei_greedy2, ei_greedy3 ], rb_greedy ];
50 %
function this = set.Mstrich(
this, value)
51 % this.model.Mstrich = value;
52 %
if this.model.Mstrich == 0
53 % this.model.enable_error_estimator =
false;
55 % this.model.enable_error_estimator =
true;
60 function detailed_data = gen_detailed_data(
this, rmodel, detailed_data, checkpoint)
61 %
function detailed_data = gen_detailed_data(
this, rmodel, detailed_data, [checkpoint])
62 % main entry
function construction the detailed data tree storing the
63 % reduced basis functions.
65 % This method starts the reduced basis generation process, by calling the
66 %
abstract interface methods init_basis() and basis_extension()
67 % subsequently. If enable_checkpointing is set to
'true', checkpoint
68 % shall be created periodically storing all data necessary to resume from
69 %
this point in the algorithm, when the checkpoint is given as the
70 % optional third argument.
73 % rmodel:
object of type
IReducedModel providing descriptions of
74 % the entire model needed
for basis generation.
75 % detailed_data: either a
struct containing high dimensional model data
76 % needed to execute detailed simulations or an
object of
79 % checkpoint:
object of type
Greedy.
Checkpoint specifying a given point in the
80 % algorithm where it basis generation can be resumed.
84 % basis information in the
leaf nodes and information on
85 % the reduced basis generation in every node.
86 if nargin == 3 || isempty(checkpoint)
89 % is the initially generated reduced basis not yet stored in detailed_data?
90 if ~get(checkpoint, 'init_basis_computed', false)
91 prepare(this, rmodel, detailed_data);
92 detailed_data = init_basis(this, rmodel, detailed_data);
94 checkpoint = checkpoint.store(rmodel, detailed_data, 'gen_detailed_data', struct('init_basis_computed', true));
95 detailed_data = basis_extension(this, rmodel, detailed_data, checkpoint.child([]));
96 rmodel.N = get_rb_size(detailed_data);
97 %rmodel.M = get_ei_size(detailed_data) - rmodel.Mstrich;
105 % initialization routine for basis extension
107 % This method is run by the gen_detailed_data() method before the execution
108 % of the init_basis() methods and should be used for preparation purposes,
110 % - initialization of the training and validation parameter space and
111 % - caching detailed simulations if necessary.
112 prepare(this, rmodel, model_data);
114 % construction of an initial reduced basis
116 % This method is called at the beginning of the gen_detailed_data() method
117 % right after a call to prepare(). It should be used to construct an
118 % initial reduced basis, e.g. approximating the initial value functions in
119 % case of evolution problems.
122 % detailed_data:
object of type
Greedy.
DataTree.Detailed.INode storing the reduced
123 % basis information in the
leaf nodes and information on
124 % the reduced basis generation in every node.
125 detailed_data = init_basis(this, rmodel, model_data);
127 % basis extension routine
129 % This method is run by the gen_detailed_data() method at the very end, and
130 % shall actually construct the reduced basis.
133 % checkpoint: an
object of type
GreedyCheckpoint used for
137 % detailed_data:
object of type
Greedy.
DataTree.Detailed.INode storing the reduced
138 % basis information in the
leaf nodes and information on
139 % the reduced basis generation in every node.
140 detailed_data = basis_extension(this, rmodel, detailed_data, checkpoint);
142 % error indication routine
143 % [max_errs, max_err_sequence, max_mu_index] = error_indicators(this, detailed_data, parameter_set, reuse_reduced_data);
148 methods (Hidden = true)
149 function value = get_generated_basis_type(this)
150 % function value = get_generated_basis_type(this)
151 % returns the
#generated_basis_type property. Why???
152 value = this.generated_basis_type;
Interface class for extension algorithms which define the basis extension routines used by the abstra...
DataTree implementation for generated detailed and reduced data
combines two or more instances of a Greedy.Interface class by executing them subsequently.
Helper class used to store and restore data tree objects at specified checkpoints.
DataTree specialization for detailed data generated by a Greedy algorithm instance.
Specialization plugins for the greedy algorithm.
This is the interface for a reduced model providing methods to compute low dimensional reduced simula...
Interface class for general data tree nodes storing detailed data returned by Greedy.Interface.gen_detailed_data()
Customizable implementation of an abstract greedy algorithm.