default greedy basis generation class
This implements an abstract version of the default greedy algorithm for reduced basis and empirical interpolation basis generation. The actual implementation of the extension and checking and error evaluation routines is delegated to an underlying object implementing a Greedy.Plugin.Interface. See (M2) Reduced basis generation for example usage information.
The entry point for the greedy algorithm is the method basis_extension(). See there for more details on the algorithm
Definition at line 18 of file Algorithm.m.
Public Member Functions | |
Algorithm (Greedy.Plugin.Interface detailed_extension,ParameterSampling.Interface M_train,ParameterSampling.Interface initial_val_param_set) | |
constructor for a greedy basis generation algorithm More... | |
function
enabled = | enable_validation (Greedy.DataTree.Detailed.ILeafNode detailed_data) |
indicates whether the validation routines shall be executed More... | |
function
detailed_data_tree = | basis_extension (IReducedModel rmodel, detailed_data_tree,Greedy.Checkpoint checkpoint) |
greedy basis generation extension More... | |
function [
max_errs , max_err_sequence , max_mu_index ] = | error_indicators (IReducedModel rmodel,Greedy.DataTree.Detailed.INode detailed_data_tree, parameter_set, reuse_reduced_data) |
routine computing the error indicators More... | |
function | prepare (IReducedModel rmodel,ModelData model_data) |
initialization routine for basis extension More... | |
function
detailed_data_tree = | init_basis (Greedy.User.IReducedModel rmodel,ModelData model_data) |
construction of an initial reduced basis More... | |
Public Member Functions inherited from Greedy.Interface | |
function Greedy.Combined summ = | horzcat () |
combines an arbitrary number of basis generation algorithms More... | |
function
detailed_data = | gen_detailed_data (IReducedModel rmodel, detailed_data,Greedy.Checkpoint checkpoint) |
main entry function construction the detailed data tree storing the reduced basis functions. More... | |
virtual function
Greedy.DataTree.Detailed.INode detailed_data = | init_basis (IReducedModel rmodel,ModelData model_data) |
construction of an initial reduced basis More... | |
virtual function
Greedy.DataTree.Detailed.INode detailed_data = | basis_extension (IReducedModel rmodel,Greedy.DataTree.Detailed.INode detailed_data, checkpoint) |
basis extension routine More... | |
function value = | get_generated_basis_type () |
returns the generated_basis_type property. Why??? More... | |
Public Attributes | |
SnapshotsGenerator.Cached | detailed_gen |
an object More... | |
generated_basis_type | |
string specifying the detailed data produced by this basis generation algorithm object. More... | |
id | |
string specifying the detailed data produced by this basis generation algorithm object. More... | |
Greedy.Plugin.Interface | detailed_extension |
object More... | |
stop_epsilon = 1e-2 | |
double specifying the maximum error indicator for which the basis generation shall be stopped. More... | |
stop_timeout = inf | |
integer specifying the number of seconds after which the basis generation shall be stopped. More... | |
stop_max_val_train_ratio = inf | |
positive double value specifying the maximum ratio between the maximum error indicator over the validation paramter set and the maximum error over the trainining parameter set, for which the basis generation is stopped. More... | |
val_train_ratio_seq_for_break = 1 | |
number of subsequent cases where the max_err_val_train_ratio is too high that is needed in order to break with a Greedy.Info.Base.stop_max_val_train_ratio condition. More... | |
ParameterSampling.Interface | M_train = ParameterSampling.Uniform("1") |
object defining the training parameter set \(M_{\text{train}} \subset \cal M\) More... | |
ParameterSampling.Interface | M_validation = "[]" |
object defining the validation parameter set \(M_{\text{val}} \subset \cal M\) More... | |
Public Attributes inherited from Greedy.Interface | |
generated_basis_type | |
string specifying the detailed data produced by this basis generation algorithm object. More... | |
id | |
This is an id string inherited by the underlying extension algorithm object implementing a Greedy.Plugin.Interface. More... | |
boolean | enable_checkpointing = true |
control variable variable controlling whether check points shall be created after every reduced basis extension step. More... | |
Static Public Attributes | |
static const | info_fields |
cell array of fields to be copied to the detailed data leaf node instance during init_basis(). More... | |
Greedy.Algorithm.Algorithm | ( | Greedy.Plugin.Interface | detailed_extension, |
ParameterSampling.Interface | M_train, | ||
ParameterSampling.Interface | initial_val_param_set | ||
) |
constructor for a greedy basis generation algorithm
This constructs a greedy basis generation algorithm using the following
detailed_extension | the underlying object |
M_train | an object specifying an initial training parameter set. |
initial_val_param_set | an object specifying an initial validation parameter set. |
Definition at line 189 of file Algorithm.m.
function detailed_data_tree = Greedy.Algorithm.basis_extension | ( | IReducedModel | rmodel, |
detailed_data_tree, | |||
Greedy.Checkpoint | checkpoint | ||
) |
greedy basis generation extension
detailed_data_tree
should be initialized via by the init_basis() method.During each extension step, the methods from the underlying detailed_extension are called in this order:
get_field(detailed_data,
'stop_epsilon
')
,get_field(detailed_data,
'stop_max_val_train_ratio
')
rmodel | object specifying how the reduced simulations can be computed. |
detailed_data_tree | either a struct containing high dimensional model data needed to execute detailed simulations or an object of type Greedy.DataTree.Detailed.INode in case of resume from a checkpoint. |
checkpoint | object specifying a given point in the algorithm where it basis generation can be resumed. |
detailed_data_tree | object storing the reduced basis information in the leaf nodes and information on the reduced basis generation in every node. |
N —
N M —
Mstore —
store Definition at line 262 of file Algorithm.m.
function enabled = Greedy.Algorithm.enable_validation | ( | Greedy.DataTree.Detailed.ILeafNode | detailed_data | ) |
indicates whether the validation routines shall be executed
This method returns true when a validation parameter set is given and the property stop_max_val_train_ratio is not set to inf
detailed_data | object defining the basis generation algorithm and storage for storing high dimensional data, i.e. dependent on dimension \(H\). This data is necessary for detailed simulations, construction of online matrices, reduced_data and reconstruction of reduced simulations. |
enabled | boolean value |
Definition at line 213 of file Algorithm.m.
function [ max_errs , max_err_sequence , max_mu_index ] = Greedy.Algorithm.error_indicators | ( | IReducedModel | rmodel, |
Greedy.DataTree.Detailed.INode | detailed_data_tree, | ||
parameter_set, | |||
reuse_reduced_data | |||
) |
routine computing the error indicators
rmodel | object specifying how the reduced simulations can be computed. |
detailed_data_tree | an object storing the reduced basis functions in the leaf nodes. |
parameter_set | A matrix of dimension \(\text{npar} \times \dim(\cal M)\) containing in each row a parameter vector for which the error indicator should be computed. |
reuse_reduced_data | boolean flat indicating whether it is necessary to recompute the reduced data or whether it should still be valid since the last call to error_indicators(). |
max_errs | For transient problems this returns the error sequence over time for the parameter max_mu_index with the worst error. |
max_err_sequence | a vector of the same length as the number of training set parameters, contining the maximum error in the error sequence over time for each of those parameters. |
max_mu_index | the parameter index of the parameter \(\mu_{\max}\) in the training set. |
Definition at line 410 of file Algorithm.m.
function detailed_data_tree = Greedy.Algorithm.init_basis | ( | Greedy.User.IReducedModel | rmodel, |
ModelData | model_data | ||
) |
construction of an initial reduced basis
construction of an initial reduced basis This method is called at the beginning of the gen_detailed_data() method right after a call to prepare(). It should be used to construct an initial reduced basis, e.g. approximating the initial value functions in case of evolution problems.
rmodel | object specifying how the reduced simulations can be computed. |
model_data | Matlab structure storing (possibly) high dimensional data needed by IDetailedModel.detailed_simulation(). |
detailed_data | object storing the reduced basis information in the leaf nodes and information on the reduced basis generation in every node. |
Definition at line 506 of file Algorithm.m.
|
virtual |
initialization routine for basis extension
This method is run by the gen_detailed_data() method before the execution of the init_basis() methods and should is used for preparation purposes of
rmodel | object specifying how the reduced simulations can be computed. |
model_data | Matlab structure storing (possibly) high dimensional data needed by IDetailedModel.detailed_simulation(). |
detailed_model —
detailed model Implements Greedy.Interface.
Definition at line 447 of file Algorithm.m.
Greedy.Algorithm.detailed_extension |
object
SetAccess = Private, GetAccess = Public
Definition at line 101 of file Algorithm.m.
Greedy.Algorithm.detailed_gen |
an object
This object is inherited from the detailed_extension.
Dependent
set to true. Definition at line 56 of file Algorithm.m.
Greedy.Algorithm.generated_basis_type |
string specifying the detailed data produced by this basis generation algorithm object.
string specifying the detailed data produced by this basis generation algorithm object. This should be one of
ei
: for empirical interpolation basisrb
: for reduced basiseirb
: for combination fo empirical interpolation and reduced basisDependent
set to true. SetAccess = Private, GetAccess = Public
Dependent
set to true. SetAccess = Private, GetAccess = Public
Definition at line 71 of file Algorithm.m.
Greedy.Algorithm.id |
string specifying the detailed data produced by this basis generation algorithm object.
This is an id string inherited by the underlying extension algorithm object implementing a Greedy.Plugin.Interface. At the moment this id is not used.
Dependent
set to true. SetAccess = Private, GetAccess = Public
Dependent
set to true. SetAccess = Private, GetAccess = Public
Definition at line 85 of file Algorithm.m.
|
static |
cell array of fields to be copied to the detailed data leaf node instance during init_basis().
Default: {" 'M_train', 'M_validation', \ 'stop_epsilon', 'stop_max_val_train_ratio', \ 'val_train_ratio_seq_for_break', \ 'stop_timeout' "}
Definition at line 38 of file Algorithm.m.
Greedy.Algorithm.M_train = ParameterSampling.Uniform("1") |
object defining the training parameter set \(M_{\text{train}} \subset \cal M\)
Default: ParameterSampling.Uniform("1")
Definition at line 167 of file Algorithm.m.
Greedy.Algorithm.M_validation = "[]" |
object defining the validation parameter set \(M_{\text{val}} \subset \cal M\)
Default: "[]"
Definition at line 177 of file Algorithm.m.
Greedy.Algorithm.stop_epsilon = 1e-2 |
double specifying the maximum error indicator for which the basis generation shall be stopped.
Default: 1e-2
Definition at line 115 of file Algorithm.m.
Greedy.Algorithm.stop_max_val_train_ratio = inf |
positive double value specifying the maximum ratio between the maximum error indicator over the validation paramter set and the maximum error over the trainining parameter set, for which the basis generation is stopped.
Note, that M_validation needs to be non-empty, if this value is set to something different than inf
.
Default: inf
Definition at line 135 of file Algorithm.m.
Greedy.Algorithm.stop_timeout = inf |
integer specifying the number of seconds after which the basis generation shall be stopped.
Default: inf
Definition at line 125 of file Algorithm.m.
Greedy.Algorithm.val_train_ratio_seq_for_break = 1 |
number of subsequent cases where the max_err_val_train_ratio is too high that is needed in order to break with a Greedy.Info.Base.stop_max_val_train_ratio condition.
The default is 1
, but especially for basis generation with Greedy.Plugin.PODEI extension algorithm, it is a good idea to set it to at least 2
, because this algorithms can produce very strange basis spaces in between.
Default: 1
Definition at line 150 of file Algorithm.m.