1 function res = fem_evaluate_basis(df,lcoord)
2 %
function res = fem_evaluate_basis(df,lcoord)
4 % evaluation of fem reference basis `\hat \phi_i, i=1,\ldots,m` in point
5 % `\hat x` =
'lcoord'. The argument df is a fem
7 % Res is a ndofs_per_element x dimrange (=m) array, each row being
8 % evaluation of one basis vector
9 % lcoord is a 2-vector with the barycentric coordinates in the
12 % the basis is a lagrange basis with respect to the lagrange-points
13 % counted from v1 to v2 then row-wise upward to v3
15 % the basis function is characterizes as linear combination of the
16 % standard monomial basis:
17 % `1,x,y,x^2, xy, y^2`, etc.
18 % i.e. the power_vector2.
20 % with V being the fem_weight_matrix we have
23 % (\hat phi_1, ... \hat phi_nbasefct)^T =
25 % (c_1(x),0 ,0 ,c_2(x),0 ,0 ,... c_k(x), 0, 0)
26 % (0 ,c_1(x),0 ,0 ,c_2(x),0 ,... 0 ,c_k(x), 0 )
27 % (0 ,0 ,c_1(x),0 , 0,c_2(x),... 0 , 0 , c_k(x))^T
29 % and c_i(x)= v_i * p(x)
32 % with `v_i` = i-th row of V and p(x) the powervector
34 % with k = number of scalar base functions = dim(powervector2)
36 % Bernard Haasdonk 12.1.2011
40 error('fem basis not reasonable for pdeg 0')
42 V = fem_basis_weight_matrix(df.pdeg);
43 c = V * power_vector2(lcoord,df.pdeg);
45 %nrep=[3,6,10,15,21,28];
46 nrep = (df.pdeg+1) * (df.pdeg+2)/2;
47 res = zeros(df.dimrange,nrep * df.dimrange);
49 ra = (1+(i-1)*df.dimrange):i*df.dimrange;
52 % transposition in order to have one row per basis function