rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
ReducedData.m
1 classdef ReducedData < Greedy.User.IReducedDataNode
2  % Test reduced data implementation
3 
4  properties(SetAccess=private)
5  % number of reduced basis vectors stored in this data node.
6  N;
7 
8  % number of collateral reduced basis vectors stored in this data node.
9  M;
10 
11  % number of collateral reduced basis vectors used for error estimation.
12  Mstrich;
13  end
14 
15  methods
16  function rd = ReducedData(rmodel, detailed_data)
17  % Constructor for the generation of the reduced matrices and vectors.
18  %
19  if nargin == 0
20  error('Test.ReducedData constructor needs an argument');
21  elseif nargin == 2 && isa(rmodel, 'IReducedModel') ...
22  && isa(detailed_data, 'Test.ReducedData')
23  copy = detailed_data;
24  copy_extract(rd, copy, rmodel);
25  elseif nargin == 2
26  fill_fields(rd, rmodel, detailed_data);
27  else
28  error('Did not find constructor for your arguments');
29  end
30  end
31 
32  function conds = get_conds(this)
33  disp('calling get_conds');
34  conds = [];
35  end
36 
37  end
38 
39  methods(Access=private)
40 
41  function fill_fields(this, rmodel, detailed_data)
42  this.N = rmodel.N;
43  this.M = rmodel.M;
44  this.Mstrich = rmodel.Mstrich;
45  end
46 
47  function copy_extract(this, copy, rmodel)
48  this.N = rmodel.N;
49  this.M = rmodel.M;
50  this.Mstrich = rmodel.Mstrich;
51  end
52  end
53 
54  methods
55 
56  function yesno = needs_subset_copy(this, rmodel)
57  % function yesno = needs_subset_copy(this, rmodel)
58  % @copybrief ::GreedyUser.IReducedDataNode.needs_subset_copy()
59  %
60  % @copydetails ::GreedyUser.IReducedDataNode.needs_subset_copy()
61  %
62  % Parameters:
63  % rmodel: of type NonlinEvol.ReducedModel
64 
65  yesno = rmodel.N ~= this.N || rmodel.M ~= this.M || this.Mstrich ~= rmodel.Mstrich;
66  end
67 
68 
69  end
70 end
71 
a test model doing nothing
Definition: ReducedModel.m:18
Interface for leaf nodes of the DataTree in Greedy.User.ReducedData objects.
Reduced basis implementation for non-linear evolution equations.
Test reduced basis implementation.
Definition: DetailedData.m:1
Interface classes to be implemented by the Greedy.Algorithm user.
Customizable implementation of an abstract greedy algorithm.
Definition: DuneRBLeafNode.m:1