rbmatlab  1.13.10
 All Classes Namespaces Files Functions Variables Groups Pages
ReducedModel.m
1 classdef ReducedModel < IReducedModel
2  % reduced model for linear stationary problems as given by a
3  % LinStat.DetailedModel.
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)
68  %
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