# P versus Q elements

I am currently developing a project that uses finite elements for multi-dimensional PDEs and I'm still wondering if I will use P elements (triangles in 2D and tetra in 3D) or Q elements (squares in 2D and cubes in 3D).

From what I have read on the web, the crucial point seems to be meshing which is supposed to be easier to handle with simplicies (so P elements). On the other side, Q elements are easier to implement in multidimensional cases (in my opinion).

My question is then:

Are there places in the theory where P elements would work and Q elements not? Or conversely?

My guess is that the answer is "no" or "in rare weird cases", otherwise there would be no big libraries using Q elements, but I'd like to be sure.

• Will you be using explicit time-marching schemes or implicit schemes/steady state solves? – Jesse Chan Jan 6 '15 at 14:44
• Good question, I will probably at least give a try to both of them (implicit and explicit in time). – Dr_Sam Jan 6 '15 at 14:56

If you're working w/high order elements, the two differ in approximation spaces - for P elements of order $p$, you have polynomials of total degree $p$

$x^iy^jz^k$ where $i+j+k\leq p$

versus Q elements, which give polynomials of individual degree $p$

$x^iy^jz^k$ where $i,j,k\leq p$.

At low order, the two are roughly equivalent, and in practice, both spaces usually end up giving the same convergence rates.

There are some differences concerning efficient implementations, especially for explicit timestepping, which involves inverting a mass matrix at each step. For example, usually you map a reference element to physical elements of your mesh. On simplical straight-sided elements, the change of variables factor associated with this mapping is constant. As a result, the mass matrix for each element is a scaling of the reference mass matrix, which can be exploited for low-memory time-marching implementations of Discontinuous Galerkin methods.

Efficiency for "Q" elements comes in another manner - their tensor product structure means that you can typically define basis functions through products of 1D functions

$\phi_{ijk}(x,y,z) = \phi_i(x)\phi_j(y)\phi_k(z)$.

This carries through to mass and stiffness matrices in that they are Kronecker products of 1D mass/stiffness matrices under the appropriate indexing. If you store only a single 1D matrix, this allows for efficient and low-memory matrix-free solvers at high order (even for at-scale parallel adaptive meshes). Additionally, under a special quadrature rule, the Spectral Element Method (SEM) allows for an easy-to-invert diagonal mass matrix, making time-marching for quads/hexes very efficient as well.

Q elements are usually considered to be more efficient than P elements in practice, since they produce a larger approximation space for a fewer number of unknowns. Apart from that, the two are roughly equivalent for most stable problems (as Nicola mentioned, if the problem is not discretely stable, the two can have differing effects - see also locking in elasticity).

One fundamental difference, in 3D, is that second order tetrahedrons only have degrees of freedom on the edges, while Q2 elements have dofs on faces as well.

One macroscopic consequence affects the Stokes problem solution. Sub optimal elements like P2-P0 are not stable, while Q2-Q0 are.

• Thank you for your answer, I was not aware of that! So that is something that you can do with Q elements but not with P. Any idea for the converse? – Dr_Sam Jan 6 '15 at 11:57
• Not really on top of my head... – Nicola Cavallini Jan 7 '15 at 16:15