Hi, I am wondering what the restrict function is doing in Function object?, specifically
*void restrict(double *w, const FiniteElement &element, const Cell &dolfin_cell, const double vertex_coordinates, const ufc::cell &ufc_cell) const Restrict function to local cell (compute expansion coefficients w)
Arguments w (list of doubles) Expansion coefficients. element (FiniteElement) The element. dolfin_cell (Cell) The cell. ufc_cell (ufc::cell). The ufc::cell.
what is the expansion coefficients w representing?
Thanks for your reply, I actually copied the restrict function prototype from function.h, I wonder is the expansion coefficient the dof value of function?
For nodal finite elements (which in FEniCS all should be) expansion coefficients are values of degrees of freedom \phi_j: P \rightarrow \mathbb R.
Trivially for f \in P you have \phi_j(f) = \phi_j(\sum_{i=1}^N c_i b_i) = \sum_{i=1}^N c_i \phi_j(b_i) = \sum_{i=1}^N c_i \delta_{ij} = c_j.
What method restrict does is local interpolation of the owning Function into provided finite element (const FiniteElement &element). It needs also some information about cell (vertex coordinates) to compute geometric quantities for non-affine mapped elements.
The result is an array of N values stored into double *w, where N is local dimension of the finite element on that cell.
If you are for example restricting P1 function to P2 finite element, then P1 function is evaluated at degrees of freedom of P2 space (located at vertices and midpoints for triangle) and these are stored into w.