25. Non-conforming Finite Element Methods#

In a conforming finite element method, one chooses a sub-space VhV, and defines the finite element approximation as

Find uhVh:A(uh,vh)=f(vh)vhVh

For reasons of simpler implementation, or even of higher accuracy, the conforming framework is often violated. Examples are:

  • The finite element space Vh is not a sub-space of V=Hm. Examples are the non-conforming P1 triangle, and the Morley element for approximation of H2.

  • 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 VhV, but the bilinear-form and the linear-form are replaced by mesh-dependent forms

Ah(.,.):Vh×VhR

and

fh(.):VhR.

We do not assume that Ah and fh are defined on V. We assume that the bilinear-forms Ah are uniformly coercive, i.e., there exists an α1 independent of the mesh-size such that

Ah(vh,vh)α1vhV2vhVh

The finite element problem is defined as

Find uhVh:Ah(uh,vh)=fh(vh)vhVh

First Lemma of Strang: Assume that

  • A(.,.) is continuous on V

  • Ah(.,.) is uniformly coercive

Then there holds

uuhinfvhVh{uvh+supwhVh|A(vh,wh)Ah(vh,wh)|wh}+supwhVhf(wh)fh(wh)wh

Proof: Choose an arbitrary vhVh, and set wh:=uhvh. We use the uniform coercivity, and the definitions of u and uh:

α1uhvhV2Ah(uhvh,uhvh)=Ah(uhvh,wh)=A(uvh,wh)+[A(vh,wh)Ah(vh,wh)]+[Ah(uh,wh)A(u,wh)]=A(uvh,wh)+[A(vh,wh)Ah(vh,wh)]+[fh(wh)f(wh)]

Divide by uhvh=wh, and use the continuity of A(.,.):

uhvhuvh+|A(vh,wh)Ah(vh,wh)|wh+|f(wh)fh(wh)|wh

Using the triangle inequality, the error uuh is bounded by

uuhinfvhVhuvh+vhuhinfvhVh{uvh+|A(vh,wh)Ah(vh,wh)|wh+|f(wh)fh(wh)|wh}infvhVh{uvh+supwhVh|A(vh,wh)Ah(vh,wh)|wh+supwhVh|f(wh)fh(wh)|wh}

The lemma is proven.

Example: Lumping of the L2 bilinear-form: Define the H1 - bilinear-form

A(u,v)=Ωuv+Ωuvdx,

and perform Galerkin discretization with P1 triangles. The second term leads to a non-diagonal matrix. The vertex integration rule

Tvdx|T|3α=13v(xT,α)

is exact for vP1. We apply this integration rule for the term uvdx:

Ah(u,v)=uv+TT|T|3α=13u(xT,α)v(xT,α)

The bilinear form is now defined only for u,vVh, since point evaluation is not defined on H1 for d2. The integration is not exact, since uvP2 on each triangle.

Inserting the nodal basis φi, we obtain a diagonal matrix for the second term:

φi(xT,α)φj(xT,α)={1for xi=xj=xT,α0else

To apply the first lemma of Strang, we have to verify the uniform coercivity

T|T|3α=13|vh(xT,α)|2α1TT|vh|2dxvhVh,

which is done by transformation to the reference element. The consistency error can be estimated by (exercise!)

|Tuhvhdx|T|3α=13uh(xα)vh(xα)|hT2uhL2(T)vhL2(T)

Summation over the elements give

A(uh,vh)Ah(uh,vh)h2uhH1(Ω)vhH1(Ω)

The first lemma of Strang proves that this modification of the bilinear-form preserves the order of the discretization error:

uuhH1infvhVh{uvhH1+supwhVh|A(vh,wh)Ah(vh,wh)|whH1}uIhuH1+supwhVh|A(Ihu,wh)Ah(Ihu,wh)|whH1huH2+supwhVhh2IhuH1whH1whH1huH2

A diagonal L2 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 L2-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 VhV. Thus, the norm .V cannot be used on Vh, and it will be replaced by mesh-dependent norms .h. These norms must be defined for V+Vh. As well, the mesh-dependent forms Ah(.,.) and fh(.) are defined on V+Vh. We assume

  • uniform coercivity:

    Ah(vh,vh)α1vhh2vhVh
  • continuity:

    Ah(u,vh)α2uhvhhuV+Vh,vhVh

The error can now be measured only in the discrete norm uuhVh.

Second Lemma of Strang:

Under the above assumptions there holds

uuhhinfvhVhuvhh+supwhVh|Ah(u,wh)fh(wh)|whh

Remark: The first term in the estimate is the approximation error, the second one is called consistency error.

Proof: Let vhVh. Again, set wh=uhvh, and use the Vh-coercivity:

α1uhvhh2Ah(uhvh,uhvh)=Ah(uhvh,wh)=Ah(uvh,wh)+[fh(wh)Ah(u,wh)]

Again, divide by uhvh, and use continuity of Ah(.,.):

uhvhhuvhh+Ah(u,wh)fh(wh)whh

The rest follows from the triangle inequality as in the first Lemma of Strang.

The non-conforming P1 triangle

The non-conforming P1 triangle is also called the Crouzeix-Raviart element.

The finite element space generated by the non-conforming P1 element is

Vhnc:={vL2:v|TP1(T),and v is continuous in edge mid-points}

The functions in Vhnc are not continuous across edges, and thus, Vhnc is not a sub-space of H1. We have to extend the bilinear-form and the norm in the following way:

Ah(u,v)=TTTuvdxu,vV+Vhnc

and

vh2:=TTvL2(T)2vV+Vhnc

We consider the Dirichlet-problem with u=0 on ΓD. Thus, Vh 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 P1 finite element space Vhc is a sub-space of Vhnc. Let Ih:H2Vhc be the nodal interpolation operator.

To bound the approximation term in Strang’s second lemma, we use the inclusion VhcVhnc:

infvhVhncuvhhuIhuH1huH2

To bound the consistency error, we perform integration by parts on every element:

r(wh)=Ah(u,wh)f(wh)=TTuwhTTfwhdx=TTunwhdsTT(Δu+f)whds=TTunwhds

Let E be an edge of the triangle T. Define the mean value whE. If E is an inner edge, then the mean value on the corresponding edge of the neighbor element is the same. The normal derivative un 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:

r(wh)=TETEun(whwhE)ds

Since EwhwhEds=0, we may insert the constant function Ihun on each edge:

r(wh)=TETE(unIhun)(whwhE)ds

Apply Cauchy-Schwarz on L2(E):

r(wh)=TET(uIhu)L2(E)whwhEL2(E)

To estimate these terms, we transform to the reference element T^, where we apply the Bramble Hilbert lemma. Let T=ΦT(T^), and set

u^=uΦTw^h=whΦT

There hold the scaling estimates

|wh|H1(T)|w^h|H1(T^)whwhEL2(E)hE1/2w^hw^hE^L2(E^)|u|H2(T)hT1|u^|H2(T^)(uIhu)L2(E)hE1/2(u^I^hu^)L2(E)

On the reference element, we apply the Bramble Hilbert lemma, once for wh, and once for u. The linear operator

L:H1(T^)L2(E^):w^hw^hw^hE^

is bounded on H1(T^) (trace theorem), and Lw=0 for wP0, thus

w^hw^hE^L2(E^)|w^h|H1(T^)

Similar for the term in u: There is (uIhu)L2(E^)uH2(T^), and uIhu vanishes for uP1.

Rescaling to the element T leads to

whwhEL2(E)h1/2|wh|H1(T)(uIhu)L2(E)h1/2|u|H2(T)

This bounds the consistency term

r(wh)Th|u|H2(T)|wh|H1(T)huH2(Ω)whh.

Thus, the second lemma of Strang provides the error estimate

uuhhuH2

There are several applications where the non-conforming P1 triangle is of advantage:

  • The L2 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 P1-triangle#

The weak formulation of Stokes` equation is: Find the velocity vector-field u[H1]2 and a pressure pL2 such that

(u,v)+(divv,p)=(f,v)v[H1]2(divu,q)=0qL2

The first equation is equilibrium of forces, Δu=fp, the second one is the incompressibility constraint divu=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:

divITu=ΠP0divu

Here, IT is the interpolation operator by mean-values on edges into the non-conforming P1 space, and ΠP0 is the L2-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:

TdivITu=T(ITu)n=ETE(ITu)n=ETEun=Tun=Tdivu=TΠP0divu
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 u and p. Express divu=tru:

# 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]);