1 function U = l2project(func,qdeg,grid,params)
2 %
function U = l2project(func,qdeg,grid,params)
4 %
function performing an l2 projection of an analytical
function
5 % func to the discrete
function space space. A quadrature of degree
6 % qdeg is used. params.pdeg specify the degree of the discrete fv
function.
7 % the params.evaluate_basis must be set to the correct basis
8 % evaluation algorithm. params.element_quadrature is assumed to
9 % point to the correct element quadrature rule, i.e.
triagrid, etc.
11 % result is U the column vector of dofs
13 % Bernard Haasdonk 3.9.2009
15 % result is a grid.
nelements x params.ndofs_per_element matrix
18 U = params.element_quadrature(qdeg,@func_phi_product,func, ...
21 % multiply locally with inverse reference mass matrix
22 %Utmp = reshape(U,params.ndofs_per_element,grid.
nelements);
23 M = params.local_mass_matrix(qdeg,params);
A triangular conforming grid in two dimensions.
nelements
number of overall elements (leaf + nonleaf)