rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
fem_evaluate.m
1 function res = fem_evaluate(df, eindices, lcoord, dummy1, dummy2)
2 %function res = fem_evaluate(df, eindices, lcoord)
3 %
4 % method evaluating a fem function df in local coordinates in the point
5 % `\hat x` = lcoord in several elements simultaneously given by
6 % indices eindices.
7 % res is a length(eindices) x dimrange vector
8 
9 % dummy arguments is ignored, only required for consistency to
10 % other discfunctypes
11 
12 % Bernard Haasdonk 12.1.2011
13 
14 % evaluate all reference basis functions in the lcoords,
15 % is a ndofs_per_element x dimrange matrix
16 basis_values = fem_evaluate_basis(df,lcoord);
17 %res = zeros(params.dimrange,length(eindices));
18 %res = zeros(length(eindices),params.dimrange);
19 % linear combination with DOFS to get function values
20 gid = df.global_dof_index(eindices,:); % only first scalar component!
21 % insert the incremented dofs
22 ind = ones(df.dimrange,1)*(1:size(gid,2));
23 ind = ind(:)';
24 ggid = gid(:,ind);
25 incr = ones(size(gid,1),1) * (0:(df.dimrange-1));
26 iincr = repmat(incr,1,size(gid,2));
27 gid = ggid+iincr;
28 d = df.dofs(gid);
29 d = reshape(d,length(eindices),df.ndofs_per_element);
30 res = d * basis_values;
31 
32 %fem_evaluate_basis([0,0],params)'*dofs(1,:)'
33 %| \docupdate