rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
ReducedModel.m
1 classdef ReducedModel < IReducedModel
2  % reduced model for linear stationary problems as given by a
4 
5  properties
6  enable_error_estimator = false;
7  end
8 
9  methods
10  function rm = ReducedModel(dmodel, bg_descr)
11  % function rm = ReducedModel(detailed_model, basis_generator)
12  % Constructor for the reduced model.
13  %
14  % Parameters:
15  % dmodel: of type LinStat.DetailedModel
16 
17  % this implements a copy constructor if necessary...
18  rm = rm@IReducedModel(dmodel, bg_descr);
19 
20  end
21 
22  %
23  %
24  % Parameters:
25  % reduced_data: of type LinStat.ReducedData
26  rb_sim_data = rb_simulation(this, reduced_data);
27 
28  function rb_sim_data = rb_reconstruction(this, detailed_data, rb_sim_data)
29  % function rb_sim_data = rb_reconstruction(this, detailed_data, rb_sim_data)
30  % @copybrief IReducedModel.rb_reconstruction()
31  %
32  % Parameters:
33  % detailed_data: of type LinStat.DetailedData
34  % rb_sim_data: struct holding reduced simulation data returned by IReducedModelrb_simulation().
35  %
36  % Return values:
37  % rb_sim_data: struct holding the reduced simulation results and their
38  % reconstructions.
39  %
40  % (trivial) function computing a detailed reconstruction by linear
41  % combination of the coefficients in the simulation data with the
42  % orthonormal reduced basis RB
43 
44  % Bernard Haasdonk 22.2.2011
45 
46  if ~isfield(rb_sim_data,'uh')
47  rb_sim_data.uh = femdiscfunc([],detailed_data.model_data.df_info);
48  end;
49  rb_sim_data.uh.dofs = ...
50  detailed_data.RB(:,1:length(rb_sim_data.uN)) * rb_sim_data.uN;
51  end
52 
53  function c = copy(this)
54  % function c = copy(this)
55  % @copybrief IReducedModel.copy()
56  %
57  % Return values:
58  % c: an object of type LinStat.ReducedModel which is a deep copy of
59  % this object.
60  c = LinStat.ReducedModel(this);
61  end
62 
63  end
64  methods (Static)
65  function Delta = get_estimators_from_sim_data(rb_sim_data)
66  % function Delta = get_estimators_from_sim_data(sim_data)
67  % @copybrief IReducedModel.get_estimators_from_sim_data()
68  %
69  % @copydetails IReducedModel.get_estimators_from_sim_data()
70  Delta = rb_sim_data.Delta;
71  end
72 
73  function Delta = get_estimator_from_sim_data(rb_sim_data)
74  % function Delta = get_estimator_from_sim_data(sim_data)
76  %
78  Delta = rb_sim_data.Delta(end);
79  end
80 
81 
82  end
83 end
class representing a continous piecewise polynomial function of arbitrary dimension. DOFS correspond to the values of Lagrange-nodes.
Definition: femdiscfunc.m:17
reduced model for linear stationary problems as given by a LinStat.DetailedModel. ...
Definition: ReducedModel.m:18
static function Delta = get_estimator_from_sim_data(rb_sim_data)
Static helper method returning an error estimator for the whole reduced trajectory generated by rb_s...
Reduced basis implementation for linear stationary PDEs.
virtual function IReducedModel c = copy()
function that deep copies this handle class
Reduced data implementation for linear stationary problems with finite element discretizations.
Definition: ReducedData.m:18
So far, this only implements the SimpleDetailedData class.
Definition: DetailedData.m:18
Detailed model for a linear stationary problem with a Finite element discretization.
Definition: DetailedModel.m:18
This is the interface for a reduced model providing methods to compute low dimensional reduced simula...
Definition: IReducedModel.m:17
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 ...