1 function res = fem_matrix_adv_integral_kernel(x,model,df_info,i,j)
2 %
function res = fem_matrix_adv_integral_kernel(x,model,df_info,i,j)
4 % auxiliary
function for integral kernel
for A_adv
5 % integral kernel on all elements simultaneously
6 % here x is in reference triangle!
7 % f(x) = (hatphi_j) b^T * (JIT * grad hatphi_i)
8 % minus and multiplication with |det(DF)| is realized in caller
10 %
function can integrate cell array valued functions
12 % B. Haasdonk 22.2.2011
15 gradient_hat_phi_i = fem_evaluate_scalar_basis_function_derivative(df_info,x,i)
';
16 hat_phi_j = fem_evaluate_basis_function(df_info,x,j);
17 v = model.velocity(df_info.grid,1:df_info.grid.nelements,x,model);%local model!
18 JIT = df_info.grid.JIT;
21 % the following is vectorial of size nelements!
22 res = hat_phi_j * ( v(:,1) .* (JIT(:,1,1) * gradient_hat_phi_i(1) ...
23 + JIT(:,1,2)* gradient_hat_phi_i(2)) ...
24 + v(:,2) .* (JIT(:,2,1) * gradient_hat_phi_i(1) ...
25 + JIT(:,2,2)* gradient_hat_phi_i(2)));
27 res = cell(1,length(v));
29 res{q} = hat_phi_j * ( v{q}(:,1) .* (JIT(:,1,1) * gradient_hat_phi_i(1) ...
30 + JIT(:,1,2)* gradient_hat_phi_i(2)) ...
31 + v{q}(:,2) .* (JIT(:,2,1) * gradient_hat_phi_i(1) ...
32 + JIT(:,2,2)* gradient_hat_phi_i(2)));