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

Detailed Description

reduced model for non-linear evolution problems as given by a TwoPhaseFlow.DetailedModel.

This is compatible with Greedy.User.IReducedModel and can therefore make use of detailed data objects created by Greedy algorithms.

Definition at line 18 of file ReducedModel.m.

Inheritance diagram for TwoPhaseFlow.ReducedModel:
Inheritance graph
[legend]
Collaboration diagram for TwoPhaseFlow.ReducedModel:
Collaboration graph
[legend]

Public Member Functions

 ReducedModel (TwoPhaseFlow.DetailedModel dmodel,BasisGenDescr bg_descr)
 Constructor for the reduced model. More...
 
function Nget_N (id)
 
function  set_N (id, val)
 
function Mget_M (id)
 
function  set_M (id, val)
 
function TwoPhaseFlow.ReducedModel
c = 
copy ()
 function that deep copies this handle class More...
 
function
rb_sim_data = 
rb_simulation (Greedy.User.ReducedData reduced_data, sim_data,IDetailedData dd)
 forwards the reduced simulation to the method rb_simulation_impl() after getting a suitable reduced data leaf element. More...
 
function
rb_sim_data = 
rb_simulation_impl (TwoPhaseFlow.EiRbReducedDataNode reduced_data, sim_data, dd)
 function, which performs a reduced basis online simulation for the parameter vector \(\mu \in {\cal P} \subset \mathbb{R}^p\), which is assumed to be set by IDetailedModel.set_mu() More...
 
function
rb_sim_data = 
rb_simulation_impes_impl (TwoPhaseFlow.EiRbReducedDataNode reduced_data, sim_data, dd)
 function, which performs a reduced basis online simulation for the parameter vector \(\mu \in {\cal P} \subset \mathbb{R}^p\), which is assumed to be set by IDetailedModel.set_mu() More...
 
function a0 = rb_init_values (Greedy.DataTree.Detailed.PODEILeafNode detailed_data, decomp_mode)
 function computing initial values for a reduced simulation. More...
 
function
rb_sim_data = 
rb_reconstruction (TwoPhaseFlow.DetailedData detailed_data, rb_sim_data)
 reconstructs a high dimensional solution trajectory from a reduced solution trajectory. More...
 
- Public Member Functions inherited from Greedy.User.IReducedModel
 IReducedModel (IDetailedModel dmodel,BasisGenDescr bg_descr)
 constructor for this reduced model interface More...
 
function Greedy.User.ReducedData
reduced_data = 
gen_reduced_data (Greedy.User.IDetailedData detailed_data)
 Constructs the reduced_data object holding low dimensional data needed for efficient reduced simulations with rb_simulation(). More...
 
function
rb_sim_data = 
rb_simulation (Greedy.User.ReducedData reduced_data)
 forwards the reduced simulation to the method rb_simulation_impl() after getting a suitable reduced data leaf element. More...
 
virtual function
rb_sim_data = 
rb_simulation_impl (Greedy.User.IReducedDataNode reduced_data)
 implementation of the reduced simulation More...
 
- Public Member Functions inherited from IReducedModel
 IReducedModel (IDetailedModel dmodel, bg_descr)
 Constructor of a reduced model. More...
 
function iseq = eq (IReducedModel other)
 Comparison operator checking whether the underlying detailed_model members of this and other are equal. More...
 
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(). More...
 
function
reduced_data_subset = 
extract_reduced_data_subset (IReducedData reduced_data)
 Extracts a subset of the reduced_data generated by gen_reduced_data(). More...
 
virtual function
rb_sim_data = 
rb_simulation (reduced_data)
 Executes a reduced simulation and optionally an error estimation. More...
 
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}}\). More...
 
function U = get_dofs_from_sim_data (sim_data)
 extracts the \(H\) dimensional Dof vector from the sim_data structure More...
 
function IDetailedData
detailed_data = 
gen_detailed_data (model_data)
 initiates the reduced basis generation process More...
 
function p = plot_sim_data (model_data, sim_data, plot_params)
 plots the simulation data as returned by detailed_simulation() More...
 
function
model_data = 
gen_model_data ()
 generates large model data. More...
 
function
sim_data = 
detailed_simulation (model_data)
 executes a detailed simulation for a given parameter More...
 
function this = set_mu (mu)
 Sets the active parameter vector \(\mu \in {\cal M}\) used for simulations on this model. More...
 
function mu = get_mu ()
 returns the active parameter vector \(\mu \in { \cal M }\) More...
 
function
rb_size = 
get_rb_size (detailed_data)
 returns the size of the generated reduced basis by the IDetailedData class. More...
 
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. More...
 
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. More...
 
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. More...
 
function
varargout = 
subsref (S)
 forwarding of fieldnames access to the underlying detailed_model description More...
 

Static Public Member Functions

static function Delta = get_estimators_from_sim_data (rb_sim_data)
 
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(). More...
 
- Static Public Member Functions inherited from IModel
static function ok = struct_check (descr, checks)
 executes checks on the fields of a structure object More...
 

Public Attributes

 enable_error_estimator = false
 
 impes = false
 
 t
 current time instance More...
 
 tstep
 current time step More...
 
- Public Attributes inherited from IReducedModel
 descr
 The description structure holding information about the analytical parametrized problem and its discretization. More...
 
 decomp_mode
 
 mu_names
 cell array of strings describing the parameters of the model More...
 
 mu_ranges
 cell array of vectors of size two defining the allowed interval range for the parameter components More...
 
 verbose
 an integer defining the verbosity level of information output during basis generation More...
 
 debug
 an integer defining the debugging level controlling error output and extra tests during basis generation More...
 
 crb_enabled = false
 flag indicating whether this model depends on collateral reduced basis spaces. More...
 
::IDetailedModel detailed_model
 an object which shall be reduced
 
::BasisGenDescr bg_descr
 a structure defining the basis generation routines and data structures.
 
 enable_error_estimator
 boolean flag indicating whether during an rb_simulation() an a posteriori error estimator shall be computed. More...
 
 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. More...
 
 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. More...
 
 Mstrich = 0
 control variable for the number of (collateral) reduced basis vectors used for error estimation. By default this is equal to zero. More...
 
- Public Attributes inherited from IModel
 num_cpus = 4
 The number of CPUs used for parallel sessions. More...
 
 decomp_mode
 Decomposition operation mode. More...
 
 mu_names
 cell array of strings describing the parameters of the model More...
 
 mu_ranges
 cell array of vectors of size two defining the allowed interval range for the parameter components More...
 
 verbose
 an integer defining the verbosity level of information output during basis generation More...
 
 debug
 an integer defining the debugging level controlling error output and extra tests during basis generation More...
 

Static Public Attributes

static const  ddescr_checks
 This constant is used for a consistency check of the model descr with help of IModel.struct_check() More...
 
- Static Public Attributes inherited from IModel
static const  time_checks
 This constant can be used for a consistency check of time evolution members in the ModelDescr with help of IModel.struct_check() More...
 

Constructor & Destructor Documentation

TwoPhaseFlow.ReducedModel.ReducedModel ( TwoPhaseFlow.DetailedModel  dmodel,
BasisGenDescr  bg_descr 
)

Constructor for the reduced model.

Parameters
dmodelobject specifying how the high dimensional data can be computed.
bg_descrstructure specifying how the reduced basis shall be generated.
Required fields of dmodel:
  • descr —  descr

Definition at line 83 of file ReducedModel.m.

Here is the call graph for this function:

Member Function Documentation

function TwoPhaseFlow.ReducedModel c = TwoPhaseFlow.ReducedModel.copy ( )
virtual

function that deep copies this handle class

Return values
can object which is a deep copy of this object.

Implements IReducedModel.

Definition at line 140 of file ReducedModel.m.

function Delta = TwoPhaseFlow.ReducedModel.get_estimator_from_sim_data (   rb_sim_data)
staticvirtual

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() . struct holding reduced simulation data returned by IReducedModel.rb_simulation() .
Return values
DeltaThis is a (K+1) x 1 vector of estimates \(\eta^k(\mu)\) Delta = get_estimators_from_sim_data(rb_sim_data); This is a scalar computed from the estimates \(\eta^k(\mu)\). Usually the maximum over \(k=0,\ldots,K\) is returned.

Implements IReducedModel.

Definition at line 234 of file ReducedModel.m.

function Delta = TwoPhaseFlow.ReducedModel.get_estimators_from_sim_data (   rb_sim_data)
static

Definition at line 223 of file ReducedModel.m.

function a0 = TwoPhaseFlow.ReducedModel.rb_init_values ( Greedy.DataTree.Detailed.PODEILeafNode  detailed_data,
  decomp_mode 
)

function computing initial values for a reduced simulation.

This calls rb_init_values_separable().

Parameters
detailed_datadetailed data tree leaf object
decomp_modeflag indicating the operation mode of the function:
  • 0 (complete) : no affine parameter dependence or decomposition is performed.
  • 1 (components) : for each output argument a cell array of output matrices is returned representing the \(q\)-th component independent of the parameters given in mu_names.
  • 2 (coefficients) : returns a vector where each coordinate represents the \(q\)-the coefficient \(\sigma_{\cdot}^{q}(\mu)\) dependent on the parameters given in mu_names.
Return values
a0coefficient vector of size N x 1 for the initial values.

Definition at line 192 of file ReducedModel.m.

Here is the call graph for this function:

function rb_sim_data = TwoPhaseFlow.ReducedModel.rb_reconstruction ( TwoPhaseFlow.DetailedData  detailed_data,
  rb_sim_data 
)

reconstructs a high dimensional solution trajectory from a reduced solution trajectory.

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.
rb_sim_datastruct holding reduced simulation data returned by ReducedModel.rb_simulation().
Return values
rb_sim_datastruct holding the reduced simulation results and their reconstructions.
Required fields of detailed_data:
  • datatree.rb —  datatree.rb
Required fields of rb_sim_data:
  • sat_a —  sat a
  • vel_a —  vel a
  • prs_a —  prs a
Generated fields of rb_sim_data:
  • S —  S
  • U —  U
  • P —  P

Definition at line 19 of file rb_reconstruction.m.

function rb_sim_data = TwoPhaseFlow.ReducedModel.rb_simulation ( Greedy.User.ReducedData  reduced_data,
  sim_data,
IDetailedData  dd 
)

forwards the reduced simulation to the method rb_simulation_impl() after getting a suitable reduced data leaf element.

Parameters
reduced_dataan object constructing and storing all (low-dimensional) reduced matrices and vectors needed for reduced simulations.
sim_datastructure holding simulation data, i.e. Dof-vectors with fields S, U, P for the saturation, velocity and pressure field concentrations. This can be used for reference computations. Default: []
ddobject which can be used for reference computations. Default: []
Return values
rb_sim_datastructure holding the coefficient vectors of the reduced simulations and optional error estimators.

Definition at line 152 of file ReducedModel.m.

Here is the call graph for this function:

function rb_sim_data = TwoPhaseFlow.ReducedModel.rb_simulation_impes_impl ( TwoPhaseFlow.EiRbReducedDataNode  reduced_data,
  sim_data,
  dd 
)

function, which performs a reduced basis online simulation for the parameter vector \(\mu \in {\cal P} \subset \mathbb{R}^p\), which is assumed to be set by IDetailedModel.set_mu()

  • allowed dependency of data: Nmax, Mmax, N, M, mu
  • not allowed dependency of data: H
  • allowed dependency of computation: Nmax, Mmax, N, M, mu
  • not allowed dependency of computation: H
  • Unknown at this stage: —

The behaviour of this simulation is controlled by the ModelDescr structure rmodel.descr.

Parameters
reduced_dataan object constructing and storing all (low-dimensional) reduced matrices and vectors needed for reduced simulations.
sim_datamatlab struct with simulation data generated e.g. by detailed_simulation() or rb_reconstruction() methods.
dddd
Return values
rb_sim_datarb sim data
Required fields of dd:
  • datatree.rb —  datatree.rb
  • model_data.diamondW —  model data.diamondW
  • model_data.W —  model data.W
  • datatree.ei —  datatree.ei
  • model_data —  model data
Required fields of sim_data:
  • U —  U
  • P —  P
Generated fields of rb_sim_data:
  • a —  a(:,k) is the coefficient vector of the reduced simulation at time \(t^{k-1}\)
  • Delta —  Delta
  • sat_a —  sat a
  • vel_a —  vel a
  • prs_a —  prs a
  • exit_flags —  exit flags
  • outputs —  outputs

Definition at line 19 of file rb_simulation_impes_impl.m.

Here is the call graph for this function:

Here is the caller graph for this function:

function rb_sim_data = TwoPhaseFlow.ReducedModel.rb_simulation_impl ( TwoPhaseFlow.EiRbReducedDataNode  reduced_data,
  sim_data,
  dd 
)

function, which performs a reduced basis online simulation for the parameter vector \(\mu \in {\cal P} \subset \mathbb{R}^p\), which is assumed to be set by IDetailedModel.set_mu()

  • allowed dependency of data: Nmax, Mmax, N, M, mu
  • not allowed dependency of data: H
  • allowed dependency of computation: Nmax, Mmax, N, M, mu
  • not allowed dependency of computation: H
  • Unknown at this stage: —

The behaviour of this simulation is controlled by the ModelDescr structure rmodel.descr.

Parameters
reduced_dataan object constructing and storing all (low-dimensional) reduced matrices and vectors needed for reduced simulations.
sim_datamatlab struct with simulation data generated e.g. by detailed_simulation() or rb_reconstruction() methods.
dddd
Return values
rb_sim_datarb sim data
Generated fields of rb_sim_data:
  • a —  a(:,k) is the coefficient vector of the reduced simulation at time \(t^{k-1}\)
  • Delta —  Delta
  • sat_a —  sat a
  • vel_a —  vel a
  • prs_a —  prs a
  • exit_flags —  exit flags
  • outputs —  outputs

Definition at line 19 of file rb_simulation_impl.m.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

TwoPhaseFlow.ReducedModel.ddescr_checks
static
Initial value:
= struct(" \
'init_values_algorithm', {{\@(x) isequal(class(x), 'function_handle')}} \
")

This constant is used for a consistency check of the model descr with help of IModel.struct_check()


Default: struct(" \ 'init_values_algorithm', {{@(x) isequal(class(x), 'function_handle')}} \ ")

Definition at line 66 of file ReducedModel.m.

TwoPhaseFlow.ReducedModel.t

current time instance

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

Definition at line 42 of file ReducedModel.m.

TwoPhaseFlow.ReducedModel.tstep

current time step

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

Definition at line 53 of file ReducedModel.m.


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