5 %
function computing a RB basis extension
for given parameters by
8 % The choice is made by complete time simulation
for the current parameter `mu`
9 % set via last call to set_mu() and taking the principal component of PCA
10 % keeping the RB as fixspace. This single vector is orthonormalized with
11 % respect to RB and returned in RBext.
13 % Return argument dummy is a superfluous argument not used in this routine, but
14 % necessary for a uniform argument list compatible with other extension
17 % required fields of model:
18 % mu_names : cell array of names of the parameter-vector
20 % nr_extension_modes : the number of the return basis vectors
22 % RBext : the new reduced basis vectors meant for extension of the current
24 % dummy : dummy variable making argument list compatible with other extenstion
28 % Bernard Haasdonk 14.10.2005
32 % cache detailed simulation
33 % sim_data = cached_detailed_simulation(model,detailed_data,sim_params);
34 %model_data.grid = detailed_data.grid;
35 %model_data.W = detailed_data.W;
37 %tmp_params.mu = sim_params.mu;
38 %model = model.set_mu(model,mu);
39 % use detailed_data as model_data here
41 % take care, that the arguments do not change throughout parameter variation!
42 % detailed_data: RB_info, V, W
43 % model: N, Nmax, base_model
46 % take care to remove some changed fields from model and detailed
47 % data, such that filecaching works!!! in RB_extension_algorithm
50 ifm = model.filecache_ignore_fields_in_model;
51 for i = 1:length(model.filecache_ignore_fields_in_model);
52 if isfield(model,ifm{i})
53 tmp_model = rmfield(tmp_model,ifm{i});
56 ifm = model.filecache_ignore_fields_in_detailed_data;
57 dim_RB = size(model.get_rb_from_detailed_data(detailed_data));
58 tmp_detailed_data = ...
59 model.set_rb_in_detailed_data(detailed_data, zeros(dim_RB(1),0));
60 for i = 1:length(model.filecache_ignore_fields_in_detailed_data);
61 if isfield(detailed_data,ifm{i})
62 tmp_detailed_data = rmfield(tmp_detailed_data,ifm{i});
69 U = model.get_dofs_from_sim_data(sim_data);
71 % select vectors
for extension
73 RBextall = PCA_fixspace(U,...
74 model.get_rb_from_detailed_data(detailed_data), ...
75 model.get_inner_product_matrix(detailed_data), ...
76 model.nr_extension_modes);
79 RBext = RBextall(:, 1:model.nr_extension_modes);
81 disp('warning: did not find basis extension in PCA_fixspace!!!');
85 %disp('check new basis-vector!!')
function varargout = filecache_function(funcptr, varargin)
function used for file-caching other function calls.
Customizable implementation of an abstract greedy algorithm.
function [ RBext , dummy ] = RB_extension_PCA_fixspace_flexible(model, detailed_data)
function computing a RB basis extension for given parameters by the POD-Greedy algorithm.