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
IModel Class Referenceabstract

Detailed Description

This is the common interface for all models, detailed and reduced ones.

Definition at line 17 of file IModel.m.

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

Public Member Functions

virtual function ModelData model_data = gen_model_data ()
 generates large model data. More...
 
virtual function
sim_data = 
detailed_simulation (model_data)
 executes a detailed simulation for a given parameter More...
 
virtual function IDetailedModel this = set_mu (mu)
 sets the active parameter vector \(\mu \in {\cal M}\) More...
 
virtual function mu = get_mu ()
 returns the active parameter vector \(\boldsymbol\mu \in {\cal M}\) More...
 

Static Public Member Functions

static function ok = struct_check (descr, checks)
 executes checks on the fields of a structure object More...
 

Public Attributes

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

Member Function Documentation

function sim_data = IModel.detailed_simulation (   model_data)
pure virtual

executes a detailed simulation for a given parameter

This function computes a numerical scheme defined by a ModelDescr for the parameter set via the set_mu() method.

Parameters
model_datamodel data
Return values
sim_datastructure holding the \(H\)-dimensional simulation data.

Implemented in IReducedModel, and IDetailedModel.

function ModelData model_data = IModel.gen_model_data ( )
pure virtual

generates large model data.

This function generates e.g. a grid, which is not to be stored in the model, but required for numerics.

Return values
model_dataMatlab structure storing high dimensional data needed by detailed_simulation().

Implemented in IReducedModel, IDetailedModel, NonlinEvol.DetailedModel, LinEvolDune.DetailedModel, TwoPhaseFlow.DetailedModel, LinStatDune.DetailedModel, LinEvol.DetailedModel, LinStat.DetailedModel, and Test.DetailedModel.

function mu = IModel.get_mu ( )
pure virtual

returns the active parameter vector \(\boldsymbol\mu \in {\cal M}\)

Return values
muThe parameter vector \(\boldsymbol\mu\)

Implemented in IReducedModel, IDetailedModel, LinStatDune.ReducedModel, LinEvolDune.DetailedModel, LinEvolDune.ReducedModel, LinStatDune.DetailedModel, and ThermalBlock.DetailedModel.

function IDetailedModel this = IModel.set_mu (   mu)
pure virtual

sets the active parameter vector \(\mu \in {\cal M}\)

The parameter set here, is used by the detailed_simulation() function.

Parameters
muThe parameter vector \(\boldsymbol\mu\).
Return values
thishandle to the changed DetailedModel

Implemented in IReducedModel, IDetailedModel, LinStatDune.ReducedModel, LinEvolDune.DetailedModel, LinEvolDune.ReducedModel, LinStatDune.DetailedModel, and ThermalBlock.DetailedModel.

function ok = IModel.struct_check (   descr,
  checks 
)
static

executes checks on the fields of a structure object

This function can be used to check whether the structure descr fulfills some constraints defined by the second argument checks

The following checks can be executed
  • def(fn): Checks whether a field fn exists and is set to a non-empty value.
  • type(fn, typecheck): Checks whether the field fn fullfils a typecheck defined by a function isokay = typecheck(X) Useful choices for typecheck are e.g. @isscalar, @iscell, @isstruct
  • values(fn, candidates): Checks whether the field fn is set to one of the values given by the cell array of strings candidates
  • minmax(fn, range): Checks whether the field fn is set to a value in a given range range, which is a 2-dimensional vector.
  • own(fn, usr_check, msg): Checks whether the field fn is set to a value that fulfills a user-defined check isokay = usr_check(descr). If it fails, a message msg is printed for explanation.
Parameters
descrThe structure to be checked.
checksA structure defining which of the above described checks shall be executed.
  • All fieldnames fn of this structure are used for definition checks def(fn).
  • The field values must be set to a cell array whose first element is set to a function pointer typecheck used for a mandatory check type(fn, typecheck).
  • The following fields of the cell array are strings defining a check followed by an optional and fixed number of arguments for this check. Possible command strings are:
    • values followed by one argument candidates executing the check values(fn, candidates).
    • minmax followed by one argument range executing the check minmax(fn, range).
    • own followed by two arguments usr_check and msg executing the check own(fn, usr_check, msg).
Return values
okboolean flag indicating whether all checks passed.
Note
This method has the MATLAB method attribute Hidden set to true.
matlab documentation of method attributes.

Definition at line 210 of file IModel.m.

Here is the caller graph for this function:

Member Data Documentation

IModel.debug

an integer defining the debugging level controlling error output and extra tests during basis generation

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.

Definition at line 136 of file IModel.m.

IModel.decomp_mode

Decomposition operation mode.

A scalar flag indicating the operation mode of functions
  • 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 \(\boldsymbol\sigma_{\cdot}^{q}(\boldsymbol\mu)\) dependent on the parameters given in mu_names.

This flag is only needed if the detailed model makes use of affinely parameter dependent functions.

Note
This property has the MATLAB attribute Dependent set to true.
This property is an abstract property without implementation.
Matlab documentation of property attributes.

Definition at line 66 of file IModel.m.

IModel.mu_names

cell array of strings describing the parameters of the model

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.

Definition at line 95 of file IModel.m.

IModel.mu_ranges

cell array of vectors of size two defining the allowed interval range for the parameter components

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.

Definition at line 108 of file IModel.m.

IModel.num_cpus = 4

The number of CPUs used for parallel sessions.

Todo:
: This flag should move to the FakeMPI sigleton control structure.


Default: 4

Definition at line 53 of file IModel.m.

IModel.time_checks
static
Initial value:
= struct("'t', {{\@isscalar}}, \
'tstep', {{\@isscalar}}, \
'nt', {{\@isscalar}}, \
'dt', {{\@isscalar, \
'own', \@(model) model.dt == model.T/model.nt, \
'model.dt ~= model.T/model.nt'}} \
")

This constant can be used for a consistency check of time evolution members in the ModelDescr with help of IModel.struct_check()


Default: struct("'t', {{@isscalar}}, \ 'tstep', {{@isscalar}}, \ 'nt', {{@isscalar}}, \ 'dt', {{@isscalar, \ 'own', @(model) model.dt == model.T/model.nt, \ 'model.dt ~= model.T/model.nt'}} \ ")

Definition at line 29 of file IModel.m.

IModel.verbose

an integer defining the verbosity level of information output during basis generation

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.

Definition at line 122 of file IModel.m.


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