rbmatlab 0.10.01
discfunc/fem/fem_evaluate.m
00001 function res = fem_evaluate(df, eindices, lcoord, dummy1, dummy2)
00002 %function res = fem_evaluate(df, eindices, lcoord)
00003 %
00004 % method evaluating a fem function df in local coordinates in the point
00005 % `\hat x` = lcoord in several elements simultaneously given by 
00006 % indices eindices.
00007 % res is a length(eindices) x dimrange vector 
00008 
00009 % dummy arguments is ignored, only required for consistency to 
00010 % other discfunctypes
00011 
00012 % Bernard Haasdonk 12.1.2011
00013 
00014 % evaluate all reference basis functions in the lcoords, 
00015 % is a ndofs_per_element x dimrange matrix
00016 basis_values = fem_evaluate_basis(df,lcoord);
00017 %res = zeros(params.dimrange,length(eindices));
00018 %res = zeros(length(eindices),params.dimrange);
00019 % linear combination with DOFS to get function values
00020 gid = df.global_dof_index(eindices,:); % only first scalar component!
00021 % insert the incremented dofs
00022 ind = ones(df.dimrange,1)*(1:size(gid,2)); 
00023 ind = ind(:)';
00024 ggid = gid(:,ind);
00025 incr = ones(size(gid,1),1) * (0:(df.dimrange-1)); 
00026 iincr = repmat(incr,1,size(gid,2));
00027 gid = ggid+iincr;
00028 d = df.dofs(gid);
00029 d = reshape(d,length(eindices),df.ndofs_per_element);
00030 res = d * basis_values; 
00031 
00032 %fem_evaluate_basis([0,0],params)'*dofs(1,:)'
00033 %| \docupdate 
All Classes Namespaces Files Functions Variables