3 % generates an
IReducedModel instance from a description structure.
6 % structure. The field
'rb_problem_type' should contain the
package name of the
7 % 'ReducedModel' class. If e.g. 'descr.rb_problem_type' equals the string
8 % 'LinEvol', an object of type LinEvol.ReducedModel is returned.
10 % The class type of the returned object can also be chosen explictly by
11 % specifying the field 'descr.rmodel_constructor'.
14 % bg_descr: a Matlab structure of type BasisGenDescr.
16 if nargin == 1 || isempty(bg_descr);
18 fns = fieldnames(descr);
19 rbfnsI = cellfun(@(X) length(X)>3 && isequal(X(1:3),
'RB_'), fns);
21 for i = 1:length(rbfns)
23 bg_descr.(rbfn(4:end)) = descr.(rbfn);
24 descr = rmfield(descr, rbfn);
26 bg_descr.rb_problem_type = descr.rb_problem_type;
29 if ~isfield(bg_descr,
'rb_problem_type')
30 error('
BasisGenDescr does not have the required field ''rb_problem_type''');
33 if ~isfield(bg_descr, 'rmodel_constructor') || isempty(bg_descr.rmodel_constructor)
34 bg_descr.rmodel_constructor = eval(['@', bg_descr.rb_problem_type, '.ReducedModel']);
37 if ~isfield(bg_descr, 'detailed_data_constructor') || isempty(bg_descr.detailed_data_constructor)
38 bg_descr.detailed_data_constructor = eval(['@', bg_descr.rb_problem_type, '.DetailedData']);
41 if ~isfield(bg_descr, 'reduced_data_constructor') || isempty(bg_descr.reduced_data_constructor)
42 bg_descr.reduced_data_constructor = eval(['@', bg_descr.rb_problem_type, '.ReducedData']);
45 rmodel = bg_descr.rmodel_constructor(dmodel, bg_descr);
Struct with control fields for the reduced basis generation.
This is the interface for a reduced model providing methods to compute low dimensional reduced simula...
function rmodel = gen_reduced_model(dmodel,BasisGenDescr bg_descr)
generates an IReducedModel instance from a description structure.