Greedy.Plugin.Interface implementation that extends in each basis extension step, the reduced basis space and/or the collateral reduced basis space(s).
As an error indicator it uses the error indicator of the reduced numerical scheme, with the ambition to "optimize" all spaces for best output in the final solutions \(u_{\text{red}}(\mu)\).
Public Member Functions | |
PODEI (Greedy.Plugin.PODCommon rb_extension,Greedy.Plugin.EICommon ei_extension,Greedy.Algorithm ei_init_greedy, Mmax_small) | |
constructor for a combined extension algorithm for reduced and collateral reduced basis spaces. More... | |
function
Greedy.DataTree.Detailed.PODEILeafNode detailed_data = | init_basis (IReducedModel rmodel,ModelData model_data, M_train) |
creates an initial detailed data node storing an initial reduced basis More... | |
function | prepare_reduced_data (IReducedModel rmodel,IDetailedData detailed_data) |
prepares reduced data that is necessary for the execution of other methods if indicated by needs_preparation. More... | |
function [
max_errs , max_err_seq , max_mu_index ] = | error_indicators (IReducedModel rmodel,Greedy.DataTree.Detailed.PODEILeafNode detailed_data, parameter_set, reuse_reduced_data) |
computes error indicators for the reduced simulations for every parameter vector from a given parameter set \({\cal M}_{\text{train}}\). More... | |
function errs = | compute_error (IReducedModel rmodel,IReducedData reduced_data,Greedy.DataTree.Detailed.PODEILeafNode detailed_data) |
computes the "true" error between a reduced and a detailed function \(\| v_h(t^k;\mu) - v_{\text{red}}(t^k;\mu) \|\). More... | |
function
Uapprox = | generate_reduced (IReducedModel rmodel,IReducedData reduced_data,Greedy.DataTree.Detailed.PODEILeafNode detailed_data, U) |
generates a reduced function \(v_{\text{red}}(\mu)\). More... | |
function [
breakloop , reason ] = | pre_check_for_end (IReducedModel rmodel,Greedy.DataTree.Detailed.PODEILeafNode detailed_data) |
checks whether the basis generation process has come to an end. More... | |
function
Greedy.DataTree.Detailed.PODEILeafNode detailed_data = | basis_extension (IReducedModel rmodel,Greedy.DataTree.Detailed.PODEILeafNode detailed_data, max_err_seq, mu) |
extends the reduced basis space from a given function \(v_{h}(\mu)\). More... | |
function
Greedy.DataTree.Detailed.PODEILeafNode detailed_data = | finalize (IReducedModel rmodel,Greedy.DataTree.Detailed.PODEILeafNode detailed_data) |
function called after the last extension process More... | |
function isbad = | indicate_bad_basis_extension (IDetailedData detailed_data) |
indicates whether the last basis extension was bad More... | |
Public Member Functions inherited from Greedy.Plugin.Interface | |
Interface (SnapshotsGenerator.Cached generator) | |
constructor for a greedy extension object More... | |
virtual function
Greedy.DataTree.Detailed.INode detailed_data = | init_basis (Greedy.User.IReducedModel rmodel,ModelData model_data,ParameterSampling.Interface M_train) |
creates an initial detailed data node storing an initial reduced basis More... | |
virtual function | prepare_reduced_data (Greedy.User.IReducedModel rmodel,Greedy.User.IDetailedData detailed_data) |
prepares reduced data that is necessary for the execution of other methods if indicated by needs_preparation. More... | |
virtual function [ max_errs , max_err_sequence , max_mu_index ] = | error_indicators (Greedy.User.IReducedModel rmodel,Greedy.User.IDetailedData detailed_data, parameter_set, reuse_reduced_data) |
computes error indicators for the reduced simulations for every parameter vector from a given parameter set \({\cal M}_{\text{train}}\). More... | |
virtual function errs = | compute_error (Greedy.User.IReducedModel rmodel,Greedy.User.ReducedData reduced_data,Greedy.User.IDetailedData detailed_data) |
computes the "true" error between a reduced and a detailed function \(\| v_h(t^k;\mu) - v_{\text{red}}(t^k;\mu) \|\). More... | |
virtual function
Uapprox = | generate_reduced (Greedy.User.IReducedModel rmodel,Greedy.User.ReducedData reduced_data,Greedy.User.IDetailedData detailed_data, U) |
generates a reduced function \(v_{\text{red}}(\mu)\). More... | |
virtual function [ breakloop , reason ] = | pre_check_for_end (Greedy.User.IReducedModel rmodel,Greedy.User.IDetailedData detailed_data) |
checks whether the basis generation process has come to an end. More... | |
virtual function
Greedy.User.IDetailedData detailed_data = | basis_extension (Greedy.User.IReducedModel rmodel,Greedy.User.IDetailedData detailed_data, max_err_seq, mu) |
extends the reduced basis space from a given function \(v_{h}(\mu)\). More... | |
virtual function
Greedy.User.IDetailedData detailed_data = | finalize (Greedy.User.IReducedModel rmodel,Greedy.User.IDetailedData detailed_data) |
function called after the last extension process More... | |
Public Attributes | |
needs_preparation | |
boolean indicating whether the prepare_reduced_data() method needs to be computed before error_indicators can be computed. More... | |
use_l2_error | |
boolean flag indicating whether the \(L^2(\Omega)\)-norm is used by compute_error(). More... | |
indicator_mode | |
string specifying which indicators shall be used by the error_indicators() method. More... | |
relative_error = "[]" | |
boolean flag specifying whether we want to use the relative error for error_indicators() and compute_error() methods. More... | |
Mmax_small | |
number of collateral reduced of the initial collateral reduced basis. More... | |
error_differences_for_extension = false | |
boolean flag indicating to use largest error difference over time steps in order to select snapshot for collateral reduced basis extension. More... | |
M_by_N_ratio = 0 | |
forced ratio between the sizes of the colletaral and the regular reduced basis space More... | |
bad_extension_on_explosion = false | |
boolean flag indicating whether in an explosion is a bad extension. More... | |
maximum_temporary_error_growth_factor = 0 | |
maximum factor between the current maximum indicator and the smallest maximum error indicator during previous extensions More... | |
discard_last_rb_after_bad_extension = true | |
boolean flag specifying whether the last generated reduced basis vector should be discarded after a bad extension is indicated by indicate_bad_basis_extension(). More... | |
skip_rb_after_bad_extension = true | |
boolean flag specifying whether the current reduced basis extension should be skipped after a bad extension is indicated by indicate_bad_basis_extension(). More... | |
skip_ei_after_bad_extension = false | |
boolean flag specifying whether the current collateral reduced basis extension should be skipped after a bad extension is indicated by indicate_bad_basis_extension(). More... | |
::Greedy.Plugin.PODCommon | rb_ext |
object used for extension of the reduced basis space. | |
::Greedy.Plugin.EICommon | ei_ext |
object used for extension of the collateral reduced basis space(s) and providing an error estimator | |
Greedy.Algorithm | ei_init_greedy |
object used for initial creation of collateral reduced basis space(s) More... | |
Public Attributes inherited from Greedy.Plugin.Interface | |
id | |
a string identifying the basis extension algorithm, should be unique over all instances of Interface implementations. More... | |
relative_error | |
boolean flag specifying whether we want to use the relative error for error_indicators() and compute_error() methods. More... | |
indicator_mode | |
string specifying which indicators shall be used by the error_indicators() method. More... | |
needs_preparation | |
boolean indicating whether the prepare_reduced_data() method needs to be computed before error_indicators can be computed. More... | |
::SnapshotsGenerator.Cached | generator |
an object generating possible (high dimension) basis functions | |
Static Public Attributes | |
static const | info_fields |
cell array of field names whose values shall be copied to the generated Greedy.DataTree.Detailed.PODEILeafNode instance. More... | |
static const | generated_basis_type = "eirb" |
string specifying the detailed data produced by this basis generation algorithm object. More... | |
Static Public Attributes inherited from Greedy.Plugin.Interface | |
static const | generated_basis_type |
string specifying the detailed data produced by this basis generation algorithm object. More... | |
Greedy.Plugin.PODEI.PODEI | ( | Greedy.Plugin.PODCommon | rb_extension, |
Greedy.Plugin.EICommon | ei_extension, | ||
Greedy.Algorithm | ei_init_greedy, | ||
Mmax_small | |||
) |
constructor for a combined extension algorithm for reduced and collateral reduced basis spaces.
rb_extension | an object specifying how to extend the reduced basis space and providing an error indicator. |
ei_extension | an object specifying how to extend the collateral reduced basis space(s). |
ei_init_greedy | an object used for initial creation of collateral reduced basis space(s) |
Mmax_small | Mmax small |
generator —
generator function Greedy.DataTree.Detailed.PODEILeafNode detailed_data = Greedy.Plugin.PODEI.basis_extension | ( | IReducedModel | rmodel, |
Greedy.DataTree.Detailed.PODEILeafNode | detailed_data, | ||
max_err_seq, | |||
mu | |||
) |
extends the reduced basis space from a given function \(v_{h}(\mu)\).
This generates a new basis function \(\varphi_{n+1} \in {\cal W}_h\) from the sequence of detailed functions \(v_h(t^k,\mu)\) for \(k=0,\ldots,K\) as returned by the SnapshotsGenerator.Cached generator.
rmodel | an object specifying the basis generation process. |
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. |
max_err_seq | sequence of error indicators as returned as second return argument of error_indicators() |
mu | paramter vector \(\mu\). |
detailed_data | updated data tree node . |
This function first extends the collateral reduced basis space unless
false
Afterwards, this function extends the reduced basis space unless
false
M/N
-ratio condition as described in M_by_N_ratio failedNaN
error indicatorsIn the second case and with enabled discard_last_rb_after_bad_extension option the last generated reduced basis is discarded if
Definition at line 523 of file PODEI.m.
function errs = Greedy.Plugin.PODEI.compute_error | ( | IReducedModel | rmodel, |
IReducedData | reduced_data, | ||
Greedy.DataTree.Detailed.PODEILeafNode | detailed_data | ||
) |
computes the "true" error between a reduced and a detailed function \(\| v_h(t^k;\mu) - v_{\text{red}}(t^k;\mu) \|\).
rmodel | an object specifying the basis generation process. The parameter \(\mu\) for which the error shall be computed must be set by set_mu(rmodel, mu) before. |
reduced_data | an object constructing and storing all (low-dimensional) reduced matrices and vectors needed for reduced simulations. |
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. |
errs | a sequence of errors at every time step \(k=0,\ldots,K\). |
This function calls the Greedy.Plugin.Interface.compute_error() method of the rb_ext member.
Definition at line 462 of file PODEI.m.
function [ max_errs , max_err_seq , max_mu_index ] = Greedy.Plugin.PODEI.error_indicators | ( | IReducedModel | rmodel, |
Greedy.DataTree.Detailed.PODEILeafNode | detailed_data, | ||
parameter_set, | |||
reuse_reduced_data | |||
) |
computes error indicators for the reduced simulations for every parameter vector from a given parameter set \({\cal M}_{\text{train}}\).
An error indicator estimates an error
\[\eta^k(\mu) \geq \| v_h(t^k;\mu) - v_{\text{red}}(t^k;\mu) \|\]
for every time step \(0\leq t^0, \ldots, t^K = T\) and every parameter \(\mu \in {\cal M}\). The norm is a problem specific norm determined by the options in rmodel
.
This function's main use is to find a parameter vector
\[\mu_{\max} = \arg \sup_{\mu \in {\cal M}_{\text{train}} } \max_{k=0,\ldots,K} \eta^k(\mu)\]
.
rmodel | an object specifying the basis generation process. |
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. |
parameter_set | a set of parameter vectors \({\cal M}_{\text{train}}\) as returned by ParameterSampling.Interface.space . |
reuse_reduced_data | optional flag indicating whether the reduced data needed for reduced simulations or computation of error estimators is still valid since its last generation. (default = false ) |
max_errs | a matrix of size n_parameters x model.nt+1 storing the error indicator \(\eta^k(\mu)\) for every \(k=0,\ldots,K\) and \(\mu \in {\cal M}_{\text{train}}\). |
max_err_sequence | a sequence of error indicators \(\eta^k(\mu_{\max})\) for every \(k=0,\ldots,K\). |
max_mu_index | the index of the parameter vector \(\mu_{\max}\) in the parameter_set matrix. |
This function calls the Greedy.Plugin.Interface.error_indicators() method of the rb_ext member.
function Greedy.DataTree.Detailed.PODEILeafNode detailed_data = Greedy.Plugin.PODEI.finalize | ( | IReducedModel | rmodel, |
Greedy.DataTree.Detailed.PODEILeafNode | detailed_data | ||
) |
function called after the last extension process
rmodel | an object specifying the basis generation process. |
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. |
detailed_data | updated data tree node . |
This method calls
function Uapprox = Greedy.Plugin.PODEI.generate_reduced | ( | IReducedModel | rmodel, |
IReducedData | reduced_data, | ||
Greedy.DataTree.Detailed.PODEILeafNode | detailed_data, | ||
U | |||
) |
generates a reduced function \(v_{\text{red}}(\mu)\).
rmodel | an object specifying the basis generation process. The parameter \(\mu\) for which the error shall be computed must be set by set_mu(rmodel, mu) before. |
reduced_data | an object storing all (low-dimensional) reduced matrices and vectors needed for reduced simulations. |
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. |
U | optional DOF vector, for example operator evaluations. |
Uapprox | A sequence of Dof vectors of the functions \(v_{\text{red}}(\cdot;t^k,\mu)\). |
This function calls the Greedy.Plugin.Interface.generate_reduced() method of the rb_ext member.
function isbad = Greedy.Plugin.PODEI.indicate_bad_basis_extension | ( | IDetailedData | detailed_data | ) |
indicates whether the last basis extension was bad
The last basis extension is bad if the maximum error indicator is larger than in the step before.
Furthermore, we test if the maximum error indicator is \(f\) times larger than the minimum error indicated at any extension step before. In this case we say, the event explosion has occured.
If maximum_temporary_error_growth_factor equals 0
, the explosion test is disabled.
The explosion test can affect the the assessment of a bad extension in the following way dependent on the option bad_extension_on_explosion:
The latter option assumes that an explosion of the error indicates that lately introduced complexity by more accurate empirical interpolation operators is not captured by the current reduced basis yet.
In the explosion test the factor \(f\) is defined by
\[f = c_{\text{max\_temp\_err\_growth}} \cdot \frac{1}{n_{\text{no\_rb\_ext}}}\]
with a constant \(c_{\text{max\_temp\_err\_growth}}\) given by maximum_temporary_error_growth_factor and a weighting factor determined by the number of extension steps withouth reduced basis extension \(n_{\text{no\_rb\_ext}}\).
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. |
isbad | a boolean value indicating whether the last extension was bad. |
Definition at line 720 of file PODEI.m.
function Greedy.DataTree.Detailed.PODEILeafNode detailed_data = Greedy.Plugin.PODEI.init_basis | ( | IReducedModel | rmodel, |
ModelData | model_data, | ||
M_train | |||
) |
creates an initial detailed data node storing an initial reduced basis
rmodel | an object specifying the basis generation process. |
M_train | an object specifying the parameter vector set \({\cal M}_{\text{train}}\) from which the basis functions are obtained. |
model_data | Matlab structure storing (possibly) high dimensional data needed by IDetailedModel.detailed_simulation(). |
detailed_data | an object storing the initial reduced basis vectors. |
This function
rb_ext
instance function [ breakloop , reason ] = Greedy.Plugin.PODEI.pre_check_for_end | ( | IReducedModel | rmodel, |
Greedy.DataTree.Detailed.PODEILeafNode | detailed_data | ||
) |
checks whether the basis generation process has come to an end.
Global break conditions (error_tolerance, timeout and validation ratio) are handled by Greedy.Algorithm .
rmodel | object specifying how the reduced simulations can be computed. |
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. |
breakloop | boolean flag indicating whether the basis generation process is finished for this reduced basis space. |
reason | descriptive text telling about the reasons why, the extension process needs to break. |
This function only indicates a basis extension stop if both parts are ready.
Definition at line 490 of file PODEI.m.
function Greedy.Plugin.PODEI.prepare_reduced_data | ( | IReducedModel | rmodel, |
IDetailedData | detailed_data | ||
) |
prepares reduced data that is necessary for the execution of other methods if indicated by needs_preparation.
rmodel | an object specifying the basis generation process. |
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. |
Definition at line 429 of file PODEI.m.
Greedy.Plugin.PODEI.bad_extension_on_explosion = false |
boolean flag indicating whether in an explosion is a bad extension.
Default: false
Greedy.Plugin.PODEI.discard_last_rb_after_bad_extension = true |
boolean flag specifying whether the last generated reduced basis vector should be discarded after a bad extension is indicated by indicate_bad_basis_extension().
See indicate_bad_basis_extension() and basis_extension() for details.
Default: true
Greedy.Plugin.PODEI.ei_init_greedy |
object used for initial creation of collateral reduced basis space(s)
See Mmax_small for details
Greedy.Plugin.PODEI.error_differences_for_extension = false |
boolean flag indicating to use largest error difference over time steps in order to select snapshot for collateral reduced basis extension.
In order to extend the collateral reduced basis spaces, we need to select one snapshot indexed by \(k_{\max}\) from the sequence of possible vectors \(v_h(t^{k},\mu_{\max}) \in {\cal W}_h\). If this flag is set to true
, \(k_{\max} = \arg \max_{k=1,\ldots,K} \eta^k(\mu_{\max}) - \eta^{k-1}(\mu_{\max})\).
Otherwise \(k_{\max}\) is determind as the time step of the maximum error returned by Greedy.Plugin.EI.compute_error()
Default: false
|
static |
string specifying the detailed data produced by this basis generation algorithm object.
This is set to eirb
.
Default: "eirb"
Greedy.Plugin.PODEI.indicator_mode |
string specifying which indicators shall be used by the error_indicators() method.
error
for an error between the detailed and the reduced computation. estimator
for an a posteriori error estimator
|
static |
cell array of field names whose values shall be copied to the generated Greedy.DataTree.Detailed.PODEILeafNode instance.
Hidden
set to true. Greedy.Plugin.PODEI.M_by_N_ratio = 0 |
forced ratio between the sizes of the colletaral and the regular reduced basis space
If the ratio is too low before a basis extension, only the collateral reduced basis space is extended.
Its purpose is to make the collateral reduced basis space more refined than the reduced basis space. This is necessary as the best possible error for the basis generation of the reduced basis space depends on the quality of the collateral reduced basis space.
Default: 0
Greedy.Plugin.PODEI.maximum_temporary_error_growth_factor = 0 |
maximum factor between the current maximum indicator and the smallest maximum error indicator during previous extensions
See indicate_bad_basis_extension() for details.
Default: 0
Greedy.Plugin.PODEI.Mmax_small |
number of collateral reduced of the initial collateral reduced basis.
In order to use the estimator of a nonlinear evolution equation for a basis extension with a greedy search in the parameter space, a collateral reduced basis space for all existing operators needs to be present. For this reason at the beginning of the basis generation algorithm, a collateral reduced bases of size at most Mmax_small
is generated
Greedy.Plugin.PODEI.needs_preparation |
boolean indicating whether the prepare_reduced_data() method needs to be computed before error_indicators can be computed.
Dependent
set to true. Dependent
set to true. Greedy.Plugin.PODEI.relative_error = "[]" |
boolean flag specifying whether we want to use the relative error for error_indicators() and compute_error() methods.
Default: "[]"
Greedy.Plugin.PODEI.skip_ei_after_bad_extension = false |
boolean flag specifying whether the current collateral reduced basis extension should be skipped after a bad extension is indicated by indicate_bad_basis_extension().
See indicate_bad_basis_extension() and basis_extension() for details.
Default: false
Greedy.Plugin.PODEI.skip_rb_after_bad_extension = true |
boolean flag specifying whether the current reduced basis extension should be skipped after a bad extension is indicated by indicate_bad_basis_extension().
See indicate_bad_basis_extension() and basis_extension() for details.
Default: true
Greedy.Plugin.PODEI.use_l2_error |
boolean flag indicating whether the \(L^2(\Omega)\)-norm is used by compute_error().
Otherwise the \(L^{\infty}(\Omega)\)-norm is applied.
Default: true
Dependent
set to true.