1 classdef RbReducedDataNode < Greedy.User.IReducedDataNode
3 % depending on reduced basis space information only. (e.g. reduced matrices
28 properties (SetAccess =
private, Dependent)
38 % constructor
for the generation of the reduced data.
41 % rmodel: of type NonlinEvol.ReducedModel
44 % Alternative synopsis:
46 % a reduced data node and (optionally) extracting smaller matrices.
52 copy_extract(rd, copy, rmodel);
54 fill_fields(rd, rmodel, detailed_data);
56 error('Did not find constructor for your arguments');
60 function conds = get_conds(this)
61 if ~isempty(this.Nmass)
62 conds.Nmass = condest(this.Nmass);
64 if ~isempty(this.LL_I)
65 conds.LL_I = condest(this.LL_I);
69 function N = get.N(this)
70 N = size(this.a0{1},2);
73 function yesno = needs_subset_copy(
this, rmodel)
74 %
function yesno = needs_subset_copy(
this, rmodel)
75 % @copybrief .Greedy.User.IReducedDataNode.needs_subset_copy()
77 % @copydetails .Greedy.User.IReducedDataNode.needs_subset_copy()
80 % rmodel: of type NonlinEvol.ReducedModel
81 yesno = this.N ~= rmodel.
N;
85 methods(Access=
private)
87 function fill_fields(this, rmodel, detailed_data)
89 model_data = detailed_data.model_data;
92 this.a0 = rb_init_values(rmodel, detailed_data, 1);
93 [this.LL_I, this.bb_I] = NonlinEvol.
ReducedData.rb_operators(rmodel, detailed_data, 1);
94 this.Nmass = detailed_data.RB' * A * detailed_data.RB;
98 function copy_extract(this, reduced_data, rmodel)
100 % extract correct N-sized submatrices and subvectors from reduced_data
101 if rmodel.N > reduced_data.N
102 error('N too large for current size of reduced basis!');
107 this.a0 = subblock_sequence(reduced_data.a0,1:N);
108 this.LL_I = subblock_sequence(reduced_data.LL_I,1:N,1:N);
109 this.bb_I = subblock_sequence(reduced_data.bb_I,1:N);
110 if ~isempty(reduced_data.Nmass)
111 this.Nmass = reduced_data.Nmass(1:N,1:N);