rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
gen_detailed_model.m
Go to the documentation of this file.
1 function dmodel = gen_detailed_model(descr)
2 % function dmodel = gen_detailed_model(descr)
3 % generates an IDetailedModel instance from a description structure.
4 %
5 % This function constructs the correct IDetailedModel instance for a ModelDescr
6 % structure. The field 'rb_problem_type' should contain the package name of the
7 % 'DetailedModel' class. If e.g. 'descr.rb_problem_type' equals the string
8 % 'LinEvol', an object of type LinEvol.DetailedModel is returned.
9 %
10 % The class type of the returned object can also be chosen explictly by
11 % specifying the field 'descr.dmodel_constructor'.
12 %
13 % Parameters:
14 % descr: a Matlab structure of type ModelDescr.
15 
16 if ~isfield(descr, 'rb_problem_type')
17  error('ModelDescr does not have the required field ''rb_problem_type''');
18 end
19 
20 if ~isfield(descr, 'dmodel_constructor') || isempty(descr.dmodel_constructor)
21  descr.dmodel_constructor = eval(['@', descr.rb_problem_type, '.DetailedModel']);
22 end
23 
24 dmodel = descr.dmodel_constructor(descr);
25 
26 end
dmodel_constructor
function pointer to the constructor of the IDetailedModel implementation.
Definition: dummyclasses.c:52
Struct with control fields for the analytical PDE functions, the discretization and the parametrizati...
Definition: dummyclasses.c:15
This is the interface for a detailed model providing methods to compute high dimensional simulation s...
function dmodel = gen_detailed_model(ModelDescr descr)
generates an IDetailedModel instance from a description structure.