2 % a very simple detailed data implementation gathering several detailed
3 % snapshots spanning the reduced basis space.
5 % If
this IDetailedData implementation is used, a simple reduced basis
6 % with snapshots from detailed simulations
for directly specified
7 % parameters is generated. The list of parameters is given by
'mu_list'.
8 % Alternatively, the basis generation method can be customized with
9 % the field
'customized_basis_generation_ptr'.
12 % matrix of size
'H x N' holding the Dof vectors of the reduced basis
13 % snapshot vectors spanning the reduced basis space `{\cal W}_{\text{red}}
17 % a list of mu vectors
for which snapshots shall be added to the
20 % @
default: By
default only the barycenter of the parameter domain defined
25 %
boolean flag indicating whether a POD shall be applied to the reduced
29 %
boolean flag indicating whether the reduced basis vectors shall be
31 do_orthonormalize =
false;
33 %
function handle to custom basis generation algorithm, the
34 customized_basis_generation_ptr = [];
46 if ~isempty(sdd.customized_basis_generation_ptr)
47 sdd.RB = sdd.customized_basis_generation_ptr(rmodel, sdd);
49 if isempty(sdd.mu_list)
50 sdd.mu_list = {cellfun(@mean, rmodel.descr.mu_ranges,
'UniformOutput',
true)};
54 for m = 1:length(sdd.mu_list)
55 set_mu(rmodel,sdd.mu_list{m});
56 sim_data = detailed_simulation(rmodel,model_data);
58 Utot = rmodel.get_dofs_from_sim_data(sim_data);
60 U = rmodel.get_dofs_from_sim_data(sim_data);
66 Utot = PCA_fixspace(Utot, []);
68 if sdd.do_orthonormalize
69 A = rmodel.descr.get_inner_product_matrix(model_data);
70 Utot = orthonormalize_gram_schmidt(Utot, A);
76 function delete_rb(this, index)
77 % function this = delete_rb(this, index)
78 % removes certain reduced basis functions.
81 % index: an index vector of reduced basis functions to be removed
82 this.RB = this.RB(:,setdiff(1:size(this.RB,2), index));
85 function siz = get_rb_size(this, dummy)
86 % function siz = get_rb_size(this, dummy)
87 % returns the dimension of the stored reduced basis space
89 siz = size(this.RB, 2);