rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
fv_h1_inner_product_matrix.m
Go to the documentation of this file.
1 function W = fv_h1_inner_product_matrix(model,model_data)
2 %function W = fv_h1_inner_product_matrix(model,model_data)
3 % function computing the h1 inner product matrix for fv-functions on the grid.
4 %
5 % By this function, inner products between functions can be
6 % computed by their DOF vectors: `<U_1, U_2>_{H^1,h} = U_1' W U_2`
7 %
8 % return values:
9 % W : inner product matrix
10 
11 % Bernard Haasdonk 20.7.2006
12 
13 grid = model_data.grid;
14 
15 % currently simple diagonal weighting of element values sufficient
16 W = sparse(1:grid.nelements,1:grid.nelements,grid.A);
17 H = grid.nelements;
18 i=reshape(repmat([1:H],5,1),5*H,1);
19 j=reshape([1:H;grid.NBI'],5*H,1);
20 s=100*grid.DC(1,1) * reshape([-ones(1,H);1/4*ones(4,H)],5*H,1);
21 s(j<1);
22 j(j<1)=1;
23 WH = sparse(i,j,s,H,H,5*H);
24 W = W + WH' * WH;
25 
function W = fv_h1_inner_product_matrix(model, model_data)
function computing the h1 inner product matrix for fv-functions on the grid.