1 function l2err = ldg_l2error(df,func,qdeg)
2 %
function l2err = ldg_l2error(df,func,qdeg)
4 %
function computing the l2 error of an analytic
function func to
5 % the ldg
function specified by dofs. A quadrature
6 % of degree qdeg is used.
8 % func is to be called with local coordinates
9 % res = func(einds, loc ,grid,params)
10 % where res is a matrix of length(loc) x dimrange;
12 % by this also discrete function differences can be computed by
13 % creating a
ldgdiscfunc class
object from a ldg dof vector dofs2
16 % ldg_l2error(dofs,df,...);
18 % Bernard Haasdonk 5.2.2009
20 % simply pass func_df_difference_sqr and its parameters to quadrature routine.
23 % l2errssqr = triaquadrature(qdeg,@df_df_difference_sqr,df,func,grid, ...
27 %params.evaluate = @ldg_evaluate;
28 l2errssqr = triaquadrature(qdeg,@df_func_difference_sqr,df,func);
30 l2err = sqrt(sum(l2errssqr));
an ldg shape functions implementation