rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
List of all members | Public Member Functions | Public Attributes | Static Public Attributes
Greedy.Algorithm Class Reference

Detailed Description

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.

Inheritance diagram for Greedy.Algorithm:
Inheritance graph
[legend]
Collaboration diagram for Greedy.Algorithm:
Collaboration graph
[legend]

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...
 

Constructor & Destructor Documentation

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

Parameters
detailed_extensionthe underlying object
M_trainan object specifying an initial training parameter set.
initial_val_param_setan object specifying an initial validation parameter set.

Definition at line 189 of file Algorithm.m.

Member Function Documentation

function detailed_data_tree = Greedy.Algorithm.basis_extension ( IReducedModel  rmodel,
  detailed_data_tree,
Greedy.Checkpoint  checkpoint 
)

greedy basis generation extension

Precondition
If required by the error_indicators() routine, the method prepare() should have been called beforehand
The argument 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:

  1. The maximum error indicators are gather by calling error_indicators() for the training set parameters, and if existent also vor the validation set parameters.
  2. Before the actual basis extension, we check whether any termination condition has been reached by computing some default checks documented below and extension specific checks in pre_check_for_end().
  3. For the worst approximated parameter a basis extension call is initiated by calling the method basis_extension().
Default checks
By default this methods checks
  • whether maximum value for the error indicator dropped below the value of get_field(detailed_data, 'stop_epsilon'),
  • whether the timeout barrier stop_timeout has been reached, or
  • whether the ratio between the maximum error indicators over the training set and the validation set exceeds the barrier of get_field(detailed_data, 'stop_max_val_train_ratio')
Parameters
rmodelobject specifying how the reduced simulations can be computed.
detailed_data_treeeither 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.
checkpointobject specifying a given point in the algorithm where it basis generation can be resumed.
Return values
detailed_data_treeobject storing the reduced basis information in the leaf nodes and information on the reduced basis generation in every node.
Required fields of rmodel:
  • N —  N
  • M —  M
Required fields of checkpoint:
  • store —  store

Definition at line 262 of file Algorithm.m.

Here is the call graph for this function:

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

Parameters
detailed_dataobject 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.
Return values
enabledboolean value

Definition at line 213 of file Algorithm.m.

Here is the caller graph for this function:

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

Parameters
rmodelobject specifying how the reduced simulations can be computed.
detailed_data_treean object storing the reduced basis functions in the leaf nodes.
parameter_setA 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_databoolean 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().
Return values
max_errsFor transient problems this returns the error sequence over time for the parameter max_mu_index with the worst error.
max_err_sequencea 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_indexthe parameter index of the parameter \(\mu_{\max}\) in the training set.

Definition at line 410 of file Algorithm.m.

Here is the caller graph for this function:

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.

Parameters
rmodelobject specifying how the reduced simulations can be computed.
model_dataMatlab structure storing (possibly) high dimensional data needed by IDetailedModel.detailed_simulation().
Return values
detailed_dataobject 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.

function Greedy.Algorithm.prepare ( IReducedModel  rmodel,
ModelData  model_data 
)
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

  • the training and validation parameter sample and
  • caching detailed simulations if necessary for error_indicators() computations.
Parameters
rmodelobject specifying how the reduced simulations can be computed.
model_dataMatlab structure storing (possibly) high dimensional data needed by IDetailedModel.detailed_simulation().
Required fields of rmodel:
  • detailed_model —  detailed model

Implements Greedy.Interface.

Definition at line 447 of file Algorithm.m.

Here is the call graph for this function:

Member Data Documentation

Greedy.Algorithm.detailed_extension

object

Note
This property has non-standard access specifiers: SetAccess = Private, GetAccess = Public
Matlab documentation of property attributes.

Definition at line 101 of file Algorithm.m.

Greedy.Algorithm.detailed_gen

an object

This object is inherited from the detailed_extension.

Note
This property has the MATLAB attribute Dependent set to true.
Matlab documentation of property attributes.
[readonly]

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 basis
  • rb : for reduced basis
  • eirb : for combination fo empirical interpolation and reduced basis
Note
This property has the MATLAB attribute Dependent set to true.
This property is an abstract property without implementation.
This property has non-standard access specifiers: SetAccess = Private, GetAccess = Public
Matlab documentation of property attributes.
This property has the MATLAB attribute Dependent set to true.
This property has non-standard access specifiers: SetAccess = Private, GetAccess = Public
Matlab documentation of property attributes.
[readonly]

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.

Note
This property has the MATLAB attribute Dependent set to true.
This property is an abstract property without implementation.
This property has non-standard access specifiers: SetAccess = Private, GetAccess = Public
Matlab documentation of property attributes.
This property has the MATLAB attribute Dependent set to true.
This property has non-standard access specifiers: SetAccess = Private, GetAccess = Public
Matlab documentation of property attributes.
[readonly]

Definition at line 85 of file Algorithm.m.

Greedy.Algorithm.info_fields
static
Initial value:
= {" 'M_train', 'M_validation', \
'stop_epsilon', 'stop_max_val_train_ratio', \
'val_train_ratio_seq_for_break', \
'stop_timeout' "}

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.


The documentation for this class was generated from the following file: