25. Non-conforming Finite Element Methods#
In a conforming finite element method, one chooses a sub-space \(V_h \subset V\), and defines the finite element approximation as
For reasons of simpler implementation, or even of higher accuracy, the conforming framework is often violated. Examples are:
The finite element space \(V_h\) is not a sub-space of \(V = H^m\). Examples are the non-conforming \(P^1\) triangle, and the Morley element for approximation of \(H^2\).
The Dirichlet boundary conditions are interpolated in the boundary vertices.
The curved domain is approximated by straight sided elements
The bilinear-form and the linear-form are approximated by inexact numerical integration
The lemmas by Strang are the extension of Cea’s lemma to the non-conforming setting.
Ref: Gil Strang: Variational crimes in the finite element method
25.1. The First Lemma of Strang#
In the first step, let \(V_h \subset V\), but the bilinear-form and the linear-form are replaced by mesh-dependent forms
and
We do not assume that \(A_h\) and \(f_h\) are defined on \(V\). We assume that the bilinear-forms \(A_h\) are uniformly coercive, i.e., there exists an \(\alpha_1\) independent of the mesh-size such that
The finite element problem is defined as
First Lemma of Strang: Assume that
\(A(.,.)\) is continuous on \(V\)
\(A_h(.,.)\) is uniformly coercive
Then there holds
\[\begin{eqnarray*} \| u - u_h \| & \preceq & \inf_{v_h \in V_h} \left\{ \| u - v_h \| + \sup_{w_h \in V_h} \frac{|A(v_h, w_h) - A_h (v_h, w_h)|}{\| w_h \|} \right\} \\ & & + \sup_{w_h \in V_h} \frac{f(w_h) - f_h (w_h)}{\| w_h \|} \end{eqnarray*}\]
Proof: Choose an arbitrary \(v_h \in V_h\), and set \(w_h := u_h - v_h\). We use the uniform coercivity, and the definitions of \(u\) and \(u_h\):
Divide by \(\| u_h - v_h \| = \| w_h \|\), and use the continuity of \(A(.,.)\):
Using the triangle inequality, the error \(\| u - u_h \|\) is bounded by
The lemma is proven. \(\Box\)
Example: Lumping of the \(L_2\) bilinear-form: Define the \(H^1\) - bilinear-form
and perform Galerkin discretization with \(P^1\) triangles. The second term leads to a non-diagonal matrix. The vertex integration rule
is exact for \(v \in P^1\). We apply this integration rule for the term \(\int u v \, dx\):
The bilinear form is now defined only for \(u, v \in V_h\), since point evaluation is not defined on \(H^1\) for \(d \geq 2\). The integration is not exact, since \(u v \in P^2\) on each triangle.
Inserting the nodal basis \(\varphi_i\), we obtain a diagonal matrix for the second term:
To apply the first lemma of Strang, we have to verify the uniform coercivity
which is done by transformation to the reference element. The consistency error can be estimated by (exercise!)
Summation over the elements give
The first lemma of Strang proves that this modification of the bilinear-form preserves the order of the discretization error:
A diagonal \(L_2\) matrix has some advantages:
It avoids oscillations in boundary layers (exercises!)
In explicit time integration methods for parabolic or hyperbolic problems, one has to solve linear equations with the \(L_2\)-matrix. This becomes cheap for diagonal matrices. See Mass lumping and local time-stepping
25.2. The Second Lemma of Strang#
In the following, we will also skip the requirement \(V_h \subset V\). Thus, the norm \(\|.\|_V\) cannot be used on \(V_h\), and it will be replaced by mesh-dependent norms \(\|.\|_h\). These norms must be defined for \(V + V_h\). As well, the mesh-dependent forms \(A_h(.,.)\) and \(f_h(.)\) are defined on \(V + V_h\). We assume
uniform coercivity:
\[ A_h (v_h, v_h) \geq \alpha_1 \| v_h \|_h^2 \qquad \forall \, v_h \in V_h \]continuity:
\[ A_h (u, v_h) \leq \alpha_2 \| u \|_h \| v_h \|_h \qquad \forall \, u \in V + V_h, \; \forall \, v_h \in V_h \]
The error can now be measured only in the discrete norm \(\| u - u_h \|_{V_h}\).
Second Lemma of Strang:
Under the above assumptions there holds
\[ \| u - u_h \|_h \preceq \inf_{v_h \in V_h} \| u - v_h \|_h + \sup_{w_h \in V_h} \frac{| A_h(u,w_h) - f_h(w_h) |}{\| w_h \|_h} \]
Remark: The first term in the estimate is the approximation error, the second one is called consistency error.
Proof: Let \(v_h \in V_h\). Again, set \(w_h = u_h - v_h\), and use the \(V_h\)-coercivity:
Again, divide by \(\| u_h - v_h\|\), and use continuity of \(A_h(.,.)\):
The rest follows from the triangle inequality as in the first Lemma of Strang. \(\Box\)
The non-conforming \(P^1\) triangle
The non-conforming \(P^1\) triangle is also called the Crouzeix-Raviart element.
The finite element space generated by the non-conforming \(P^1\) element is
The functions in \(V_h^{nc}\) are not continuous across edges, and thus, \(V_h^{nc}\) is not a sub-space of \(H^1\). We have to extend the bilinear-form and the norm in the following way:
and
We consider the Dirichlet-problem with \(u = 0\) on \(\Gamma_D\). Thus, \(\| \cdot \|_{V_h}\) is a norm.
from ngsolve import *
from ngsolve.webgui import Draw
mesh = Mesh(unit_square.GenerateMesh(maxh=0.15))
fes = FESpace("nonconforming", mesh, order=1, dirichlet=".*")
u,v = fes.TnT()
a = BilinearForm(grad(u)*grad(v)*dx).Assemble()
f = LinearForm(5*v*dx).Assemble()
gfu = GridFunction(fes)
gfu.vec.data = a.mat.Inverse(freedofs=fes.FreeDofs())*f.vec
Draw (gfu, deformation=True);
We will apply the second lemma of Strang.
The continuous \(P^1\) finite element space \(V_h^c\) is a sub-space of \(V_h^{nc}\). Let \(I_h : H^2 \rightarrow V_h^c\) be the nodal interpolation operator.
To bound the approximation term in Strang’s second lemma, we use the inclusion \(V_h^c \subset V_h^{nc}\):
To bound the consistency error, we perform integration by parts on every element:
Let \(E\) be an edge of the triangle \(T\). Define the mean value \(\overline{w_h}^E\). If \(E\) is an inner edge, then the mean value on the corresponding edge of the neighbor element is the same. The normal derivative \(\frac{\partial u}{\partial n}\) on the neighbor element is (up to the sign) the same. If \(E\) is an edge on the Dirichlet boundary, then the mean value is 0. This allows to subtract edge mean values:
Since \(\int_E w_h - \overline{w_h}^E \, ds = 0\), we may insert the constant function \(\frac{\partial I_h u}{\partial n}\) on each edge:
Apply Cauchy-Schwarz on \(L_2(E)\):
To estimate these terms, we transform to the reference element \(\widehat T\), where we apply the Bramble Hilbert lemma. Let \(T = \Phi_T(\widehat T)\), and set
There hold the scaling estimates
On the reference element, we apply the Bramble Hilbert lemma, once for \(w_h\), and once for \(u\). The linear operator
is bounded on \(H^1(\widehat T)\) (trace theorem), and \(L w = 0\) for \(w \in P_0\), thus
Similar for the term in \(u\): There is \(\| \nabla (u - I_h u) \|_{L_2(\widehat E)} \preceq \| u \|_{H^2(\widehat T)}\), and \(u - I_h u\) vanishes for \(u \in P^1\).
Rescaling to the element \(T\) leads to
This bounds the consistency term
Thus, the second lemma of Strang provides the error estimate
There are several applications where the non-conforming \(P^1\) triangle is of advantage:
The \(L_2\) matrix is diagonal (exercises)
It can be used for the approximation of problems in fluid dynamics described by the Navier Stokes equations (see later).
The finite element matrix has exactly 5 non-zero entries in each row associated with inner edges. That allows simplifications in the matrix implementation.
25.3. Solving Stokes’ equation with the non-conforming \(P^1\)-triangle#
The weak formulation of Stokes` equation is: Find the velocity vector-field \(u \in [H^1]^2\) and a pressure \(p \in L_2\) such that
The first equation is equilibrium of forces, \(-\Delta u = f - \nabla p\), the second one is the incompressibility constraint \(\operatorname{div} u = 0\).
We will discuss variational formulation with constraints later in the chapter Mixed finite element methods. A key property is the following
Lemma: There holds the commuting diagram property:
\[ \operatorname{div} I_T u = \Pi ^{P^0} \operatorname{div} u \]Here, \(I_T\) is the interpolation operator by mean-values on edges into the non-conforming \(P^1\) space, and \(\Pi ^{P^0}\) is the \(L_2\)-orthogonal projection onto constants.
Proof: Both sides are constant functions on each triangle \(T\). We apply Gauss` theorem to show that they are the same:
from ngsolve import *
from netgen.occ import *
from ngsolve.webgui import Draw
rect = Rectangle(10,1).Face()
rect.edges.name = "wall"
rect.edges.Min(X).name = "inlet"
rect.edges.Max(X).name = "outlet"
mesh = Mesh(OCCGeometry(rect, dim=2).GenerateMesh(maxh=0.2))
Draw (mesh);
Build a product spaces with components \(\vec u\) and \(p\). Express \(\operatorname{div} u = \operatorname{tr} \nabla u\):
# fesh1 = H1(mesh, order=2, dirichlet="wall|inlet")
fesh1 = FESpace("nonconforming", mesh, order=1, dirichlet="wall|inlet")
fesl2 = L2(mesh, order=0)
fes = VectorValued(fesh1) * fesl2
u,p = fes.TrialFunction()
v,q = fes.TestFunction()
a = BilinearForm(fes)
a += InnerProduct(grad(u),grad(v))*dx
a += Trace(grad(u))*q*dx + Trace(grad(v))*p*dx
a.Assemble()
gfu = GridFunction(fes)
gfu.components[0].Set((y*(1-y), 0), definedon=mesh.Boundaries("inlet"))
gfu.vec.data -= a.mat.Inverse(fes.FreeDofs())@a.mat * gfu.vec
Draw (gfu.components[0], mesh, vectors={"grid_size":80})
Draw (gfu.components[1]);