# Quadrature in finite element methods | How should I compute integrals involving the solution of the last time step?

Let $\Delta\subseteq\mathbb R^2$ denote the triangle spanned by $(0,0)$, $(1,0)$ and $(0,1)$ and $$\mathbb P_r(\Delta):=\left\{p:\Delta\to\mathbb R\mid p(x)=\sum_{|\alpha|\le r}\lambda_\alpha x^\alpha\text{ for all }x\in\Delta\text{ for some }(\lambda_\alpha)_{|\alpha|\le r}\subseteq\mathbb R\right\}$$ for $r\in\mathbb N_0$.

I'm numerically solving a PDE on a rectangle $\Lambda=(0,a)\times(0,b)$ triangulated using quadratic Lagrange finite elements as depicted in the following figure: In the assembly of the linear system, I need to compute integrals of the form $$\int_\Delta(u^0\circ F_{\tilde\Delta})\psi\;,\tag1$$ where $u^0$ is the solution of the previous time step, $F_{\tilde\Delta}$ is the transformation from a finite element $\tilde\Delta$ to $\Delta$ and $\psi\in\mathbb P_2(\Delta)$.

How should I compute these integrals?

By definition of the finte element space, $\left.u^0\right|_{\tilde\Delta}\in\mathbb P_2(\tilde\Delta)$. So, the integrand in $(1)$ belongs to $\mathbb P_4(\Delta)$.

That's why I guess I should use a quadrature scheme which exactly integrations $\mathbb P_4(\Delta)$-functions. However, since I only now the values of $u^0\circ F_{\tilde\Delta}$ at $a^0:=(0,0)$, $a^1:=(1,0)$, $a^2:=(0,1)$, $a^3:=(1/2,1/2)$, $a^4:=(0,1/2)$ and $a^5:=(1/2,0)$, the Gaussian quadrature ansatz $$\int_\Delta f\approx\frac12\sum_{i=0}^5w_if(a^i)\tag2$$ is somehow limited. In fact, with these $a^i$ it's only possible to exactly integrate $\mathbb P_2(\Delta)$-functions (and we have $w_0=w_1=w_2=0$, $w_3=w_4=w_5=1/3$).

So, is there no possibility to do better?

Please suppose that we have a fixed mesh (i.e. no adaptive refinement) we need to deal with.

• If you know the values at your vertices you can use the interpolation to evaluate them at the Gauss points and then use that to find your numeric integral. Apr 6 '17 at 14:54
• Your question seems to be independent of timestepping (you mention "solution of the last timestep" in the title of your question). It looks like you just need help integrating quadratic shape functions on a triangle.
– Paul
Apr 6 '17 at 16:15
• @Paul I wanted to stress the fact that $u^0$ is only known at the nodes of the mesh. Apr 6 '17 at 16:51
• @nicoguaro So, your suggestion is to use a higher order quadrature and interpolate the integrand, if necessary, with the $a^i$ being the interpolation points. Did I get you right? Apr 6 '17 at 16:53
• Not quite. You have some value on your nodes ($u^0$, for example). you can use your interpolation functions to interpolate to quadrature points. Apr 6 '17 at 19:12