rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
func_phi_product.m
1 function res = func_phi_product(lcoord,func,params)
2 %function res = func_phi_product(lcoord,func,params)
3 %
4 % auxiliary function computing the product, which is used in l2
5 % projecting a given analytical function.
6 % lcoord is a 2-vector of local coordinates, func the analytical
7 % function with calling syntax func(einds,lcoord,grid,params)
8 % res is a vector of projected values on all elements. This
9 % function is used for integration and results in the dof values
10 % of the l2-projected function.
11 % params.evaluate_basis is supposed to be a function doing
12 % point-evaluation of basis functions
13 
14 % Bernard Haasdonk 2.2.2009
15 
16 % Phi will be a ndofs_per_element x dimrange matrix
17 Phi = params.evaluate_basis(lcoord,params);
18 %Phitrans = Phi';
19 nel = params.grid.nelements;
20 % F will be a nelements x dimrange matrix
21 %F = func(1:nel,ones(nel,1)*lcoord(:)',grid,params);
22 F = func(1:nel,lcoord(:)',params.grid,params);
23 % small loop over dofs
24 
25 res = Phi * F';
26 
27 
28 %| \docupdate