1 function res = fem_evaluate_basis_function(df,lcoord,i)
2 %
function res = fem_evaluate_basis_function(df,lcoord,i)
4 % evaluation of single fem reference basis `\hat \phi_i, i=1,\ldots,m` in point
7 % The argument df is a fem
9 % Res is a 1 x dimrange (=m) array.
10 % lcoord is a 2-vector with the local coordinates in the
13 % the basis is a lagrange basis with respect to the lagrange-points
14 % counted from v1 to v2 then row-wise upward to v3
16 % the basis function is characterizes as linear combination of the
17 % standard monomial basis:
18 % `1,x,y,x^2, xy, y^2`, etc.
19 % i.e. the power_vector2.
21 % with V being the fem_weight_matrix we have
24 % (\hat phi_1, ... \hat phi_nbasefct)^T =
26 % (c_1(x),0 ,0 ,c_2(x),0 ,0 ,... c_k(x), 0, 0)
27 % (0 ,c_1(x),0 ,0 ,c_2(x),0 ,... 0 ,c_k(x), 0 )
28 % (0 ,0 ,c_1(x),0 , 0,c_2(x),... 0 , 0 , c_k(x))^T
30 % and c_i(x)= v_i * p(x)
33 % with `v_i` = i-th row of V and p(x) the powervector
35 % with k = number of scalar base functions = dim(powervector2)
37 % For simultaneous evaluation of all basis vectors see fem_evaluate_basis
39 % Bernard Haasdonk 12.1.2011
43 error('fem basis not reasonable for pdeg 0')
45 V = fem_basis_weight_matrix(df.pdeg);
46 v = V(ceil(i/df.dimrange),:); % ith row
47 c = v * power_vector2(lcoord,df.pdeg);
48 ncomp = mod(i-1,df.dimrange)+1;
49 res = zeros(1,df.dimrange);