rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
ReducedModel.m
1 classdef ReducedModel < IReducedModel
2  % a test model doing nothing
3  %
4  % In this detailed model only the name of the called member function is
5  % printed. Such it enables to set-up Greedy algorithms and check wether the
6  % functions are called in the correct order.
7  %
8  properties
9  enable_error_estimator = false;
10 
11  reduced_data_constructor = '';
12 
13  stencil_mode = 'edge';
14 
15  local_stencil_size = 1;
16  end
17 
18  methods
19  function rm = ReducedModel(detailed_model, bg_descr, crb_enabled)
20  % function rm = ReducedModel(detailed_model, bg_descr, crb_enabled)
21  % constructor
22 
23  if nargin == 1 || isempty(bg_descr)
24  bg_descr = [];
25  end
26 
27  % this implements a copy constructor if necessary...
28  rm = rm@IReducedModel(detailed_model, bg_descr);
29 
30  if isfield(bg_descr, 'reduced_data_constructor')
31  rm.reduced_data_constructor = bg_descr.reduced_data_constructor;
32  end
33 
34  if nargin >= 3
35  rm.crb_enabled = crb_enabled;
36  end
37  end
38 
39  function reduced_data = gen_reduced_data(this, detailed_data)
40  % function reduced_data = gen_reduced_data(this, detailed_data)
41  % @copybrief IReducedModelgen_reduced_data()
42  %
43  % @copydetails IReducedModelgen_reduced_data()
44  disp('calling reduced_data');
45  if isempty(this.reduced_data_constructor)
46  reduced_data = 0;
47  else
48  reduced_data = this.reduced_data_constructor(this, detailed_data);
49  end
50  end
51 
52  function reduced_data = extract_reduced_data_subset(this, reduced_data)
53  % function reduced_data = extract_reduced_data_subset(this, reduced_data)
54  % @copybrief IReducedModelextract_reduced_data_subset()
55  %
56  % @copydetails IReducedModelextract_reduced_data_subset()
57  disp('calling extract_reduced_data_subset');
58  reduced_data = 0;
59  end
60 
61  function rb_sim_data = rb_simulation(this, reduced_data)
62  % function rb_sim_data = rb_simulation(this, reduced_data)
63  % @copybrief IReducedModelrb_simulation()
64  %
65  % @copydetails IReducedModelrb_simulation()
66  disp('calling rb_simulation');
67  rb_sim_data.a = zeros(1, this.detailed_model.descr.nt);
68  end
69 
70  function a0 = rb_init_values(this, dummy)
71  % function a0 = rb_init_values(this, dummy)
72  % @copybrief rb_init_values_separable()
73  %
74  disp('calling rb_init_values');
75  a0 = 0;
76  end
77 
78  function rb_sim_data = rb_reconstruction(this, detailed_data, rb_sim_data)
79  % function rb_sim_data = rb_reconstruction(this, detailed_data, rb_sim_data)
80  % @copybrief IReducedModelrb_reconstruction()
81  %
82  % @copydetails IReducedModelrb_reconstruction()
83  disp('calling rb_reconstruction');
84  rb_sim_data.U = zeros(detailed_data.model_data.grid.nelements, this.detailed_model.descr.nt);
85  end
86 
87  function c = copy(this)
88  % function c = copy(this)
89  % @copybrief IReducedModelcopy()
90  %
91  % Return values:
92  % c: an object of type Test.ReducedModel which is a deep copy of this object.
93  c = ReducedModel(this);
94  end
95 
96  end
97 
98  methods(Static)
99  function Delta = get_estimators_from_sim_data(sim_data)
100  disp('calling get_estimators_from_sim_data');
101  Delta = 0;
102  end
103 
104  function Delta = get_estimator_from_sim_data(sim_data)
105  disp('calling get_estimator from sim_data');
106  Delta = 0;
107  end
108 
109  function U = get_dofs_from_sim_data(sim_data)
110  U = sim_data.U;
111  end
112  end
113 end
function a0 = rb_init_values_separable(IReducedModel rmodel,Greedy.DataTree.Detailed.RBLeafNode detailed_data, decomp_mode)
function computing initial values for a reduced simulation.
a test model doing nothing
Definition: ReducedModel.m:18
Test reduced basis implementation.
Definition: DetailedData.m:1
This is the interface for a reduced model providing methods to compute low dimensional reduced simula...
Definition: IReducedModel.m:17
Customizable implementation of an abstract greedy algorithm.
Definition: DuneRBLeafNode.m:1