1 classdef RbReducedDataNode < Greedy.User.IReducedDataNode
3 % depending on reduced basis space information only. (e.g. reduced matrices
10 % reduced basis mass matrix.
12 % The matrix entries are:
13 % ``({ \bf N })_{ij} = \int \varphi_i \varphi_j``
18 properties (SetAccess =
private, Dependent)
28 % constructor
for the generation of the reduced data.
31 % rmodel: of type TwoPhaseFlow.ReducedModel
34 % Alternative synopsis:
36 % a reduced data node and (optionally) extracting smaller matrices.
42 copy_extract(rd, copy, rmodel);
44 fill_fields(rd, rmodel, detailed_data);
46 error('Did not find constructor for your arguments');
50 function conds = get_conds(this)
51 if ~isempty(this.Nmass)
52 conds.Nmass = condest(this.Nmass);
54 if ~isempty(this.LL_I)
55 conds.LL_I = condest(this.LL_I);
59 function N = get.N(this)
60 N = size(this.Nmass,1);
63 function yesno = needs_subset_copy(this, rmodel)
64 % function yesno = needs_subset_copy(this, rmodel)
65 % @copybrief .Greedy.User.IReducedDataNode.needs_subset_copy()
67 % @copydetails .Greedy.User.IReducedDataNode.needs_subset_copy()
71 rn = get_by_description(rmodel.N, this.
id);
76 methods(Access=private)
78 function fill_fields(this, rmodel, detailed_data)
80 this.
id = detailed_data.
id;
81 model_data = detailed_data.model_data;
83 N = get_by_description(rmodel.N, this.
id);
85 if size(detailed_data.RB, 1) == size(model_data.W,2)
88 A = model_data.diamondW;
91 this.Nmass = detailed_data.RB(:,1:N)' * A * detailed_data.RB(:,1:N);
95 function copy_extract(this, reduced_data, rmodel)
97 % extract correct N-sized submatrices and subvectors from reduced_data
98 rn = get_by_description(rmodel.N, reduced_data.
id);
99 this.
id = reduced_data.
id;
100 if rn > reduced_data.N
101 error('N too large for current size of reduced basis!');
106 if ~isempty(reduced_data.Nmass)
107 this.Nmass = reduced_data.Nmass(1:N,1:N);