1 function rb_sim_data = comsol_lin_evol_rb_simulation(model,reduced_data)
2 %
function rb_sim_data = comsol_lin_evol_rb_simulation(model,reduced_data)
4 % This
function does a reduced simulation
using the rbmatlab
function
5 % lin_evol_rb_simulation.
6 % Due to the way comsol assembles the matrices the coefficients calculated
7 % by rbmatlab must be
"shifted" so thaht also the initial solution is
8 % correct. We cannot use 0 as an initial reduced basis, since that qould
9 % crash all the error estimators!
13 rb_sim_data=lin_evol_rb_simulation(model,reduced_data);
15 % since COMSOL does a homogenization the initial values must be added to
16 % the solution calculated
using rbmatlab.
17 % so the first
"calculated" solution must be 0 so that after adding the
18 % initial values detailed and reduced simulation have the same values
for
20 rb_sim_data.a(:,end) = [];
21 rb_sim_data.a=[zeros(size(rb_sim_data.a,1),1), rb_sim_data.a];