1 function [RBext, dummy] = stokes_rb_supremizer_extension(model, detailed_data)
2 %
function [RBext, dummy] = stokes_rb_supremizer_extension(model, detailed_data)
4 % Simple routine computing snapshot and supremizer enrichment
for basis
11 sim_data = detailed_simulation(model, detailed_data);
13 U = model.get_dofs_from_sim_data(sim_data);
15 ndofs = detailed_data.df_info.ndofs;
16 vel_ndofs = detailed_data.df_info.values{1}.ndofs;
17 dirichlet_gids = detailed_data.bc_info.dirichlet_gids;
18 vel_dofinds = 1:vel_ndofs;
20 U(dirichlet_gids) = 0;
22 % inner product on velocity space
23 if isfield(detailed_data,
'W')
26 K = model.get_inner_product_matrix(detailed_data);
29 K = getMatrix(K) + eps*speye(ndofs);
30 K(dirichlet_gids, :) = 0;
31 K(:, dirichlet_gids) = 0;
32 K_dirichlet = sparse(dirichlet_gids, dirichlet_gids, ones(length(dirichlet_gids), 1), ndofs, ndofs);
36 A = detailed_data.operators(model, detailed_data);
38 % compute supremizer function
40 U_pre(vel_dofinds) = 0;
45 spF = spF(vel_dofinds);
46 U_pre(vel_dofinds) = [];
48 RBext =
VecMat.CompositeMatrixDefault(2);
50 RBext = set(RBext, [U(vel_dofinds), spF], 1);
51 RBext = set(RBext, U_pre, 2);