rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
PODEILeafNode.m
1 classdef PODEILeafNode < Greedy.DataTree.Detailed.ILeafNode
2  % tree node implementation for a detailed data structure holding a reduced
3  % basis and a collateral reduced basis.
4 
5  properties (Dependent)
7  RB;
8  end
9 
10  properties
11  % wrapped empirical interpolation data of type Greedy.DataTree.Detailed.EILeafNode
12  ei;
13 
14  % wrapped empirical interpolation data of type Greedy.DataTree.Detailed.RBLeafNode
15  rb;
16  end
17 
18  properties (Access = private, Hidden=true)
19  both_active = false;
20  end
21 
22  methods
23 
24  function rbeiddn = PODEILeafNode(model_data, both_active)
25  % function rbeiddn = PODEILeafNode(model_data, both_active)
26  % constructor initializing the detailed data node
27  %
28  % Parameters:
29  % both_active: boolean flag specifying whether both basis trees are
30  % extended at the same time (c.f. GreedyPlugin.PODEI)
31  rbeiddn = rbeiddn@Greedy.DataTree.Detailed.ILeafNode(model_data);
32  if nargin >= 2
33  rbeiddn.both_active = both_active;
34  end
35  end
36 
37  function RB = get.RB(this)
38  RB = this.rb.RB;
39  end
40 
41  function this = set.RB(this, value)
42  this.rb.RB = value;
43  end
44 
45  function siz = get_rb_size(this)
46  siz = get_rb_size(this.rb);
47  end
48 
49  function siz = get_ei_size(this)
50  siz = get_ei_size(this.ei);
51  end
52 
53  function node = get_active_leaf(this, model, id)
54  % function node = get_active_leaf(this, model, id)
55  % @copybrief DataTreeINodeget_active_leaf()
56  %
57  % @copydetails DataTreeINodeget_active_leaf()
58  %
59  % Return values:
60  % node: of type GreedyDataTreeDetailed::ILeafNode
61  if this.both_active
62  node = this;
63  else
64  if nargin == 2
65  id = [];
66  end
67  node = get_active_leaf(this.rb, model, id);
68  end
69  end
70 
71  function [ot1, ot2, ot3] = offtime(this, rmodel)
72  [ot3, ot1, ot2] = offtime(this.rb, rmodel);
73  [ot1, ot2, temp] = offtime(this.ei, rmodel);
74  end
75 
76 
77  function delete_rb(this, index)
78  % function delete_rb(this, index)
79  % @copybrief GreedyDataTreeDetailed::RBLeafNodedelete_rb()
80  %
81  % @copydetails GreedyDataTreeDetailed::RBLeafNodedelete_rb()
82  delete_rb(this.rb, index);
83  end
84  end
85 
86  methods
87 % function value = get_field_on_active_child(this, fieldname, model, id)
88 % if nargin <=3
89 % id = [];
90 % end
91 
92 % value = [];
93 % if ~isequal(id, 'rb')
94 % value = get_field_on_active_child(this.ei, fieldname, model, id);
95 % end
96 % if ~isequal(id, 'ei')
97 % value = [value, get_field_on_active_child(this.rb, fieldname, model, id)];
98 % end
99 % end
100 
101  function propagate_stop_flag(this, flag, on_off)
102 
103  if nargin <= 2
104  on_off = [];
105  end
106 
107  set_stop_flag(this, flag, on_off);
108  if this.both_active
109  propagate_stop_flag(this.ei, flag, on_off);
110  end
111  propagate_stop_flag(this.rb, flag, on_off);
112  end
113 
114  function stopped_flags = stopped_on_active_child(this, flags, model, id)
115  % function stopped_flags = stopped_on_active_child(this, flags, model, id)
116  % @copybrief ::GreedyDataTreeInfostopped_on_active_child()
117  %
118  % @copydetails ::GreedyDataTreeInfostopped_on_active_child()
119  %
120  % Parameters:
121  % model: of type ::IModel
122 
123  if nargin <= 3
124  id = [];
125  end
126 
127  if ischar(flags)
128  flags = { flags };
129  end
130 
131  if this.both_active
132  stopped_flags = stopped_on_active_child(this.ei, flags, model, id);
133  else
134  if length(flags) == 1
135  stopped_flags = false;
136  else
137  stopped_flags = [];
138  end
139  end
141  stopped_flags2 = stopped_on_active_child(this.rb, flags, model, id);
142  stopped_flags3 = intersect(this.stop_flags, flags);
143  if length(flags) == 1
144  stopped_flags = stopped_flags | stopped_flags2 | ~isempty(stopped_flags3);
145  else
146  stopped_flags = union(union(stopped_flags, stopped_flags2), stopped_flags3);
147  end
148 
149  end
150 
151  end
152 
153 end
interface specialization for a leaf element in a DataTree returned by the Greedy basis generation alg...
Definition: ILeafNode.m:20
DataTree implementation for generated detailed and reduced data
Definition: DuneRBLeafNode.m:2
This is the common interface for all models, detailed and reduced ones.
Definition: IModel.m:17
tree node implementation for a detailed data structure holding a reduced basis and a collateral reduc...
Definition: PODEILeafNode.m:20
tree node implementation for a detailed data structure holding a reduced basis
Definition: RBLeafNode.m:20
DataTree specialization for detailed data generated by a Greedy algorithm instance.
Definition: DuneRBLeafNode.m:3
detailed data node implementation storing a collateral reduced basis space and interpolation DOFs ...
Definition: EILeafNode.m:20
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