rbmatlab 0.10.01
discfunc/ldg/ldg_evaluate.m
00001 function res = ldg_evaluate(df, eindices, lcoord)
00002 %function res = ldg_evaluate(df, eindices, lcoord)
00003 %
00004 % method evaluating a ldg function 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 % Bernard Haasdonk 28.1.2009
00010 
00011 % evaluate all reference basis functions in the lcoords, 
00012 % is a ndofs_per_element x dimrange matrix
00013 basis_values = ldg_evaluate_basis(lcoord,df);
00014 
00015 %res = zeros(params.dimrange,length(eindices));
00016 %res = zeros(length(eindices),params.dimrange);
00017 % linear combination with DOFS to get function values
00018 
00019 d = reshape(df.dofs,df.ndofs_per_element,df.nelements);
00020 
00021 % small loop over basis functions
00022 %for i = 1:params.ndofs_per_element
00023 %%  res = res + basis_values(:,i) * d(i,eindices);
00024 %  res = res + d(eindices,i)* basis_values(i,:);
00025 %end;
00026 
00027 %res = basis_values' * d(:,eindices); 
00028 res = d(:,eindices)' * basis_values; 
00029 
00030 %ldg_evaluate_basis([0,0],params)'*dofs(1,:)'
00031 %| \docupdate 
All Classes Namespaces Files Functions Variables