rbmatlab 0.10.01
Public Member Functions | Static Public Member Functions | Public Attributes
IReducedModel Class Reference

Detailed Description

This is the interface for a reduced model providing methods to compute low dimensional reduced simulations based on a priori generated reduced basis spaces.

An IReducedModel implementation is the final puzzle piece in the reduced basis framework as described the section on the main interfaces".

Note, that this interface implements an IDetailedModel interface, by forwarding all methods to the underlying detailed_model. By this, the reduced model is the only needed. This is again for historic reasons assuring compatibility with old codes which did not distinguish between reduced and detailed models.

Usually a reduced model r_model is used in the following way and order
  1. Generate detailed data
     reduced_data = gen_detailed_data(r_model, model_data) 
    
  2. Generate reduced data
     reduced_data = gen_reduced_data(r_model, detailed_data) 
    
  3. (Optionally) extract a subset from this reduced_data
     reduced_data = extract_reduced_data_subset(r_model, reduced_data) 
    
  4. Compute one or more reduced simulations by
    1. Setting the active parameter
       set_mu(r_model, mu) 
      
      and
    2. executing the simulation
       rb_sim_data = rb_simulation(r_model, reduced_data) 
      
  5. Optionally reconstruct the reduced simulation snapshots $u_{\text{red}}(\cdot; t^k, \mu) \in {\cal W}_{\text{red}}$
     rb_sim_data = rb_reconstruction(r_model, detailed_data, rb_sim_data) 
    

Definition at line 1 of file IReducedModel.m.

Inheritance diagram for IReducedModel:
Inheritance graph
[legend]
Collaboration diagram for IReducedModel:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 IReducedModel ( IDetailedModel dmodel)
 Constructor of a reduced model (implements a copy constructor automatically)
function  fill_fields ( bg_descr)
 helper function usually called in constructor in order to overwrite property values from a bg_descr structure
function iseq eq ( IReducedModel other)
 Comparison operator checking whether the underlying detailed_model members of this and other are equal.
function IReducedData
reduced_data
gen_reduced_data ( detailed_data)
 Constructs the reduced_data object holding low dimensional data needed for efficient reduced simulations with rb_simulation().
function
reduced_data_subset
extract_reduced_data_subset ( IReducedData reduced_data)
 Extracts a subset of the reduced_data generated by gen_reduced_data().
virtual function
rb_sim_data
rb_simulation ( reduced_data)
 Executes a reduced simulation and optionally an error estimation.
virtual function
rb_sim_data
rb_reconstruction ( detailed_data, rb_sim_data)
 reconstructs the reduced simulation snapshots generated by rb_simulation() in the reduced space ${\cal W}_{\text{red}}$.
virtual function IReducedModel c copy ()
 function that deep copies this handle class
function U get_dofs_from_sim_data ( sim_data)
 

extracts the $H$ dimensional Dof vector from the sim_data structure


function IDetailedData
detailed_data
gen_detailed_data ( model_data)
 initiates the reduced basis generation process
function p plot_sim_data ( model_data, sim_data, plot_params)
 

plots the simulation data as returned by detailed_simulation()


function
model_data
gen_model_data ()
 

generates large model data.


function
sim_data
detailed_simulation ( model_data)
 

executes a detailed simulation for a given parameter


function this set_mu ( mu)
 Sets the active parameter vector $\mu \in {\cal M}$ used for simulations on this model.
function mu get_mu ()
 returns the active parameter vector $\mu \in { \cal M }$
function
rb_size
get_rb_size ( detailed_data)
 returns the size of the generated reduced basis by the IDetailedData class.
function  couple_N_and_M ( detailed_data, ratio, factor)
 sets all the basis sizes for reduced simulations by a ratio with respect to the maximum possible basis size and a factor between RB and EI basis sizes.
function this set_Mratio ( detailed_data, ratio)
 in case of multiple operators subject to empirical interpolation, this sets number of reduced basis functions used for reduced simulations by specifying a ratio.
function Mratio get_Mratio ( detailed_data)
 in case of multiple operators subject to empirical interpolation, this gets the mean of ratio between the number of reduced basis functions used for reduced simulations and the maximum possible.
function ret subsref ( S)
 forwarding of fieldnames access to the underlying detailed_model description

Static Public Member Functions

static function Delta get_estimators_from_sim_data ( rb_sim_data)
 Static helper method returning the vectors of error estimators for each reduced simulation snapshot $u_{\text{red}}(\cdot, t^k)$ generated by rb_simulation().
static function Delta get_estimator_from_sim_data ( rb_sim_data)
 Static helper method returning an error estimator for the whole reduced trajectory $\{u_{\text{red}}(\cdot, t^k)\}_{k=0}^{K}$ generated by rb_simulation().

Public Attributes

 crb_enabled = false
 flag indicating whether this model depends on collateral reduced basis spaces.
::IDetailedModel detailed_model
 an object which shall be reduced
 enable_error_estimator
 boolean flag indicating whether during an rb_simulation() an a posteriori error estimator shall be computed.
 N = 0
 control variable for the size of the reduced basis used for reduced simulations. By default this is equal to the size of the generated reduced basis.
 M = 0
 control variable for the size of the (collateral) reduced basis used for empirical interpolations. By default this is equal to the size of the generated reduced basis.
 Mstrich = 0
 control variable for the number of (collateral) reduced basis vectors used for error estimation. By default this is equal to zero.

Constructor & Destructor Documentation

IReducedModel.IReducedModel ( IDetailedModel  dmodel)

Constructor of a reduced model (implements a copy constructor automatically)

An implementation should at least provide a constructor with the

following synopsis
     ReducedModel(dmodel, bg_descr)

where the argument descr is the underlying description of the reduced basis generation method and the reduced problem.

Parameters:
dmodelthe object for which the reduced model shall be constructed.

Definition at line 110 of file IReducedModel.m.


Member Function Documentation

function IReducedModel c = IReducedModel.copy ( ) [pure virtual]

function that deep copies this handle class

The suggested implementation in the implementation class should call a

copy constructor which might look as follows
     // this implements a copy constructor if necessary...
     rm = rm@IReducedModel(dmodel);
     // are we NOT a copy constructor?
     if ~isa(dmodel, 'Implementation.ReducedModel')
       // do some checks and further initializations here...
     end
Return values:
can object which is a deep copy of this object.

Implemented in LinEvol.ReducedModel, LinEvolDune.ReducedModel, LinStat.ReducedModel, NonlinEvol.ReducedModel, TwoPhaseFlow.ReducedModel, and Test.ReducedModel.

function IReducedModel.couple_N_and_M (   detailed_data,
  ratio,
  factor 
)

sets all the basis sizes for reduced simulations by a ratio with respect to the maximum possible basis size and a factor between RB and EI basis sizes.

This method sets

\[(N, M^{L_1}, \dots, M^{L_q}) = \left(\lfloor r N_{\max} \rfloor, \lfloor r_M M_{\max}^{'L_1} \rfloor, \dots, \lfloor r_M M_{\max}^{'L_q} \rfloor\right),\]

where $r_M = \min\{ rf, 1 \}$ and $M_{\max}^{'L} == M_{\max}^L - M'$.

Parameters:
detailed_datadetailed data
ratioan integer from the interval $[0, 1]$ specifying the ratio $r$ by which the number of collateral reduced basis functions shall be reduced with respect to the maximum possible.
factoran (optional) positive factor $f$ between RB and EI basis sizes. (default = 1)

Definition at line 453 of file IReducedModel.m.

function sim_data = IReducedModel.detailed_simulation (   model_data) [virtual]

executes a detailed simulation for a given parameter

This function call is forwarded to the underlying detailed_model.

Parameters:
model_datamodel data
Return values:
sim_datastructure holding the detailed simulation result.

Implements IModel.

Definition at line 385 of file IReducedModel.m.

function iseq = IReducedModel.eq ( IReducedModel  other)

Comparison operator checking whether the underlying detailed_model members of this and other are equal.

Parameters:
otheran object we want to compare with.
Return values:
iseqa boolean value indicating whether this and other are equal.
Required fields of other:
  • detailed_model —  detailed model

Definition at line 185 of file IReducedModel.m.

function reduced_data_subset = IReducedModel.extract_reduced_data_subset ( IReducedData  reduced_data)

Extracts a subset of the reduced_data generated by gen_reduced_data().

Parameters:
reduced_datareduced data
Return values:
reduced_data_subsetreduced data subset
reduced_dataobject holding a subset of the reduced data fields as they were generated by gen_reduced_data().

Reimplemented in Test.ReducedModel.

Definition at line 217 of file IReducedModel.m.

function IReducedModel.fill_fields (   bg_descr)

helper function usually called in constructor in order to overwrite property values from a bg_descr structure

  • If a field name does not correspond to an existing property, the property is dynamically added to the IReducedModel implementation via the addprop method.
Parameters:
bg_descrAn structure describing the analytical problem and its discretization.

Definition at line 158 of file IReducedModel.m.

function IDetailedData detailed_data = IReducedModel.gen_detailed_data (   model_data)

initiates the reduced basis generation process

This function calls the IDetailedData constructor specified by detailed_data_constructor and returns the generated detailed data object..

Parameters:
model_datamodel data
Return values:
detailed_dataconstructed detailed data object

Definition at line 336 of file IReducedModel.m.

function model_data = IReducedModel.gen_model_data ( ) [virtual]

generates large model data.

This function call is forwarded to the underlying detailed_model.

Return values:
model_datamodel data

Implements IModel.

Definition at line 368 of file IReducedModel.m.

function IReducedData reduced_data = IReducedModel.gen_reduced_data (   detailed_data)

Constructs the reduced_data object holding low dimensional data needed for efficient reduced simulations with rb_simulation().

Parameters:
detailed_datadetailed data
Return values:
reduced_datareduced data object

Definition at line 202 of file IReducedModel.m.

function U = IReducedModel.get_dofs_from_sim_data (   sim_data)

extracts the $H$ dimensional Dof vector from the sim_data structure

Parameters:
sim_datamatlab struct with simulation data generated e.g. by detailed_simulation() or rb_reconstruction() methods.
Return values:
U$H$ dimensional Dof vector

Reimplemented in Test.ReducedModel.

Definition at line 324 of file IReducedModel.m.

function Delta = IReducedModel.get_estimator_from_sim_data (   rb_sim_data) [static, pure virtual]

Static helper method returning an error estimator for the whole reduced trajectory $\{u_{\text{red}}(\cdot, t^k)\}_{k=0}^{K}$ generated by rb_simulation().

Parameters:
rb_sim_datastruct holding reduced simulation data returned by IReducedModel.rb_simulation() .
Return values:
DeltaThis is a scalar computed from the estimates $\eta^k(\mu)$. Usually the maximum over $k=0,\ldots,K$ is returned.

Implemented in LinEvol.ReducedModel, LinEvolDune.ReducedModel, LinStat.ReducedModel, NonlinEvol.ReducedModel, TwoPhaseFlow.ReducedModel, and Test.ReducedModel.

function Delta = IReducedModel.get_estimators_from_sim_data (   rb_sim_data) [static, pure virtual]

Static helper method returning the vectors of error estimators for each reduced simulation snapshot $u_{\text{red}}(\cdot, t^k)$ generated by rb_simulation().

Parameters:
rb_sim_datastruct holding reduced simulation data returned by IReducedModel.rb_simulation() .
Return values:
DeltaThis is a (K+1) x 1 vector of estimates $\eta^k(\mu)$

Implemented in LinEvol.ReducedModel, LinEvolDune.ReducedModel, LinStat.ReducedModel, NonlinEvol.ReducedModel, TwoPhaseFlow.ReducedModel, and Test.ReducedModel.

function Mratio = IReducedModel.get_Mratio (   detailed_data)

in case of multiple operators subject to empirical interpolation, this gets the mean of ratio between the number of reduced basis functions used for reduced simulations and the maximum possible.

This function gets the mean of $\frac{M^{L}}{M_{\max}^{L}}$ over for all operators/functions $L$.

Parameters:
detailed_datadetailed data
Return values:
Mratioan integer from the interval $[0, 1]$ specifying the ratio by which the number of collateral reduced basis functions is reduced with respect to the maximum possible.
Required fields of detailed_data:
  • datatree —  datatree

Definition at line 524 of file IReducedModel.m.

function mu = IReducedModel.get_mu ( ) [virtual]

returns the active parameter vector $\mu \in { \cal M }$

Return values:
muThe parameter vector $\mu$

Implements IModel.

Reimplemented in LinEvolDune.ReducedModel, and LebesgueTest.ReducedModel.

Definition at line 424 of file IReducedModel.m.

function rb_size = IReducedModel.get_rb_size (   detailed_data)

returns the size of the generated reduced basis by the IDetailedData class.

This method only forwards the call to the IDetailedData.get_rb_size() method. So, it is pretty useless, but necessary for compatibility with the old interface...

Parameters:
detailed_datadetailed data
Return values:
rb_sizerb size

Definition at line 436 of file IReducedModel.m.

function p = IReducedModel.plot_sim_data (   model_data,
  sim_data,
  plot_params 
)

plots the simulation data as returned by detailed_simulation()

This method actually calls the plot_sim_data() method on the detailed_model member.

Parameters:
sim_datasimulation data structure as returned by detailed_simulation()
plot_paramsstructure which controls the plot output
model_datamodel data
Return values:
pGUI handle to the created MATLAB figure

Definition at line 356 of file IReducedModel.m.

function rb_sim_data = IReducedModel.rb_reconstruction (   detailed_data,
  rb_sim_data 
) [pure virtual]

reconstructs the reduced simulation snapshots generated by rb_simulation() in the reduced space ${\cal W}_{\text{red}}$.

Possible implementations are
Parameters:
rb_sim_datastruct holding reduced simulation data returned by IReducedModel.rb_simulation() .
detailed_datadetailed data
Return values:
rb_sim_datastruct holding the reduced simulation results and their reconstructions.
function rb_sim_data = IReducedModel.rb_simulation (   reduced_data) [pure virtual]

Executes a reduced simulation and optionally an error estimation.

Parameters:
reduced_datareduced data
Return values:
rb_sim_datastructure holding the coefficient vectors of the reduced simulations and optional error estimators.
function this = IReducedModel.set_Mratio (   detailed_data,
  ratio 
)

in case of multiple operators subject to empirical interpolation, this sets number of reduced basis functions used for reduced simulations by specifying a ratio.

This method sets

\[M^{L} = \lfloor M_{\max}^{'L} \cdot \text{ratio} \rfloor\]

for all operators/functions $L$, where $M_{\max}^{'L} == M_{\max}^L - M'$.

Parameters:
detailed_datadetailed data
ratioan integer from the interval $[0, 1]$ specifying the ratio by which the number of collateral reduced basis functions shall be reduced with respect to the maximum possible.
Return values:
thisthis
Required fields of detailed_data:
  • datatree —  datatree
Generated fields of this:
  • M —  M

Definition at line 488 of file IReducedModel.m.

function this = IReducedModel.set_mu (   mu) [virtual]

Sets the active parameter vector $\mu \in {\cal M}$ used for simulations on this model.

The parameter set here, is also used by the rb_simulation() function. So, the detailed_model and the reduced model's internal parameter vector are in sync.

Parameters:
muThe parameter vector $\mu$.
Return values:
thishandle to the changed IReducedModel
Generated fields of this:
  • detailed_model —  detailed model

Implements IModel.

Reimplemented in LinEvolDune.ReducedModel, and LebesgueTest.ReducedModel.

Definition at line 400 of file IReducedModel.m.

function ret = IReducedModel.subsref (   S)

forwarding of fieldnames access to the underlying detailed_model description

If the user calls r_model.parameter and the field parameter exists in the underlying model, the value of detailed_model.descr.parameter is returned. This method is implemented for compatibility reasons, such that a basis generation object can be used like an old model. Try to prevent usage of this method in the future.

Note:
that this method throws a RBmatlab:Compatibility warning if a description field is accessed.
Parameters:
SS
Return values:
retret

Definition at line 558 of file IReducedModel.m.


Member Data Documentation

flag indicating whether this model depends on collateral reduced basis spaces.


Default: false

Definition at line 42 of file IReducedModel.m.

boolean flag indicating whether during an rb_simulation() an a posteriori error estimator shall be computed.

This flag needs to be set to true for certain Basis generation configurations.

Note:
This property is an abstract property without implementation.
Matlab documentation of property attributes.

Reimplemented in LinEvol.ReducedModel, LinStat.ReducedModel, NonlinEvol.ReducedModel, TwoPhaseFlow.ReducedModel, and Test.ReducedModel.

Definition at line 61 of file IReducedModel.m.

control variable for the size of the (collateral) reduced basis used for empirical interpolations. By default this is equal to the size of the generated reduced basis.


Default: 0

Definition at line 88 of file IReducedModel.m.

control variable for the number of (collateral) reduced basis vectors used for error estimation. By default this is equal to zero.


Default: 0

Definition at line 99 of file IReducedModel.m.

control variable for the size of the reduced basis used for reduced simulations. By default this is equal to the size of the generated reduced basis.


Default: 0

Definition at line 77 of file IReducedModel.m.


The documentation for this class was generated from the following file:
All Classes Namespaces Files Functions Variables