rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
IInjectableNode.m
1 classdef IInjectableNode < Greedy.DataTree.Detailed.INode
2 
3  properties (Dependent)
4  RB;
5  end
6 
7  properties (Access = protected)
8  injection_name = [];
9  active = 1;
10  end
11 
12  methods
13  function iddni = IInjectableNode(ext_info, model_data, injection)
14  iddni = iddni@Greedy.DataTree.Detailed.INode(ext_info, model_data, injection);
15  iddni.injection_name = injection;
16  ext_info.child = find_active_info(this, 'Greedy.Info.POD');
17 
18  end
19 
20 
21  function RB = get.RB(this)
22  active_child = get(this, this.active);
23  RB = active_child.RB;
24  end
25 
26  function this = set.RB(this, RB)
27  active_child = get(this, this.active);
28  active_child.RB = RB;
29  end
30 
31  function this = set.active(this, value)
32  this.active = value;
33 
34  this.ext_info.child = find_active_info(this, 'Greedy.Info.POD');
35  end
36 
37  function ext_info = find_active_info(this, infoclass)
38  if isa(this.ext_info, infoclass)
39  ext_info = this.ext_info;
40  else
41  ext_info = find_active_info(get(this, this.active), infoclass);
42  end
43  end
44 
45  function propagate_info(this, info, prop_names, params)
46 
47  successful = false;
48  if isempty(prop_names)
49  prop_names = properties(info);
50  end
51  props = intersect(properties(this.info), prop_names);
52  if ~isempty(props)
53  successful = true;
54  for i = 1:length(props)
55  this.info.(props{i}) = info.(props{i});
56  end
57  end
58  props = intersect(properties(this.ext_info), prop_names);
59  if ~isempty(props)
60  successful = true;
61  for i = 1:length(props)
62  this.ext_info.(props{i}) = info.(props{i});
63  end
64  end
65  if successful && isequal(params, 'first')
66  return;
67  end
68  propagate_info(get(this, this.active), info, prop_names, params);
69  end
70 
71  end
72 
73  methods (Access = protected)
74  function auto_propagate_ext_info(this)
75  active_child = get(this, this.active);
76  propagate_info(active_child, this.ext_info.child, [], 'first');
77  end
78  end
79 
80 
81 end
DataTree implementation for generated detailed and reduced data
Definition: DuneRBLeafNode.m:2
DataTree specialization for detailed data generated by a Greedy algorithm instance.
Definition: DuneRBLeafNode.m:3
Interface class for general data tree nodes storing detailed data returned by Greedy.Interface.gen_detailed_data()
Definition: INode.m:20
Customizable implementation of an abstract greedy algorithm.
Definition: DuneRBLeafNode.m:1
a DataTree.INode extension for data nodes that can store information on their generation process...
Definition: Info.m:19