rbmatlab 0.10.01
|
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.
reduced_data = gen_detailed_data(r_model, model_data)
reduced_data = gen_reduced_data(r_model, detailed_data)
reduced_data = extract_reduced_data_subset(r_model, reduced_data)
set_mu(r_model, mu)
rb_sim_data = rb_simulation(r_model, reduced_data)
rb_sim_data = rb_reconstruction(r_model, detailed_data, rb_sim_data)
Definition at line 1 of file IReducedModel.m.
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 ![]() | |
virtual function IReducedModel c = | copy () |
function that deep copies this handle class | |
function U = | get_dofs_from_sim_data ( sim_data) |
extracts the | |
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 ![]() | |
function mu = | get_mu () |
returns the active parameter vector ![]() | |
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 ![]() | |
static function Delta = | get_estimator_from_sim_data ( rb_sim_data) |
Static helper method returning an error estimator for the whole reduced trajectory ![]() | |
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. |
IReducedModel.IReducedModel | ( | IDetailedModel | dmodel | ) |
Constructor of a reduced model (implements a copy constructor automatically)
An implementation should at least provide a constructor with the
ReducedModel(dmodel, bg_descr)
where the argument descr
is the underlying description of the reduced basis generation method and the reduced problem.
dmodel | the object for which the reduced model shall be constructed. |
Definition at line 110 of file IReducedModel.m.
function IReducedModel c = IReducedModel.copy | ( | ) | [pure virtual] |
function that deep copies this handle class
The suggested implementation in the implementation class should call a
// 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
c | an 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
where and
.
detailed_data | detailed data |
ratio | an integer from the interval ![]() ![]() |
factor | an (optional) positive factor ![]() |
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.
model_data | model data |
sim_data | structure 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.
other | an object we want to compare with. |
iseq | a boolean value indicating whether this and other are equal. |
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().
reduced_data | reduced data |
reduced_data_subset | reduced data subset |
reduced_data | object 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
addprop
method.bg_descr | An 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..
model_data | model data |
detailed_data | constructed 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.
model_data | model 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().
detailed_data | detailed data |
reduced_data | reduced data object |
Definition at line 202 of file IReducedModel.m.
function U = IReducedModel.get_dofs_from_sim_data | ( | sim_data | ) |
extracts the dimensional Dof vector from the
sim_data
structure
sim_data | matlab struct with simulation data generated e.g. by detailed_simulation() or rb_reconstruction() methods. |
U | ![]() |
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 generated by rb_simulation().
rb_sim_data | struct holding reduced simulation data returned by IReducedModel.rb_simulation() . |
Delta | This is a scalar computed from the estimates ![]() ![]() |
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 generated by rb_simulation().
rb_sim_data | struct holding reduced simulation data returned by IReducedModel.rb_simulation() . |
Delta | This is a (K+1) x 1 vector of estimates ![]() |
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 over for all operators/functions
.
detailed_data | detailed data |
Mratio | an integer from the interval ![]() |
datatree —
datatree Definition at line 524 of file IReducedModel.m.
function mu = IReducedModel.get_mu | ( | ) | [virtual] |
returns the active parameter vector
mu | The parameter vector ![]() |
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...
detailed_data | detailed data |
rb_size | rb 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.
sim_data | simulation data structure as returned by detailed_simulation() |
plot_params | structure which controls the plot output |
model_data | model data |
p | GUI 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 .
rb_sim_data | struct holding reduced simulation data returned by IReducedModel.rb_simulation() . |
detailed_data | detailed data |
rb_sim_data | struct 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.
reduced_data | reduced data |
rb_sim_data | structure 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
for all operators/functions , where
.
detailed_data | detailed data |
ratio | an integer from the interval ![]() |
this | this |
datatree —
datatreeM —
M Definition at line 488 of file IReducedModel.m.
function this = IReducedModel.set_mu | ( | mu | ) | [virtual] |
Sets the active parameter vector 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.
mu | The parameter vector ![]() |
this | handle to the changed IReducedModel |
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.
RBmatlab:Compatibility
warning if a description field is accessed.S | S |
ret | ret |
Definition at line 558 of file IReducedModel.m.
IReducedModel.crb_enabled = false |
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.
Reimplemented in LinEvol.ReducedModel, LinStat.ReducedModel, NonlinEvol.ReducedModel, TwoPhaseFlow.ReducedModel, and Test.ReducedModel.
Definition at line 61 of file IReducedModel.m.
IReducedModel.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.
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.
IReducedModel.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.
Default: 0
Definition at line 77 of file IReducedModel.m.