6 ret_vars = {
'pressure'};
7 arg_vars = {
'velocity'};
8 arg_vars_short = {
'U'};
12 function [INC, INCoff, J] = apply(
this, descr, model_data, sim_data, NU_ind)
13 %
function INC = apply(model, model_data, sim_data, NU_ind)
15 grid = model_data.grid;
19 if nargin <= 4 || isempty(NU_ind)
20 NU_ind = 1:grid.nelements;
23 INC = sum(U(model_data.gEI(NU_ind,:)).*(grid.NX(NU_ind,:)+grid.NY(NU_ind,:)), 2) ...
24 - model_data.opdata.S_upper + model_data.opdata.S_lower;
29 [J] = full_matrix(this, descr, model_data, sim_data);
37 function [LL, bb] = full_matrix(this, descr, model_data, params)
39 grid = model_data.grid;
40 n = model_data.grid.nelements;
44 if ~isfield(params, 'm')
45 params.m = model_data.gn_edges;
47 if ~isfield(params, 'Uoff')
51 sp3i = repmat(1:n, 1, 4);
52 sp3j = model_data.gEI + params.Uoff;
53 sp3vals = grid.NX + grid.NY;
54 LL = sparse(sp3i,sp3j,sp3vals, n, params.m);
56 bb = -model_data.opdata.S_upper + model_data.opdata.S_lower;
59 function [LL_comps, bb_comps] = components(this, descr, model_data)
60 [LL,bb] = full_matrix(this, descr, model_data);
65 function [LL_coeffs, bb_coeffs] = coefficients(
this, descr)
70 function ret_size = ret_size(this, model_data, NU_ind)
71 if nargin == 2 || isempty(NU_ind)
72 ret_size = model_data.grid.nelements;
74 ret_size = length(NU_ind);
78 function arg_size = arg_size(this, model_data, NU_ind)
79 arg_size = model_data.gn_edges;
82 function ipm = inner_product_matrix(this, model_data)
83 ipm = speye(size(model_data.W));
86 function eind = compute_TM_global(this, grid, TM)
91 function [LL, bb] = gram_projection(this, model, detailed_data)
93 dd_vel = get_by_description(detailed_data, 'velocity');
94 dd_prs = get_by_description(detailed_data, 'pressure');
97 Nvel = get_by_description(model.N, 'velocity');
98 Nprs = get_by_description(model.N, 'pressure');
100 model_data = dd_vel.model_data;
101 jn = model_data.gn_edges;
102 jm = model_data.grid.nelements;
104 jj = repmat((1:jm)', 1, 4);
105 spvals = model_data.grid.NX + model_data.grid.NY;
106 Jump = sparse(ii(:), jj(:), spvals(:), jn, jm);
107 RB_prs_jump = Jump * RB_prs(:,1:Nprs);
109 [~,bb] = full_matrix(this, model.descr, model_data);
111 % diamondW = model_data.diamondW;
112 % LL = RB_prs_jump' * diamondW * RB_vel;
113 LL = RB_prs_jump' * RB_vel(:,1:Nvel);
115 % bb = RB_prs' * model_data.W * bb;
116 bb = RB_prs(:,1:Nprs)' * bb;
119 function [LL_comps, bb_comps] = gram_project_components(this, rmodel, detailed_data)
120 [LL, bb] = gram_projection(this, rmodel, detailed_data);
Interface for a localized operator that fulfills the so-called -independent DOF dependence.