0% found this document useful (0 votes)
141 views110 pages

Lapois PDF

This document introduces the Poisson equation and its variational formulation for solving partial differential equations (PDEs) using the Finite Element Method (FEM). It defines the Poisson equation, which models diffusion and other physical phenomena. It then formulates the equation as a variational problem to find the solution in a Sobolev space using integration by parts. This variational formulation forms the basis for solving the PDE using FEM.

Uploaded by

yhjfhw
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
141 views110 pages

Lapois PDF

This document introduces the Poisson equation and its variational formulation for solving partial differential equations (PDEs) using the Finite Element Method (FEM). It defines the Poisson equation, which models diffusion and other physical phenomena. It then formulates the equation as a variational problem to find the solution in a Sobolev space using integration by parts. This variational formulation forms the basis for solving the PDE using FEM.

Uploaded by

yhjfhw
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 110

Solving PDE’s with FEniCS

Laplace and Poisson

L. Ridgway Scott
The Institute for Biophysical Dynamics,
The Computation Institute, and the
Departments of Computer Science and Mathematics,
The University of Chicago

Brown Feb 2017 1/110


Laplace equation

Define a function u in a domain Ω ⊂ Rd by

−∆u = f in Ω (1)

together with boundary conditions


u = 0 on Γ ⊂ ∂Ω (Dirichlet)
∂u (2)
= 0 on ∂Ω\Γ (Neumann)
∂n
∂u
where ∂n denotes the derivative of u in the direction
∂u
normal to the boundary, ∂Ω ( ∂n = n · ∇u.)
This is known variously as Poisson’s equation
or Laplace’s equation (especially when f ≡ 0).
Brown Feb 2017 2/110
Laplace applications

This equation forms the basis of a remarkable number


of physical models.

It serves as a basic equation for diffusion, elasticity,


electrostatics, gravitation, and many more domains.

In potential flow, the gradient of u is the velocity of


incompressible, inviscid, irrotational fluid flow.

• The boundary ∂Ω is the surface of an obstacle


moving in the flow, and one solves the equation on
the exterior of Ω.

Brown Feb 2017 3/110


Solution space

We will see that the right place to look for such the
solution of such an equation is a Sobolev space
denoted H 1 (Ω) defined by
1
 2 2 d

H (Ω) = v ∈ L (Ω) : ∇v ∈ L (Ω) , (3)

where by L2 (Ω) we mean functions which are square


integrable on Ω:
Z 1/2
kvkL2 (Ω) = v(x)2 dx < ∞,

and L2 (Ω)d means d copies of L2 (Ω) (Cartesian


product).

Brown Feb 2017 4/110


Functions spaces

There is a natural inner-product on L2 (Ω) defined by


Z
(v, w)L2 (Ω) = v(x) w(x) dx, (4)

For a vector-valued function w, e.g., w = ∇v, we define


Z 1/2
kwkL2 (Ω) = k|w|kL2 (Ω) = |w(x)|2 dx ,

where |ξ| denotes the Euclidean norm of the vector


ξ ∈ Rd , and
Z
(v, w)L2 (Ω) = v(x) · w(x) dx.

Brown Feb 2017 5/110


Domain for Poisson’s Equation

(a) (b)

Figure 1: (a) Domain Ω with Γ indicated in red. (b) Triangulation of Ω.

Now consider equation (1) with boundary conditions (2).


Assume Γ has nonzero measure (length or area, or
even volume, depending on dimension).
Later, we will return to the case when Γ is empty, the
pure Neumann case.
Typical Ω shown in Figure 1, with Γ shown in red.
Brown Feb 2017 6/110
Boundary condtions for Poisson’s Equation

To formulate the variational equivalent of (1) with


boundary conditions (2), we define a variational space
that incorporates the essential, i.e., Dirichlet, part of the
boundary conditions in (2):
 1

V := v ∈ H (Ω) : v|Γ = 0 . (5)
See Table 1 for an explanation of the various names
used to describe different boundary conditions.

generic name example honorific name


essential u=0 Dirichlet
∂u
natural ∂n
=0 Neumann
Table 1: Nomenclature for different types of boundary conditions.

Brown Feb 2017 7/110


Variational Formulation of Poisson’s Equation

The appropriate bilinear form for the variational problem


is determined by multiplying Poisson’s equation by a
suitably smooth function, integrating over Ω and then
integrating by parts:
Z
(f, v)L2 (Ω) = (−∆u)v dx
ZΩ I
∂u
= ∇u · ∇v dx − v ds (6)
Z Ω ∂Ω ∂n
= ∇u · ∇v dx := a(u, v).

The boundary term in (6) vanishes for v ∈ V because


∂u
either v or ∂n is zero on any part of the boundary.
Brown Feb 2017 8/110
Integration by parts

The integration-by-parts formula derives from the


divergence theorem
Z I
∇· w(x) dx = w(s) · n(s) ds (7)
Ω ∂Ω
∂u
applied to w = v∇u, together with ∂n = (∇u) · n and
∆u = ∇· (∇u) (n is the outward-directed normal to ∂Ω).
More precisely, we observe that
d
X d
X

∇· (v∇u) = (v∇u)i ,i
= (v u,i ),i
i=1 i=1
Xd
= v,i u,i + v u,ii = ∇v · ∇u + v∆u.
Brown Feb 2017
i=1 9/110
Integration by parts

Thus the divergence theorem applied to w = v∇u gives


I Z

v∇u(s) · n(s) ds = ∇· (v∇u) (x) dx
∂Ω ZΩ
= (∇v · ∇u + v∆u)(x) dx,

which means that


Z Z
−v(x)∆u(x) dx = ∇v(x) · ∇u(x) dx
Ω Ω I
∂u
− v ds (8)
∂Ω I∂n
∂u
= a(u, v) − v ds.
∂Ω ∂n
Brown Feb 2017 10/110
The variational problem

Thus, u can be characterized via

u ∈ V satisfying a(u, v) = (f, v)L2 (Ω) ∀v ∈ V. (9)

The companion result, namely


a solution to the variational problem
in (9) solves Poisson’s equation
can also be proved [2], under suitable regularity
conditions on u.
These regularity conditions guarantee the relevant
expressions in (1) and (2) are well defined.
We will show how this is done in detail in the
one-dimensional case.
Brown Feb 2017 11/110
Linear functionals as data

A function F defined on V is called a linear functional if


it is a linear function defined for any v ∈ V having
a real number as its value.
The right-hand side of (9) can be written using

F (v) = (f, v)L2 (Ω) ∀v ∈ V. (10)

The expression F is called a linear functional because


(a) it is linear and (b) it has scalar values.
By linear, we mean that

F (u + av) = F (u) + aF (v)


for any scalar a and any u, v ∈ V .
Brown Feb 2017 12/110
Continuous linear functionals

Critical condition on a linear functional for success in a


variational formulation: bounded (a.k.a. continuous).
A linear functional F is bounded (equivalently
continuous) on a normed space V if

|F (v)| ≤ CF kvkV ∀v ∈ V. (11)

A natural norm k·kV for the space V defined in (5) is


p
kvka = a(v, v).

The smallest possible constant CF for which


(11) holds is called the dual norm of F .

Brown Feb 2017 13/110


Dual norm

The dual norm of F is defined by


|F (v)|
kF kV ′ := sup . (12)
06=v∈V kvkV

The linear form (10)

F (v) = (f, v)L2 (Ω) ∀v ∈ V

is bounded on H 1 (Ω): L2 norm is part of H 1 norm.


But other linear forms are not, such as F (v) := v ′ (x0 ) for
some x0 ∈ [0, 1]. This form is linear, but consider what it
should do for the function v(x) := |x − x0 |2/3 . Note that
v ∈ H 1 ([0, 1]).
Brown Feb 2017 14/110
A small detail

Our definition of the variational space V ensures that


a(v, v) < ∞ for all v ∈ V .
But our variational formulation involves a(u, v) for
u, v ∈ V .

Why is a(u, v) well defined for all u, v ∈ V ?

The Cauchy-Schwarz inequality guarantees that

|a(u, v)| ≤ kuka kvka ,


p
where kvka = a(v, v) for all v ∈ V .

The proof is a simple calculation.


Brown Feb 2017 15/110
Cauchy-Schwarz inequality proof

a(u − tv, u − tv) = a(u, u) − 2ta(v, u) + t2 a(v, v)


(13)
= a(u, u) − 2ta(u, v) + t2 a(v, v).
In particular, since a(u − tv, u − tv) ≥ 0,

2ta(u, v) ≤ a(u, u) + t2 a(v, v). (14)

For example, suppose that a(v, v) = 0.


Choose the sign of t to be the sign of a(u, v). From (14)
we conclude that

2|t| |a(u, v)| ≤ a(u, u). (15)


Since 2|t| |a(u, v)| ≤ a(u, u) holds for all t ∈ R, we can let
|t| → ∞ to conclude that a(u, v) = 0.
Brown Feb 2017 16/110
Cauchy-Schwarz inequality

If a(v, v) 6= 0, define t = sign(a(u, v))kuka /kvka .

If by chance a(u, u) = 0, then we reverse the previous


argument to conclude that again a(u, v) = 0.

If not zero, and thus t 6= 0, divide by |t| in (14) to get


1
2|a(u, v)| ≤ a(u, u) + |t| a(v, v) = 2kuka kvka . (16)
|t|
Thus we have proved the Cauchy-Schwarz inequality

|a(u, v)| ≤ kuka kvka . (17)


The Cauchy-Schwarz inequality is generally true for any
non-negative, symmetric bilinear form.
Brown Feb 2017 17/110
Inner products

Cauchy-Schwarz often stated for an inner-product.


Our bilinear form a(·, ·) is almost an inner-product
except that it lacks one condition, non-degeneracy.
In our case a(v, v) = 0 if v is constant, and for an
inner-product, this is not allowed.
One example of an inner-product is the bilinear form
Z
(u, v)L2 (Ω) = u(x) v(x) dx. (18)

Here we see that (v, v)L2 (Ω) = 0 implies that v ≡ 0.


But the Cauchy-Schwarz inequality does not
require this additional property to be valid.
Brown Feb 2017 18/110
Formulation of the Pure Neumann Problem

The case of pure Neumann (or natural) boundary


conditions
∂u
= 0 on ∂Ω (19)
∂n
(i.e., when Γ = Ø) is a bit different.

In particular, solutions are unique only up to an additive


constant, and they can exist only if the right-hand side f
in (1) satisfies
Z Z
f (x) dx = −∆u(x) dx
Ω ZΩ I (20)
∂u
= ∇u(x) · ∇1 dx − ds = 0.
Ω ∂Ω ∂n

Brown Feb 2017 19/110


Mean-zero spaces

A variational space appropriate for the present case is


 Z 
V = v ∈ H 1 (Ω) : v(x) dx = 0 . (21)

For any integrable function g, we define its mean, ḡ, as


follows: Z
1
ḡ := g(x) dx. (22)
meas(Ω) Ω
For any v ∈ H 1 (Ω), note that v − v̄ ∈ V .

Then u − ū satisfies the variational formulation (9) with


V defined as in (21).

Brown Feb 2017 20/110


Mean-zero spaces

Conversely, if u ∈ H 2 (Ω) solves the variational equation


(9) with V defined as in (21), then u solves Poisson’s
equation (1) with a right-hand-side given by

f˜(x) := f (x) − f¯ ∀x ∈ Ω (23)

with boundary conditions (19).

The variational form a(·, ·) coercive on the spaces V [2]:


there is a constant C depending only on Ω and Γ such
that
kvk2H 1 (Ω) ≤ Ca(v, v) ∀v ∈ V. (24)

Brown Feb 2017 21/110


Coercivity of the Variational Problem

We show later how to prove such a result in the


one-dimensional case.

From (24), it follows that the problem (9) is well posed.

In particular, we easily see that the solution to the


problem must be unique.

For if f is identically zero then so is the solution:


1
0 = (f, u)L2 = a(u, u) ≥ kuk2H 1 (Ω) .
C

Brown Feb 2017 22/110


Coercivity implications

In the finite-dimensional case, this uniqueness also


implies existence, and a similar result (Lax-Milgram
Theorem) holds in the setting of infinite dimensional
Hilbert spaces such as V .

Moreover, the coercivity condition immediately implies a


stability result, namely
Ca(u, u) (f, u)L2
kukH 1 (Ω) ≤ =C ≤ Ckf kV ′ , (25)
kukH 1 (Ω) kukH 1 (Ω)
where the dual norm kf kH 1 (Ω)′ is defined in (12).

Brown Feb 2017 23/110


Continuity condition

When coercivity holds, the Lax-Milgram theorem


guarantees variational problem (9) has unique solution.

There is an additional continuity condition that usually


is straight-forward, namely that the form a(·, ·) is
bounded on V , that is,

|a(u, v)| ≤ CkukH 1 (Ω) kvkH 1 (Ω) for all u, v ∈ V. (26)

In most cases, this condition is evident, but not in all as


we describe later.

Brown Feb 2017 24/110


Proving continuity

Often easy to see that

a(v, v) ≤ Ckvk2H 1 (Ω)

for all v ∈ V .

Connection between this condition and (26) given by the


Cauchy-Schwarz inequality (17).

The continuity bound in (25) holds for discrete


approximations as well under a very simple condition:
Vh ⊂ V .

Brown Feb 2017 25/110


Lax-Milgram theorem

Lax-Milgram Theorem Suppose that the variational


form a(·, ·) is coercive (24) and continuous (26)
(bounded) on H 1 (Ω). Then the variational problem (9)
has a unique solution u for every continuous (bounded)
F defined on H 1 (Ω). Moreover,
|F (v)|
kukH 1 (Ω) ≤ c1 c0 sup , (27)
v∈H 1 (Ω) kvkH 1 (Ω)

where c0 is the constant in (24) and c1 is the constant in


(26).
The combination of continuity and coercivity correspond
to the stability of the numerical scheme.
Brown Feb 2017 26/110
Variational Approximation of Poisson’s Equation

(a) (b)

Let Th denote a subdivision of Ω; typically this will be


what is called a triangulation, made of triangles in two
dimensions or tetrahedra in three dimensions.
Triangulation of the domain in (a) is shown in (b).
The main requirement for a triangulation is that no
vertex of a triangle can be in the middle of an edge.
However, more general subdivisions can be used that
violate this property [1, 8, 9].
Brown Feb 2017 27/110
Using elements

(a) (b)

Figure 2: (a) Domain Ω with Γ indicated in red. (b) Nodal positions for Vh
are indicated by the black dots; note that vertices in Γ are not included, to
respect the essential (Dirichlet) boundary condition.

Main concept of finite element method: use each


element of the subdivision as a separate domain in
which to reason about the balance of forces.

Mathematically, corresponds to choosing functions on


each element to represent variables used in the model.
Brown Feb 2017 28/110
Using the coercivity condition

Often, same functions used on each element, but not


necessary [8, 9, 5].
In this way, one constructs a finite dimensional space Vh
which can be used in what is known as the Galerkin
method to approximate the variational formulation (9),
as follows:

find uh ∈ Vh satisfying a(uh , v) = (f, v) ∀v ∈ Vh . (28)

Here we can think of h as designating the subdivision,


or perhaps as a parameter that denotes the size of the
elements of the subdivision.

Brown Feb 2017 29/110


Using the coercivity condition

The coercivity condition implies stability for the discrete


approximation, namely
Ca(uh , uh ) (f, uh )
kuh kH 1 (Ω) ≤ =C ≤ Ckf kV ′ , (29)
kuh kH 1 (Ω) kuh kH 1 (Ω)
where we will explain the meaning of kf kV ′ later.

In particular, if f ≡ 0, then uh ≡ 0.

Provided Vh is finite dimensional, this implies that (28)


always has a unique solution.
We can see this more clearly by choosing P a basis
{φi ∈ Vh : i = 1, . . . , Nh }. Write uh = i Ui φi .
Brown Feb 2017 30/110
Some linear algebra

Figure 3: Typical basis function for continuous piecewise linear functions.

Using the linearity of the form a(·, ·) in each of its


variables, we obtain theZ linear system AU = F where
Aij = a(φi , φj ), Fi = f (x) φi (x) dx ∀i, j = 1, . . . , Nh .

Brown Feb 2017 31/110
More linear algebra

Since A is symmetric (Aji = a(φj , φi ) = a(φi , φj ) = Aij ),


we have, for all j = 1, . . . , Nh ,
Z
P 
Fj = f (x) φj (x) dx = a(uh , φj ) = a Ui φi , φj
X Ω
X X i
= Ui a(φi , φj ) = Ui Aij = Aji Ui = AU )j
i i i

From linear algebra, solution to linear system AU = F


exists uniquely ⇐⇒ only solution for F = 0 is U = 0.

The latter is guaranteed by the coercivity condition (25):

kuh k2H 1 (Ω) ≤ Ca(uh , uh ) = C(f, uh ) = 0.

Brown Feb 2017 32/110


Piecewise linears

Given a triangulation, the simplest space Vh that we can


construct is the set of continuous piecewise linear
functions.
On each triangle (or tetrahedron), such functions are
linear, and moreover we contrive to make them
continuous.
A linear function is determined by its values at the
vertices of a simplex.
Easy to see in one or two dimensions; graph of function
is line or plane through specified values at vertices.
If values of v ∈ Vh at vertices agree in all of the triangles
meeting there, then resulting function is continuous.
Brown Feb 2017 33/110
Kronecker basis

In two dimensions, the values along edges are specified


completely by the values at the vertices.
A basis for Vh satisfies φi (xj ) = δij (Kronecker δ) as
depicted in Figure 3.
The vertices of a triangulation provide the nodes of the
space Vh ; these are shown as black dots in Figure 2.
Only vertices where nodal values are non-zero have
black dots, where the boundary condition v = 0 holds on
Γ for v ∈ Vh ⊂ V .

Brown Feb 2017 34/110


General approximation

What determines the accuracy of the approximation?

Céa’s Theorem [2, 2.8.1] says the following.

Theorem 0.1 Suppose that Vh ⊂ V , that the variational


form a(·, ·) is bounded and coercive on V , and that F is
bounded on V . Then

ku − uh ka ≤ C inf ku − vka . (30)


v∈Vh

Thus the accuracy of the finite element method is


determined by the accuracy of approximation.
Often called quasi-optimal.

Brown Feb 2017 35/110


Nodal values for quadratics

Figure 4: Nodes for quadratics: vertices and edge midpoints.

For more accurate, cost effective approximation, often


useful to use higher-order polynomials in each element.
In Figure 4 we see the nodes for piecewise quadratic
functions (compare Figure 1).
Brown Feb 2017 36/110
Piecewise quadratic approximation

Again, we can define a basis for the space Vh of


continuous piecewise quadratics in terms of functions
that satisfy
φi (xj ) = δij (Kronecker δ),
where the xj ’s are the nodes in Figure 4.
But now it is not so clear how we can be sure that this is
a valid representation.
What we need to know is that this nodal representation
is unisolvent on each triangle, meaning that
on each triangle you can solve uniquely for a
quadratic given the values at the specified nodes,
the vertices and edge midpoints.
Brown Feb 2017 37/110
Proof of unisolvence: degree reduction

On each edge, we have three distinct points that


determine uniquely a quadratic, simply by invoking the
fundamental theorem of algebra.

If all nodal values on one edge vanish, then the


quadratic q(x, y) must vanish on that edge.

WLOG suppose that edge lies on the x-axis. Then


q(x, y) = yℓ(x, y) where ℓ is a linear polynomial in x, y.

Can be verified by expanding q in powers of x and y


(there are 6 terms) and invoking q(x, y) ≡ 0
on the edge lying on the x-axis.

Brown Feb 2017 38/110


Proof of unisolvence continued

q also vanishes on the other two edges of the triangle,


neither of which can lie on the x-axis, so that means that
ℓ must also vanish on these edges.

But this clearly implies that ℓ ≡ 0, and thus q ≡ 0.

By linear algebra, uniqueness of the representation


implies existence of a representation:

We have exactly 6 nodal variables


matching the dimension of space of
quadratic polynomials in two dimensions.
Complete details are found in [2, Chapter 3].

Brown Feb 2017 39/110


Arbitrary degree polynomials

No limit on the degree of polynomials that can be used.

General family of elements called Lagrange elements.


Regular pattern of nodes shown in Figure 5.

(a) (b) (c)

Figure 5: Varying mesh number M and polynomial degree k with the same
number of nodes: (a) M = 4, k = 1 (linears), (b) M = 2, k = 2 (quadratics),
(c) M = 1, k = 4 (quartics).

Brown Feb 2017 40/110


Method of manufactured solutions

Using the method of manufactured solutions, consider


−∆u = 2π 2 sin(πx) sin(πy) in Ω = [0, 1] × [0, 1]
(31)
u = 0 on ∂Ω,
whose solution is u(x, y) = sin(πx) sin(πy). Of course,
we started with the solution u and then computed its
Laplacian to get f = 2π 2 sin(πx) sin(πy).
The errors

kuh − ukL2 (Ω) = kuh − (2π 2 )−1 f kL2 (Ω) (32)


for different meshes (of the type shown in Figure 5) and
polynomial degrees, together with execution times, are
given in Table 2.
Brown Feb 2017 41/110
Computational experiments with (31).

degree mesh number L2 error time (s)


1 32 2.11e-03 0.09
2 8 5.65e-04 0.08
1 128 1.32e-04 0.31
2 16 6.93e-05 0.08
1 256 3.31e-05 1.07
2 64 1.08e-06 0.23
4 8 7.78e-07 0.08
8 2 7.29e-08 0.08
4 16 2.44e-08 0.11
16 1 1.61e-09 0.09
4 32 7.64e-10 0.23
8 4 1.42e-10 0.09
4 64 2.39e-11 0.74
4 128 4.95e-12 3.0
8 8 3.98e-12 0.13
8 16 1.67e-11 0.33
Table 2: Computational experiments with solving the problem (31).
Brown Feb 2017 42/110
Arbitrary degree polynomials

What we see in Table 2 is that the error can be reduced


substantially by using higher-order polynomials.

Increasing the mesh number for linear Lagrange


elements does reduce the error, but the execution time
grows commensurately with the error reduction.

Using linears on a mesh of size 256 gives half the error


of quadratics on a mesh of size 16, but the latter
computation requires one-tenth of the time.
For the same amount of time as this computation with
quadratics, using quartics on a mesh of size 8 gives an
error almost two orders of magnitude smaller.

Brown Feb 2017 43/110


Arbitrary degree polynomials

Each mesh with double the number of mesh points was


derived from the one with the smaller number of points
by subdiving each triangle into four similar triangles.

To get the highest accuracy, the best strategy is to use


higher polynomial order, up to a point.

The most accurate computation occurs with polynomial


degree 8 with a mesh number of 8.

But the error quits decreasing at a certain point due to


round-off error.

Will discuss the effects of finite precision arithmetic is


more detail later.
Brown Feb 2017 44/110
Arbitrary degree polynomials

The times presented here should be viewed as


approximate.

There is significant variation due to system load from


run to run.

These computations were done on a MacBook Pro with


2.3 GHz Intel Core i7 and 16 GB 1600 MHz DDR3
memory.
However, we do see order of magnitude variation
depending on the mesh size and polynomial degree.

Brown Feb 2017 45/110


Nodal basis means good approximation

It is easy to understand the basic error behavior for the


finite element method.

In the case of both piecewise linear and piecewise


quadratics, we described the nodal basis functions φi
which satisfy φi (xj ) = δij (Kronecker δ), where xj
denotes a typical node.

For linears, the nodes are the vertices, and for


quadratics the edge midpoints are added.
For higher degree Lagrange elements, more edge
nodes are involved, as well as interior nodes.

Brown Feb 2017 46/110


Interpolant

For example, with cubics, the centroid of each triangle is


a node.

Nodal representation is basis for defining an interpolant.

Using such a nodal representation, we can define what


is known as a global interpolant Ih defined on
continuous functions, by
X
Ih u = u(xi )φi . (33)
i

Thus Ih maps continuous functions into the space Vh


used in finite element computations.
Brown Feb 2017 47/110
Interpolant approximation

Let Ih denote a global interpolant for a family of finite


elements based on the components of T h .

Suppose that Ih u is continuous, as is true for the


Lagrange family of elements.

Further, suppose that the corresponding shape


functions have an approximation order, m, that is

ku − Ih ukH 1 (Ω) ≤ Chm−1 |u|H m (Ω) . (34)

In order to have good approximation, we need to have


k

Ih V ∩ C (Ω) ⊂ Vh , (35)
where k = 0 for Lagrange elements.
Brown Feb 2017 48/110
Mesh constraint

However, we allow for the possibility that k > 0 since this


holds for other element families.
k

Condition Ih V ∩ C (Ω) ⊂ Vh , is a mesh constraint.

If Vh ⊂ V and the form a(·, ·) is bounded and coercive,


then the unique solution, uh ∈ Vh , to the variational
problem
a(uh , v) = (f, v) ∀v ∈ Vh
satisfies

ku − uh kH 1 (Ω) ≤ C inf ku − vkH 1 (Ω) . (36)


v∈Vh

by Céa’s theorem.
Brown Feb 2017 49/110
Initial error estimates

If conditions (34) and (35) hold, then

ku − uh kH 1 (Ω) ≤ Chm−1 |u|H m (Ω) .

The requirements Vh ⊂ V and (35) place a constraint on


the subdivision in the case that Γ is neither empty nor all
of the boundary.

These requirements provide the consistency of the


numerical approximation.
Necessary to choose the mesh so that it aligns properly
with the points where the boundary conditions change
from Dirichlet to Neumann.

Brown Feb 2017 50/110


Matching Boundary Conditions

If the points where the boundary conditions change are


vertices in the triangulation, then
0

Vh := Ih V ∩ C (Ω)

is same as space of piecewise polynomials that vanish


on edges contained in Γ.

Since we have chosen the mesh so that the edges


contained in Γ form a subdivision of the latter, it follows
that Vh ⊂ V holds.
On the other hand, if the set of edges where functions in
Vh vanish is too small, then Vh 6⊂ V .

Brown Feb 2017 51/110


Matching Boundary Conditions

If the set of edges where functions in Vh vanish is too


big, (35) fails to hold.

In the case of pure Dirichlet data, i.e., Γ = ∂Ω, then Vh is


just the set of piecewise polynomials that vanish on the
entire boundary.

In the case of pure Neumann data, i.e., Γ = Ø, Vh is the


entire set of piecewise polynomials with no constraints
at the boundary.
Even if finite element space matches Γ correctly, there is
a singularity associated with changing boundary
condition type along a straight boundary, as we detail
subsequently.
Brown Feb 2017 52/110
Inhomogeneous Boundary Conditions

When boundary conditions are equal to zero, we often


call them homogeneous, whereas we refer to nonzero
boundary conditions as inhomogeneous.

Inhomogeneous boundary conditions are easily treated.

For example, suppose that we wish to solve (1) with


boundary conditions
∂u
u = gD on Γ ⊂ ∂Ω and = gN on ∂Ω\Γ, (37)
∂n
where gD and gN are given.
For simplicity, let us assume that gD is defined on all of
Ω, with gD ∈ H 1 (Ω) and that gN ∈ L2 (∂Ω\Γ).
Brown Feb 2017 53/110
Well-posedness of inhomogeneous formulation

 1

Recall the space (5): V = v ∈ H (Ω) : v|Γ = 0 .

Then the variational formulation of (1) , (37) is as


follows: find u such that u − gD ∈ V and such that
I
a(u, v) = (f, v)L2 (Ω) + gN v ds ∀v ∈ V. (38)
∂Ω\Γ

This is well-posed since the linear form


I
F (v) := (f, v)L2 (Ω) + gN v ds
∂Ω\Γ

is well defined (and continuous) for all v ∈ V .

Brown Feb 2017 54/110


Equivalence of formulations

Equivalence of these formulations follows from (8): for any v ∈ V ,


Z Z I
∂u
(−∆u)v dx = ∇u · ∇v dx − v ds
Ω Ω ∂Ω ∂n
I (39)
∂u
= a(u, v) − v ds.
∂Ω\Γ ∂n

Thus, if u solves (1) with boundary conditions (37), then (38) follows
as a consequence.

Conversely, if u solves (38) then choosing v to vanish near ∂Ω


shows that (1) holds, and thus
I I
∂u
gN v ds − v ds = 0 ∀v ∈ V.
∂Ω\Γ ∂Ω\Γ ∂n

Choosing v to be arbitrary proves (37) follows.

Brown Feb 2017 55/110


Inhomogeneous BCs: finite element formulation

Finite element approximation of (38) involves, typically, use of an


interpolant, Ih gD , of the Dirichlet data.
We pick a subspace Vh of V just as before, and we seek uh such
that uh − Ih gD ∈ Vh and such that
I
a(uh , v) = (f, v)L2 (Ω) + gN v ds ∀v ∈ Vh . (40)
∂Ω\Γ

We can cast this in a more standard form as: find


ûh = uh − Ih gD ∈ Vh such that
I
a(ûh , v) = (f, v)L2 (Ω) + gN v ds + a(Ih gD , v) ∀v ∈ Vh . (41)
∂Ω\Γ

Then we can set uh = ûh + Ih gD .


Fortunately, the dolfin built-in function solve automates all of
this, so that the data gD just needs to be specified.
Brown Feb 2017 56/110
Robin boundary conditions

It is frequently the case that more complex boundary


conditions arise in physical models.

The so-called Robin boundary conditions take the form


∂u
αu + = 0 on ∂Ω\Γ, (42)
∂n
where α is a positive measurable function.

This will be coupled as before with a Dirichlet condition


on Γ.

A variational formulation for this problem can be derived


as follows.
Brown Feb 2017 57/110
Robin variational problem

Let V be the space defined in (5) with the added proviso


that V = H 1 (Ω) in the case that Γ = Ø.

From (8), we get


Z
(f, v)L2 (Ω) = (−∆u(x))v(x) dx
ZΩ I
∂u
= ∇u(x) · ∇v(x) dx − v(s) (s) ds
Z Ω I ∂Ω ∂n
= ∇u(x) · ∇v(x) dx + α(s) v(s) u(s) ds,
Ω ∂Ω
∂u
after substituting the boundary condition ∂n = −αu on
∂Ω\Γ and using the condition (5) that v = 0 on Γ.
Brown Feb 2017 58/110
Robin variational form

Thus we define a new variational form


Z
aRobin (u, v) : = ∇u(x) · ∇v(x) dx
IΩ (43)
+ α(s) v(s) u(s) ds.
∂Ω

Variational formulation for the equation (1) together with


the Robin boundary condition (42) takes the usual form

u ∈ V satisfies aRobin (u, v) = (f, v)L2 (Ω) ∀v ∈ V. (44)

A solution to the variational problem (44) solves both


(1) and (42) under suitable smoothness conditions.

Brown Feb 2017 59/110


Robin variational form coercivity

Note that aRobin (·, ·) is coercive on H 1 (Ω), that is there is


a constant C < ∞ such that

kvk2H 1 (Ω) ≤ CaRobin (v, v) ∀v ∈ H 1 (Ω). (45)

This holds even if Γ = ∅.

Coercivity follows because α > 0:


I
aRobin (v, v) = a(v, v) + α(s) v(s)2 ds.
∂Ω

(Proof is a Sobolev space exercise.)

If α were negative, it might not be coercive.

Brown Feb 2017 60/110


Geometry matters

The geometry of the domain boundary has a significant


impact on the regularity of the solution.

We begin by considering the problem


−∆u = 0 in Ω
(46)
u = g on ∂Ω,

where Ω is a polygonal domain in R2 .

We will see that the principal singularity of


the solution can be identified, associated with
what are often called re-entrant vertices.

Brown Feb 2017 61/110


L-shaped domain

B B

A A
C C κ

(a) D (b) D
Figure 6: (a) L-shaped domain, (b) re-entrant corner of angle κ.

The L-shaped domain Ω is depicted in Figure 6(a):


 2 3

Ω = (x, y) ∈ [−1, 1] : (x, y) = (r cos θ, r sin θ), 0 ≤ r ≤ 1, 0 < θ < 2 π

defined using polar coordinates (x, y) = r(cos θ, sin θ).


Brown Feb 2017 62/110
Re-entrant corners

Again using polar coordinates, define

g(r(cos θ, sin θ)) = r2/3 sin( 32 θ). (47)

∂Ω has two parts: the convex part Γc = A ∪ B ∪ C ∪ D where

A = {(1, y) : 0 ≤ y ≤ 1} , B = {(x, 1) : −1 ≤ x ≤ 1} ,
(48)
C = {(−1, y) : −1 ≤ y ≤ 1} , D = {(x, −1) : 0 ≤ x ≤ 1} ,

(see Figure 6) and the re-entrant part

Γr = {(0, y) : −1 ≤ y ≤ 0} ∪ {(x, 0) : 0 ≤ x ≤ 1} . (49)

Then our data g = 0 on Γr . Moreover, g is harmonic, meaning


∆g = 0.
This follows immediately from complex analysis, since g is
the imaginary part of the complex analytic function e(2/3)z .
Brown Feb 2017 63/110
Partial derivation

Deriving such a result is not easy using calculus.


First of all, using polar coordinates (x, y) = r(cos θ, sin θ), we find
(x, y) (−y, x)
∇r = and ∇θ = 2
.
This means that
r r
2 −1/3 2 2/3 2

∇g(x, y) = 3 (∇r)r sin( 3 θ) + (∇θ)r cos( 3 θ)
2 −4/3 2 2

= 3r (x, y) sin( 3 θ) + (−y, x) cos( 3 θ)
2 −4/3
 (50)
= 3
r x sin( 23 θ) − y cos( 32 θ), y sin( 32 θ) + x cos( 23 θ)
2 −1/3 1 1

= 3
r − sin( 3 θ), cos( 3 θ) ,

where trigonometric identities flow from the expressions (ι = −1)

cos( 31 θ) − ι sin( 13 θ) = cos(− 13 θ) + ι sin(− 13 θ) = e−ι(1/3)θ = e−ιθ eι(2/3)θ


 2 2

= cos θ − ι sin θ cos( 3 θ) + ι sin( 3 θ)
2 2
 2 2

= cos θ cos( 3 θ) + sin θ sin( 3 θ) + ι − sin θ cos( 3 θ) + cos θ sin( 3 θ) .

Brown Feb 2017 64/110


Gradient unbounded

The immediate result of the calculation (50) is that, for


0 < θ < 23 π,
|∇g(x, y)| blows up like |(x, y)|−1/3 , since

|∇g(x, y)| = |∇g(r cos θ, r sin θ)| = 32 r−1/3 = 32 |(x, y)|−1/3 .

Therefore |∇g(x, y)| is square integrable, but it is


obviously not bounded.

Benefit of working with Sobolev spaces:

allows g to be considered a reasonable function


even though it has an infinite gradient.

Brown Feb 2017 65/110


Gradient unbounded

We can in principle use the vector calculus identity

∇· (φψ) = ∇φ · ψ + φ∇· ψ

to compute
∆g = ∇· (∇g)
to verify that ∆g = 0, but the algebra is daunting.

Exercise: compute solution via variational problem (40),


see if u = g throughout Ω.

Another exercise: verify that ∆g = 0 analytically using


polar coordinates.

Brown Feb 2017 66/110


General non-convex domains

Singularity like the L-shaped domain occurs for any


domain with non-convex vertex depicted in Figure 6(b),
where the angle of the re-entrant vertex is κ.

The L-shaped domain corresponds to κ = 23 π.

The principle singularity for such a domain is of the form

gκ (r(cos θ, sin θ)) = rπ/κ sin((π/κ)θ). (51)

Note that when κ < π (a convex vertex), the gradient of


gκ is bounded.

Exercise: explore this general case for various values of


κ.
Brown Feb 2017 67/110
Slit domain

The largest that κ can be is 2π which corresponds to a


slit domain.

We have g2π = r sin( 21 θ), which is still in H 1 (Ω).

The slit domain is often a model for crack propagation.

An illustration of a problem on a slit domain is given by


−∆u = 1 in [0, 1] × [−1, 1]
∂u (52)
u = 0 on Γ, = 0 on ∂Ω\Γ,
∂n
 1

where Γ = (x, 0) : x ∈ [ 2 , 1] .

Brown Feb 2017 68/110


Slit domain continued

The solution of (52) is depicted in Figure 7, where only


the top half of the domain (that is, [0, 1] × [0, 1]) is shown.

The solution in the bottom half of the domain can be


obtained by symmetric reflection across the x-axis.

The square-root singularity is clearly visible.

Brown Feb 2017 69/110


Slit domain solution

Figure 7: Illustration of the singularity that can occur when boundary con-
dition types are changed, cf. (53), as well as a cut-away of the solution to
slit problem (52). Computed with piecewise linears on the indicated mesh.
Brown Feb 2017 70/110
General non-convex domains

The range of κ values for a realistic polygonal domain


excludes a region around κ = 0 and κ = π.

In particular, we see that κ = π does not yield a


singularity; the boundary is a straight line in this case,
and gπ (x, y) = r sin θ = y, which is not singular.

When κ = 0, there is no interior in the domain near this


point.

Thus for any polygonal domain with a finite number of


vertices with angles κj , there is some ǫ > 0 such that
κj ∈ [ǫ, π − ǫ] ∪ [π + ǫ, 2π] for all j.
Brown Feb 2017 71/110
Three-dimensional singularities

In three dimensions, the set of possible singularities is


much greater [4].

Edge singularities correspond to the vertex singularities


in two dimensions, but in addition, vertex singularities
appear [10].
The effect of smoothing singular boundaries is
considered in [6].

Brown Feb 2017 72/110


Changing boundary condition type

When boundary conditions change type along a straight


line, singularity same as slit domain.

Suppose that we have a domain


 2

Ω = (x, y) ∈ R : x ∈ [−1, 1], y ∈ [0, 1]

and we impose homogeneous Dirichlet conditions on


 2

Γ = (x, 0) ∈ R : x ∈ [0, 1]

and Neumann conditions on ∂Ω\Γ.


We can reflect the domain Ω around the line y = 0, and
we get the domain [−1, 1]2 with a slit given by Γ.

Brown Feb 2017 73/110


Changing boundary condition type


g2π = r sin( 21 θ) satisfies Dirichlet conditions on Γ and
Neumann conditions on Γ∗ .
Such singularities occur any time we switch from
Dirichlet to Neumann boundary conditions along a
straight boundary segment.
We illustrate this with the following problem:
−∆u = 0 in [0, 1]2
∂u (53)
u = 0 on Γ, = 0 on ∂Ω\Γ,
∂n
 1

where Γ = (x, 0) : x ∈ [ 2 , 1] , cf. Figure 7.

Exercise: explore this problem in more detail.


Brown Feb 2017 74/110
Mesh refinements for singularities

Suppose that, in general,

|∇k u(r)| ≈ C|r − r0 |−k+γ for r ∈ Ω, (54)

where ∇k u denotes tensor of partial derivatives of order


k, and |T| denotes the Frobenius norm of a tensor T.
For the L-shaped problem, we saw this holds for k = 1
and γ = 2/3.
(54) holds for all k ≥ 1 and γ = π/κ for boundary
vertices with angle κ.
For simplicity, we assume that r0 = 0 from now on.

Brown Feb 2017 75/110


Local error estimates

From (36) we have

ku − uh kH 1 (Ω) ≤ C inf ku − vkH 1 (Ω) .


v∈Vh

For a non-uniform mesh,


X 2
ku − Ih uk2H 1 (Ω) ≤C m−1
he kukH m (e) , (55)
e

where summation is over all of elements e of mesh and


he = size of e.
Since we are assuming that the derivatives of the
solution degrade in a radial fashion, let us also assume
that the mesh is refined in a radial fashion.
Brown Feb 2017 76/110
Optimal mesh refinements

For each element e, let re denote its centroid re .


Assume there is a monotonic mesh function µ such that
he ≈ (1/n)µ(|re |), where n is a mesh size parameter.
For example, we will consider µ(r) = rβ for β > 0.
Let |e| denote the volume of an element e.
With such a mesh and under the assumption (54), the
error expression (55) takes the form
X p 2
2−2m m−1 −m+γ
n µ(|re |) |re | |e|
e
Z (56)
2−2m m−1

−m+γ 2
≈n µ(|r|) |r| dr.

Brown Feb 2017 77/110


Optimal mesh conditions

Taking µ(r) = rβ , the integrand in (56) simplifies to |r|p


where p = 2(β(m − 1) − m + γ).

Such an expression is integrable in d dimensions if and


only if p > −d, that is, if
m − γ − d/2
β> .
m−1
If d = 2 and m = 2 (piecewise linears in 2 D),
requirement is β > 1 − γ.
For the L-shaped domain, this means β > 13 .

Brown Feb 2017 78/110


Optimal mesh conditions continued

For higher-order approximations, mesh conditions are


different.

Other corners of the L-shaped domain can also require


mesh refinement.

For these, γ = 2, and cubics (m = 4) requires β > 31 .

In this case, β > 7/9 is required at the re-entrant corner


(for m = 4).

When γ = π/κ is sufficiently large


(comparable with m − d/2), we can take
β ≈ 0, meaning a mesh of uniform size.
Brown Feb 2017 79/110
Localized behavior

How to model localized behavior in a physical system:

what is shape of drum head if you push down on it with


a sharp pin?

Tempting to model as effect occuring at a single point.

The Laplace equation models to a reasonable extent the


deformation of the drum head (for small deformations),
so one might consider
−∆u =0 in Ω
(57)
u(x0 ) =u0
where u0 denotes the prescribed position of the pencil.
Brown Feb 2017 80/110
An ill-posed problem?

However, this problem is not well posed.

Difficulty: one cannot constrain a function in H 1 (Ω) at a


single point.

This is illustrated by the function [2, Example 1.4.3]

v(x) = log | log |x| | (58)

which satsifies v ∈ H 1 (B) where


 2 1

B = x ∈ R : |x| < 2 .
This function does not have a well-defined point value at
the origin.

Brown Feb 2017 81/110


Knife edge versus pin

Thus setting a point value for a function in H 1 does not


make sense.

By shifting this function around, we realize that functions


in H 1 may not have point values on a dense set of
points {xi }:

X
u(x) = 2−i log | log |x − xi | | (59)
i=1

For example, take the set of points {xi } to be dense in


 2 1

D = x ∈ R : |x| < 4 .

Brown Feb 2017 82/110


Knife edge versus pin

It is possible to change to a Dirichlet problem


−∆u =0 in Ω
(60)
u =u0 on Γ
where Γ is a small curve representing the point of
contact of a knife edge with the drum head, and u0 is
some function defined on Γ.

As long as Γ has positive length, this problem is well


posed.
However, its behavior will degenerate as the length of Γ
is decreased.

Brown Feb 2017 83/110


Fundamental solution

Another approach to modeling such phenomena is


using the Dirac δ-function [2]:
−∆u =δx0 in Ω
(61)
u =0 on ∂Ω,
where δx0 is the linear functional δx0 (v) = v(x0 ).

Again, there is an issue since this linear functional is not


bounded on V , as the function v defined in (58)
illustrates.
On the other hand, the solution to (61) is known as the
Green’s function for the Laplacian on Ω (with Dirichlet
conditions).
Brown Feb 2017 84/110
Fancy spaces

Possible to make sense of (61) using sophisticated


Sobolev spaces [2].

However, rather than taking that approach, we take one


that effectively resolves the issue in conventional
spaces.

What we do is replace δx0 by a smooth function δxA0 with


the property that
Z
δxA0 (x) v(x) dx → v(x0 ) as A → ∞ (62)

for sufficiently smooth v.

Brown Feb 2017 85/110


Mollified δx0

We then consider the problem


∆uA =δxA0 in Ω
A
(63)
u =g on ∂Ω.
Note that we can pick g to be the fundamental solution,
and thus we have uA → g as A → ∞.

For example, we can choose δxA0 to be Gaussian


function of amplitude A and integral 1. In particular, in
two dimensions,
−πA|x−x0 |2
δxA0 = Ae .

Brown Feb 2017 86/110


An ill-posed problem?

We check our requirement √ that the integral is 1 via the


change of variables y = πA x:
Z Z
−πA|x−x0 |2 −|y−y0 |2
πA e dx = e dy
R2 R2Z

−r2
= 2π e r dr
Z ∞ 0

=π es ds = π.
0

In our experiments, x0 was chosen to be near the middle


of the square Ω = [0, 1]2 , that is, x0 = (0.50001, 0.50002)
to avoid having the singularity at a grid point.

Brown Feb 2017 87/110


Computational data

The fundamental solution for the Laplace equation in


two dimensions is
1
g(x) = − log |x − x0 |,

and so we took as boundary conditions g(x) for x ∈ ∂Ω.
Approximation of singular Green’s function only first
order accurate.
Increasing the order of polynomials used is only of
modest benefit.
Increasing the amplitude of the approximate δ-function
useful up to a point, but making it larger only of value if
the mesh is refined.
Brown Feb 2017 88/110
Computational data

degree mesh amplitude error check-sum


1 128 10,000 5.27e-03 -2.34e-02
1 256 10,000 2.50e-03 -4.57e-09
1 512 10,000 1.47e-03 -2.22e-16
1 1024 10,000 1.08e-03 5.11e-15
4 256 10,000 9.73e-04 -1.02e-10
1 512 100,000 9.67e-04 -1.06e-03
1 1024 100,000 5.24e-04 -1.98e-14
Table 3: Data for the solution of (63). Key: degree is the degree of polyno-
mials used, mesh is the number of triangle pairs in each direction.
R The am-
plitude is A, error is kuA
h − gkL2 (Ω) , check-sum is the value 1 − Ω δxA0 h dx

where δx0 h denotes the interpolant of δxA0 in Vh .
A

Brown Feb 2017 89/110


Adding a potential

We now augment the equation (1) with a potential Z,


which is simply a function defined on Ω with real values.
The PDE takes the form

−∆u + Zu = f in Ω (64)

together with the boundary conditions (2).

To formulate the variational equivalent of (1) with


boundary conditions (2), we again use the variational
space 
1
V := v ∈ H (Ω) : v|Γ = 0 . (65)

Brown Feb 2017 90/110


Bilinear form

The appropriate bilinear form for the variational problem


is then
Z
aZ (u, v) = ∇u(x) · ∇v(x) + Z(x)u(x)v(x) dx. (66)

In the case of homogeneous boundary conditions, we


seek a solution u ∈ V to
Z
aZ (u, v) = f (x)v(x) dx ∀ v ∈ V. (67)

The simplest case is when Z is a constant, in which


case (64) is often called the Helmholtz equation.

Brown Feb 2017 91/110


Bounded V

The Helmholtz problem becomes interesting if Z is


large, or equivalently, there is a small coefficient in front
of ∆ in (64).
Exercise: explore this problem.
To understand coercivity in such problems, we first
consider the eigenvalue problem

−∆u = λu in Ω (68)

together with the boundary conditions (2).


Denote solution of (68) by uλ .

Brown Feb 2017 92/110


Potential coercivity

Let λ0 be the lowest eigenvalue, and uλ0 ∈ V the


corresponding eigenvector, for the eigenproblem
problem (68):
Z
a0 (uλ , v) = λ uλ (x)v(x) dx ∀ v ∈ V, (69)

where a0 (·, ·) denotes the case Z ≡ 0, same as bilinear


form a(·, ·) in (6).
Coercivity (24) of the bilinear form a0 (·, ·) shows that
λ0 > 0.
Moreover, if Z(x) > −λ0 for all x ∈ Ω, then the problem
(67) is well posed since it is still coercive.

Brown Feb 2017 93/110


Unbounded potentials

For certain unbounded potentials, it is still possible to


show that (67) is well posed.
For example, if Z is either the Coulombic or graviational
potential Z(x) = −|x|−1 , then the eigenvalue problem
Z
aZ (uλ , v) = λ uλ (x)v(x) dx ∀ v ∈ V, (70)

is well posed, even in the case Ω = R3 .

In this case, eigensolutions correspond to


the wave functions of the hydrogen atom [7].
Exercise: explore this problem.
Brown Feb 2017 94/110
van der Waals interaction

Figure 8: Asymptotic wavefunction perturbation computed with quartics on


a mesh of size 100, with L = 7.
Brown Feb 2017 95/110
van der Waals interaction

van der Waals interaction energy between two hydrogen


atoms, separated by a distance R, is asymptotically of
the form −C6 R−6 where the constant C6 can be
computed [3] by solving a two-dimensional PDE.
Let Ω = [0, ∞] × [0, ∞] and consider the PDE
1
− ∆u(r1 , r2 ) + (κ(r1 ) + κ(r2 )) u(r1 , r2 )
2 (71)
1
= − (r1 r2 )2 e−r1 −r2 in Ω,
π
where the function κ is defined by κ(r) = r−2 − r−1 + 12 .
The minimum of κ occurs at r = 2, and we have
κ(r) ≥ 14 .
Brown Feb 2017 96/110
van der Waals variational form

The problem (71) is well posed in H01 (Ω), i.e., given


Dirichlet conditions on the boundary of the
quarter-plane Ω.
The variational form for (71) is
Z
1
aκ (u, v) = 2 ∇u(r1 , r2 ) · ∇v(r1 , r2 ) dr1 dr2
ZΩ

+ κ(r1 ) + κ(r2 ) u(r1 , r2 ) v(r1 , r2 ) dr1 dr2 ,

(72)

defined for all u, v ∈ H01 (Ω).

Brown Feb 2017 97/110


van der Waals coercivity

The form (72) is coercive on H01 (Ω), since


κ(r1 ) + κ(r2 ) ≥ 12 . In particular,
Z
1
aκ (v, v) ≥ |∇v(r1 , r2 )|2 + v(r1 , r2 )2 dr1 dr2 , (73)
2 Ω
for all v ∈ H01 (Ω).

The form aκ (·, ·) is continuous on H01 (Ω) because of the


Hardy inequality
Z ∞ Z ∞
2 ′
2
u(r)/r dr ≤ 4 u (r) dr (74)
0 0

for u ∈ H01 (0, ∞).


Brown Feb 2017 98/110
van der Waals form continuity

Note that it would not be continuous on all of H 1 (0, ∞):

without the Dirichlet boundary condition, the form


would be infinite for some functions in H 1 (0, ∞).

Here is an example of a variational form where


• coercivity is easy to demonstrate
• but continuity is delicate.

Brown Feb 2017 99/110


van der Waals interaction

To be able to render this problem computationally


feasible, we replace Ω by a square ΩL of side L in
length; ΩL = [0, L] × [0, L]. Define U (r1 , r2 ) = u(Lr1 , Lr2 ).
Then ∆U (r1 , r2 ) = L2 ∆u(Lr1 , Lr2 ). Thus
1 −2 1
− L ∆U (r1 , r2 ) = − ∆u(Lr1 , Lr2 )
2 2
L4
= − (κ(Lr1 ) + κ(Lr2 )) u(Lr1 , Lr2 ) − (r1 r2 )2 e−Lr1 −Lr2
π
L4
= − (κ̂L (r1 ) + κ̂L (r2 )) U (r1 , r2 ) − (r1 r2 )2 e−Lr1 −Lr2 ,
π
(75)

where κ̂L (r) = L−2 r−2 − L−1 r−1 + 12 .


Brown Feb 2017 100/110
van der Waals interaction

Therefore U satisfies
4
L
− 12 L−2 ∆U (r1 , r2 )+(κ̂L (r1 ) + κ̂L (r2 )) U (r1 , r2 ) = − (r1 r2 )2 e−Lr1 −Lr2 ,
π
(76)
which we can pose with homogeneous Dirichlet boundary
conditions (u = 0) on Ω1 = [0, 1] × [0, 1].

Multiplying by 2L2 , we obtain the equation


2L6
−∆U (r1 , r2 ) + (κL (r1 ) + κL (r2 )) U (r1 , r2 ) = − (r1 r2 )2 e−Lr1 −Lr2
π
= f (r1 , r2 ),
(77)

where κL (r) = 2r−2 − 2Lr−1 + L2 .

Brown Feb 2017 101/110


van der Waals computation

Thus we introduce the variational form


Z
aL (u, v) = ∇u(r1 , r2 ) · ∇v(r1 , r2 )
[0,1]2 (78)

+ κL (r1 ) + κL (r2 ) u(r1 , r2 ) v(r1 , r2 ) dr1 dr2

Variational problem: find uL ∈ V = H01 ([0, 1]2 ) such that


Z
aL (uL , v) = f (r1 , r2 ) v(r1 , r2 ) dr1 dr2 (79)
[0,1]2

for all v ∈ V .
The solution is shown in Figure 8 with L = 7 computed
on a mesh of size 100 with quartic Lagrange piecewise
polynomials.
Brown Feb 2017 102/110
van der Waals interaction

The main quantity of interest [3, equation (3.25)] is


Z ∞Z ∞
32π
C6 = − r12 r22 e−(r1 +r2 ) u(r1 , r2 ) dr1 dr2
3 0 0
Z Z
32π L L 2 2 −(r1 +r2 )
≈− r1 r2 e u(r1 , r2 ) dr1 dr2
3 0 0
Z LZ L
32π
≈− r12 r22 e−(r1 +r2 ) U (r1 /L, r2 /L) dr1 dr2
3 0 0
Z 1Z 1 (80)
32π
=− L4 R12 R22 e−(LR1 +LR2 ) U (R1 , R2 ) L2 dR1 dR2
3 0 0
2 6 Z 1Z 1
16π 2L
=− R12 R22 e−(LR1 +LR2 ) U (R1 , R2 ) dR1 dR2
3 π 0 0
2 Z 1Z 1
16π
= f (R1 , R2 ) U (R1 , R2 ) dR1 dR2 ,
3 0 0

where we made the substitution ri = LRi , i = 1, 2, and f is defined in (77).

Brown Feb 2017 103/110


van der Waals interaction

degree quadrature mesh no. C6 error ǫ L time


4 6 100 4.57e-07 1.00e-09 15.0 1.47
4 10 100 4.57e-07 1.00e-09 15.0 1.595
4 8 250 4.56e-07 1.00e-09 15.0 12.5
2 4 600 4.45e-07 1.00e-09 15.0 4.738
2 2 250 -1.22e-07 1.00e-09 15.0 0.786
2 3 255 -2.74e-08 1.00e-09 15.0 0.786
2 3 265 4.23e-08 1.00e-09 15.0 0.837
2 4 240 -1.87e-08 1.00e-09 15.0 0.739

Table 4: Using finite element computation of C6 = 6.4990267054 [3]. The


potential was modified as in (81). Computations were done with 4 cores via
MPI and a PETSc Krylov solver. Error values were the same for ǫ = 10−9
and ǫ = 10−12 .

Brown Feb 2017 104/110


van der Waals interaction

To avoid singularities in the coefficients, we modified the potential to be

κǫL (r) = 2(ǫ + r)−2 − 2L(ǫ + r)−1 + L2 . (81)

Computational results are shown in Table 4. The results were insensitive


to ǫ for ǫ ≤ 10−9 .
The singularity (ri )−2 is difficult to deal with. But we can integrate by parts
to soften its effect, as follows:
Z Z  

(ri )−2 u(r1 , r2 ) v(r1 , r2 ) dr1 dr2 = − (ri )−1 u(r1 , r2 ) v(r1 , r2 ) dr1 dr2
Ω ∂ri
Z Ω
−1 ∂

= (ri ) u(r1 , r2 ) v(r1 , r2 ) dr1 dr2 ,
Ω ∂ri
(82)

where for simplicity we define Ω = [0, 1]2 here and for the remainder of
this subsection.

Brown Feb 2017 105/110


Another formulation

We have assumed that u, v ∈ V = H01 (Ω) in (82). Thus


Z
−2 −2

(r1 ) + (r2 ) u(r1 , r2 ) v(r1 , r2 ) dr1 dr2

Z
−1 −1
 
= (r1 ) , (r2 ) · ∇ u(r1 , r2 ) v(r1 , r2 ) dr1 dr2
ZΩ  
  
= (r1 )−1 , (r2 )−1 · ∇u(r1 , r2 ) v(r1 , r2 ) + ∇v(r1 , r2 ) u(r1 , r2 ) dr1 dr2

Thus we introduce a new variational form (cf. (78))


Z
ǫ ǫ ǫ

âL (u, v) = ∇u(r1 , r2 ) · ∇v(r1 , r2 ) + κ̂L (r1 ) + κ̂L (r2 ) u(r1 , r2 ) v(r1 , r2 ) dr1 dr2

Z

b
+ 2 β(r1 , r2 ) · (∇u(r1 , r2 )) v(r1 , r2 ) + u(r1 , r2 )(∇v(r1 , r2 )) dr1 dr2

where

b −1 −1
β(r1 , r2 ) = (r1 + ǫ) , (r2 + ǫ) , κ̂ǫL (r) = −2L(r + ǫ)−1 + 2L2 .
Brown Feb 2017 106/110
Boundary layers

Extended exercise: Let ǫ > 0. Consider the problem

−ǫ∆uǫ + uǫ = f in Ω

together with the boundary conditions (2), where f is


held fixed independent of ǫ.

Give conditions for which you would expect uǫ → f as


ǫ → 0.

Do a simple example in which f does not satisfy the


boundary conditions (2) and see what happens for small
ǫ.
Does uǫ → f except in a small boundary layer?
Brown Feb 2017 107/110
Boundary layers continued

Compare your results with those in Table 5 which


corresponds to the choices f ≡ 1 and ǫ = 10−6 .

Best results require a large number of nodes to resolve


the boundary layer, but among the different choices
(linear, quadratics, and so forth), the results are about
the same and take about the same time to compute.
High-order polynomial does not provide particular
benefit in this case.

Brown Feb 2017 108/110


Computational data

degree mesh number L2 difference time


1 256 6.86e-02 1.11
1 512 5.34e-02 5.1
1 1024 4.72e-02 29
2 512 4.54e-02 23
4 256 4.48e-02 18
8 128 4.47e-02 25
8 8 7.74e-02 23

Table 5: Boundary layer problem with ǫ = 10−6 . Degree refers to the poly-
nomial degree, mesh number indicates the number of edges along each
boundary side, L2 difference is ku − f kL2 ([0,1]2 ) , and time is in seconds.
Brown Feb 2017 109/110
References

[1] Wolfgang Bangerth and Rolf Rannacher. Adaptive finite element methods for differential equations. Birkhäuser, 2013.

[2] S. Brenner and L. R. Scott. The Mathematical Theory of Finite Element Methods. Springer-Verlag, 2002. Second Edition.

[3] Eric Cancès and L. Ridgway Scott. van der Waals interactions between two hydrogen atoms: The Slater-Kirkwood method
revisited. submitted to SIMA, TBD, 2016.

[4] Martin Costabel and Monique Dauge. Singularities of electromagnetic fields in polyhedral domains. Archive for Rational
Mechanics and Analysis, 151(3):221–276, 2000.

[5] Martin Costabel, Monique Dauge, and Christoph Schwab. Exponential convergence of hp-FEM for Maxwell equations with
weighted regularization in polygonal domains. Mathematical Models and Methods in Applied Sciences, 15(04):575–622, 2005.

[6] Charles L. Epstein and Michael O’Neil. Smoothed corners and scattered waves. arXiv preprint arXiv:1506.08449, 2015.

[7] Linus Pauling and E. Bright Wilson. Introduction to Quantum Mechanics with Applications to Chemistry. Dover, 1985.

[8] Dominik Schötzau, Christoph Schwab, and Rolf Stenberg. Mixed hp-FEM on anisotropic meshes II: Hanging nodes and tensor
products of boundary layer meshes. Numerische Mathematik, 83(4):667–697, 1999.

[9] Pavel Šolı́n, Jakub Červenỳ, and Ivo Doležel. Arbitrary-level hanging nodes and automatic adaptivity in the hp-fem. Mathematics
and Computers in Simulation, 77(1):117–132, 2008.

[10] M.N. Vu, S. Geniaut, P. Massin, and J.J. Marigo. Numerical investigation on corner singularities in cracked plates using the
G-theta method with an adapted θ field. Theoretical and Applied Fracture Mechanics, 77:59 – 68, 2015.

Brown Feb 2017 110/110

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy