Sie sind auf Seite 1von 13

Part I

ONE-DIMENSIONAL PROBLEMS

17
Chapter 1

1D Model Elliptic Problem

It is customary to start any presentation on finite elements with one-dimensional elliptic problems.
In this opening chapter, we will study a model two-point elliptic boundary-value problem for a linear
differential equation of second order. We shall discuss the equivalence of classical and variational
formulations, equivalence with a minimization problem, and then follow in the next chapters with
foundations of the Galerkin method, and a development of a 1D hp code. Much of the introduced
formalism will seem to be over-sophisticated as it is motivated with the anticipated development of
related ideas in two and three space dimensions.

1.1 A Two-Point Boundary Value Problem

Classical formulation. We wish to find a solution u(x), x [0, l], of a second order, linear
differential equation,

(a(x)u(x) ) + b(x)u (x) + c(x)u(x) = f (x), x (0, l), (1.1.1)

accompanied at each of the endpoints x = 0 or x = l, with one of three possible boundary condi-
tions:

Dirichlet boundary condition (BC),

u(0) = u0 or u(l) = ul , (1.1.2)

Neumann BC,
a(0)u (0) = 0 or a(l)u (l) = l , (1.1.3)

Cauchy BC,

a(0)u (0) + 0 u(0) = 0 or a(l)u (l) + l u(l) = l . (1.1.4)

19
20 CHAPTER 1. 1D MODEL ELLIPTIC PROBLEM

The Neumann boundary condition is just a special case of the Cauchy boundary condition with
constant = 0.
The data to the problem consist of

the material data: coefficients of the differential operator a(x), b(x), c(x), coefficients of the
Cauchy boundary operator 0 , l , and

the load data: source term f (x) and boundary data u 0 , ul , 0 , l .

For the sake of this presentation, we shall select the Dirichlet boundary condition at x = 0 and
Cauchy boundary condition at x = l,

u(0) = u0 , a(l)u (l) + u(l) = .

The discussion of the remaining eight different combinations of BCs follows (almost) identical
steps.
Typical regularity assumptions for the data in the classical formulation are:

a C 1 [0, l], b, c, f C(0, l) .

Under a few additional assumptions (e.g. coefficient a(x) should not degenerate, a(x) > a min > 0),
the classical Ordinary Differential Equations (ODE) theory implies existence (and possibly unique-
ness) of a solution u C 2 (0, l) C 1 [0, l].

Interface problem. In practice, the material constants are only piecewise regular, frequently just
piecewise constant. At the discontinuity points second derivatives do not exist (in the classical
sense), the classical formulation looses its validity, and has to be replaced with an interface problem
formulation. For instance, if

a1 (x), 0 x x0
a(x) = ,
a2 (x), x0 x l

we anticipate also a two-branch solution,



u1 (x), 0 x x0
u(x) = ,
u2 (x), x0 x l

and formulate the problem as follows.

The original equation, to be solved in the two subdomains:

(a1 (x)u1 (x) ) + b1 (x)u1 (x) + c1 (x)u1 (x) = f1 (x) x (0, x0 ) ,


(a2 (x)u2 (x) ) + b2 (x)u2 (x) + c2 (x)u2 (x) = f2 (x) x (x0 , l) .
1.1. A TWO-POINT BOUNDARY VALUE PROBLEM 21

The original boundary conditions:

u1 (0) = u0 , a2 (l)u2 (l) + u2 (l) = .

The interface conditions at x0 :

u1 (x0 ) = u2 (x0 ), a1 (x0 )u1 (x0 ) = a2 (x0 )u2 (x0 ) .

The interface conditions are encountered in practical applications. Consistently with a physical
interpretation, the product au , will be called the flux. The second interface condition requires
the continuity of the flux and, in presence of discontinuous material coefficient a(x), implies a
corresponding discontinuity of the first derivative. Consequently, at the interface point, the second
derivative does not exist.
The interface problem can be generalized to an arbitrary number of interfaces.

Weak (variational) formulation of the problem. Let u be now a classical solution of the original
problem. We employ an arbitrary test function v(x), multiply equation (1.1.1) pointwise by v(x),
and integrate over interval (0, l) to obtain,
Z l Z l Z l Z l

(au ) v dx + bu v dx + cuv dx = f v dx .
0 0 0 0

Integrating the first term by parts, we get:


Z l Z l

(au ) v dx = au v dx a(l)u (l)v(l) + a(0)u (0)v(0) .
0 0

We use now a different strategy at the two endpoints. At x = l, we utilize the Cauchy boundary
condition, and replace the flux term with

a(l)u (l)v(l) = u(l)v(l) v(l) .

At x = 0, as no information about the flux is available, we choose not to test the equation by
assuming an extra condition for the test function: v(0) = 0. Keeping the terms involving the
unknown solution on the left, and moving the known data to the right, we arrive at the formulation:


u(0) = u0


Z l Z l
(au
v + bu
v + cuv) dx + u(l)v(l) = f v dx + v(l) (1.1.5)



0 0
for every test function v, v(0) = 0 .

This is the Variational (Weak) Formulation of the BVP (VBVP). Notice that we have simply rewrit-
ten the Dirichlet BC.
22 CHAPTER 1. 1D MODEL ELLIPTIC PROBLEM

The interface problem yields exactly the same formulation. Multiplying the original equation
with v1 in (0, x0 ), and with v2 in (x0 , l), integrating over the two subintervals, and summing up the
contributions, we get:
Z x0 Z l

(a1 u1 ) v1 dx + (a2 u2 ) v2 dx
0 x0
Z x0 Z l
= a1 u1 v1 dx + a2 u2 v2 dx
0 x0
a2 (l)u2 (l)v2 (l) + [a2 (x0 )u2 (x0 ) a1 (x0 )u1 (x0 )] v(x0 ) + a1 (0)u1 (0)v1 (0)
Z l
= au v dx + u(l)v(l) v(l) .
0

In the above, we have assumed that the test function v(x), similarly to the solution, is continuous
at the interface, v1 (x0 ) = v2 (x0 ). In the last line, we have combined the integrals over the two
subintervals into one integral, and dropped the index notation for the branches.
Thus, solutions to both the original and the interface problem, satisfy the same variational iden-
tity. We will show in Section 1.4 that appropriate regularity (integrability) assumptions for the
solution and the test functions imply automatically global continuity, i.e. there is no need to assume
the continuity at the interface explicitly.
Apparently, when constructing the VBVP we have not lost any information about the solution.
We will show now that, conversely, any sufficiently regular solution to the variational problem, is
also the classical solution. We shall discuss the more general interface problem only.
Let u(x), represented with branches u1 , u2 , be a solution to variational problem (1.1.5). Inte-
grating the weak formulation by parts over each subinterval separately and collecting the subinter-
val, boundary and interface terms, we obtain:
Z x0 Z l

{(a1 u1 ) + b1 u1 + c1 u1 f1 }v1 dx + {(a2 u2 ) + b2 u2 + c2 u2 f2 }v2 dx
0 x0

+{a2 (l)u2 (l) + u2 (l) }v2 (l) + a2 (x0 )u2 (x0 ) + a1 (x0 )u1 (x0 ) v(x0 ) = 0 .
(1.1.6)
We need to recall now the classical Fouriers lemma.

THEOREM 1
(Fouriers lemma)
Let f be a continuous function defined on (0, l) such that
Z l
f (x)v(x) dx = 0 ,
0

for every continuous test function v that vanishes at the endpoints, v(0) = v(l) = 0.
Then f must identically vanish, f = 0.
1.2. ALGEBRAIC STRUCTURE OF THE VARIATIONAL FORMULATION 23

Notice that dropping the condition on test functions to vanish on the boundary would make the
theorem weaker. It is sufficient to test with functions which vanish on the boundary to conclude that
tested function f (we assume no BCs for f) must be identically equal zero.
We now proceed in two steps.

Recovering the differential equations. We first test with test functions v vanishing outside of
subinterval (0, x0 ), including the interface point. We use Fouriers lemma to recover the
differential equation in the first subinterval

(a1 (x)u1 (x) ) + b1 (x)u1 (x) + c1 (x)u1 (x) f1 (x) = 0 x (0, x0 ) .

We use the same argument to recover the differential equation in the second subinterval.

Recovering interface and boundary conditions. Once we know that the integrands correspond-
ing to the two integrals in (1.1.6) are zero, the corresponding integral terms must vanish
identically for all test functions (not only for the special functions used in the previous step),
and (1.1.6) reduces to:

{a2 (l)u2 (l) + u2 (l) }v2 (l) + a2 (x0 )u2 (x0 ) + a1 (x0 )u1 (x0 ) v(x0 ) = 0 .

Testing with test function v such that v(x0 ) = 1, v(l) = 0, we recover the interface condition,
and testing with test function v such that v(x0 ) = 0, v(l) = 1, we recover the Cauchy BC.

In our proof of equivalence we have tacitly assumed that the variational solution is sufficiently
regular, so we can integrate back by parts, and introduce the second derivatives.
We say that the two formulations are equivalent up to the regularity of the solution.

1.2 Algebraic structure of the variational formulation

It is convenient to identify more precisely the algebraic structure of the weak formulation. The test
functions form a vector space, the so-called space of test functions,

V = {v(x) : v(0) = 0} (1.2.7)

To be fully precise, we must specify the regularity of the test functions yet, to be discussed in
Section 1.4.
The right hand side of the VBVP is identified as a linear functional l(v) of test function v V ,
Z l
l(v) = f v dx + v(l) . (1.2.8)
0
24 CHAPTER 1. 1D MODEL ELLIPTIC PROBLEM

Recall that linearity of l means that:

l(1 v1 + 2 v2 ) = 1 l(v1 ) + 2 l(v2 ) .

Similarly, the left-hand side of VBVP is identified as a bilinear functional b(u, v) 1 of solution u
and test function v,
Z l

b(u, v) = au v + bu v + cuv dx + u(l)v(l) . (1.2.9)
0

Recall that bilinearity means that, with fixed u, functional b(u, v) is linear in v and, with fixed v, is
linear in u.
Next we introduce the notion of the lift. A function u0 is a lift of Dirichlet data u0 , if the
restriction of u0 to Dirichlet boundary x = 0 coincides with data u0 . In other words, the lift is
simply an extension of u0 to the whole domain. The simplest lift can be constructed by extending
boundary data u0 with a constant function,

u0 (x) = u0 .

Once we have introduced lift u0 , we can subtract it from solution u, and the difference will vanish
at x = 0, i.e. it will belong to the space of test functions. In other words, the solution must be the
sum of the lift and a test function. The collection of such sums is identified as the algebraic sum of
lift u0 and space V , and called an affine space,

u0 + V = {u0 + v : v V } .

The final algebraic structure of the variational formulation can be expressed in a very concise form
known as the abstract variational formulation,
(
u u0 + V
(1.2.10)
b(u, v) = l(v), v V.

In the particular case of homogeneous Dirichlet BCs i.e., when u 0 = 0, we can use the zero function
as a lift, and the abstract VBVP takes a simpler form,
(
uV
b(u, v) = l(v), v V.

The case of non-homogeneous Dirichlet BCs can be characterized in yet another way. Once we
have found a particular function u0 that satisfies the non-homogeneous Dirichlet data, we make
simply the substitution u = u0 + w where w V satisfies the homogeneous Dirichlet boundary
1
Notice the notational conflict between coeffi cient b = b(x) and bilinear form b = b(u, v). The meaning of the
symbol should be clear from context
1.3. EQUIVALENCE WITH A MINIMIZATION PROBLEM 25

conditions, and set to determine the perturbation w. The corresponding abstract formulation is then
as follows. (
wV
(1.2.11)
b(w, v) = l(v) b(u0 , v), v V .
Thus, solution of the non-homogeneous case reduces to the homogeneous one, provided we can
find the lift and modify next the right-hand side according to the formula above. Note that, with u 0
fixed, the right-hand side of (1.2.11) defines a modified linear form,

lmod (v) = l(v) b(u0 , v) . (1.2.12)

1.3 Equivalence with a minimization problem

The abstract VBVP is more than just a convenient way of communication. First of all, many other
concrete BVPs have precisely the same algebraic structure and can be expressed using the same
formalism. In fact, all classical theories in stationary (statics) linear mechanics lead to it, to mention
a few: linear elasticity, various beam, plate and shell theories.
The abstract VBVP also allows for studying an underlying minimum principle corresponding to
the classical Lagrange Theorem in mechanics. Let V be a subspace of some larger vector space X,
u0 be an element of that space, and l(v), b(u, v) some linear and bilinear forms defined on space X.
We begin by introducing a quadratic functional,
1
J(u) = b(u, u) l(u) ,
2
frequently called the functional of total potential energy. We are now interested in minimizing the
functional over the affine space u0 + V ,
(
u u0 + V
(1.3.13)
J(u) min .
Let u be a minimizer of functional J. Take an arbitrary test function v and a number . Then vector
u + v is an element of affine space u0 + V (explain, why?), and we can introduce an auxiliary
quadratic function of variable ,
() = J(u + v)
= 12 b(u + v, u + v) l(u + v)
= 12 b(v, v)2 + ( 12 (b(u, v) + b(v, u)) l(v)) + ( 12 b(u, u) l(u)) .
In deriving the formula above, we have used linearity of l and bilinearity of b. If functional J attains
its minimum at u, then the quadratic polynomial () must attain its minimum at = 0. This leads
to the condition:
d 1
(0) = (b(u, v) + b(u, v)) l(v) = 0 .
d 2
Chapter 2

Galerkin Method

In this chapter we discuss the fundamentals of the Galerkin method: the idea of finite-dimensional
approximation of the Variational Boundary-Value Problem (VBVP), the notion of the best approxi-
mation error, and an elementary approximation error analysis.

2.1 Finite dimensional approximation of the VBVP

The space of test functions is a function space, and it is infinite dimensional. In general, it takes
an infinite number of functions to approximate the unknown solution. The Galerkins idea is to
approximate it with a finite number of linearly independent functions e i = ei (x) from test space V ,
N
X
u(x) u0 (x) + uj ej (x) ,
j=1

where the coefficients uj are to be determined. Functions ej are called the basis functions, and the
unknown coefficients uj are called the global degrees of freedom (d.o.f.).
The idea is very general, and we will discuss it in context of the abstract VBVP, using argument-
less notation. Along with the solution, we use the same basis functions to approximate the test
functions,
XN XN
u u0 + uj ej v vl el .
j=1 l=1

We substitute now the approximations into the abstract VBVP,


N
X N
X N
X
b(u0 + uj ej , vl el ) = l( vl el ) . (2.1.1)
j=1 l=1 l=1

The equation is to be satisfied for every test function which, for the finite-dimensional approxima-
tion, translates into condition: for every choice of coefficients v l , l = 1, . . . , N . We select vl = li

47
48 CHAPTER 2. GALERKIN METHOD

(Kroneckers delta) to arrive at a system of N algebraic equations,

N
X
b(u0 + uj ej , ei ) = l(ei ), i = 1, . . . , N .
j=1

Conversely, we can multiply the equations above with arbitrary coefficients v i , sum up wrt i, and use
linearity of form l, and form b(u, v) wrt v, to arrive at the previous equation. The two formulations
are thus equivalent. Additionally, if we also use the linearity of form b(u, v) in u (we are solving a
linear problem), we realize that the algebraic equations are linear,

N
X
b(u0 , ei ) + b(ej , ei )ui = l(ei ), i = 1, . . . , N .
j=1

Function u0 representing a lift of Dirichlet data u0 is known, so it is advisable to move it to the


right-hand side,
XN
b(ej , ei )uj = l(ei ) b(u0 , ei ), i = 1, . . . , N .
j=1

Matrix bij = b(ej , ei ) will be called the (global) stiffness matrix, vector li = l(ei ) is the (global)
load vector, and vector limod = lmod (ei ) = l(ei ) b(u0 , ei ) is the (global) modified load vector. In
order to solve the approximate problem, we have to compute matrices B = {b ij }, lmod = {limod },
and solve the system of linear equations,

N
X
bij uj = limod , i = 1, . . . , N , (2.1.2)
j=1

or, using the matrix notation,


Bu = lmod .

Here the unknown d.o.f. uj have been put into a vertical vector.
Summing up, in order to determine the approximate solution, we need to:

select lift u0 of Dirichlet data u0 ,

calculate the global stiffness matrix and the modified load vector,

solve system (2.1.2).

We can look at the Galerkin method more precisely using the language of vector spaces. Func-
tions ej , j = 1, . . . , N span an N -dimensional subspace Vh of V . Index h is here an abstraction for
a maximum element size, and it comes from the language of finite elements. Thus, by definition,
Chapter 3

1D hp Finite Element Method

In this chapter we introduce the fundamentals of hp finite elements in 1D: construction of basis
functions suitable for the Galerkin method using element shape functions, calculation of element
matrices, assembling element matrices into global matrices, solution of the global system of equa-
tions, and the simplest postprocessing.

3.1 One-dimensional hp discretization

The Finite Element Method is a special case of the Galerkin method, and it differs from other
versions of the Galerkin method with the way the basis functions are constructed. FE basis functions
are constructed as unions of element shape functions, over a few adjacent elements, extended by zero
to the rest of the domain. The support of a FE basis function is always contained in a few elements
only. In the h version of the method, where the convergence is attained by increasing the number of
elements, this leads to sparse stiffness matrices.
We begin by partitioning the interval (0, l) into N subintervals,

0 = x0 < x1 < . . . < xK < xK+1 < . . . < xN = l .

Each of the subintervals (xK , xK+1 ), K = 1, . . . , N , will be called a finite element, and it will have
two parameters associated with it: element length hK = xK+1 xK , and element local polynomial
order of approximation pK . Convergence of the method will be achieved by either decreasing the
element size, hK 0, or by increasing the polynomial degree, pK . For each element1 K,
we introduce pK + 1 polynomial shape functions that span the space P pK of polynomials of order
less or equal pK . To simplify the notation, we shall drop element index K, and talk about order p,
with the understanding that p may change locally, from element to element.
1
We shall use a dual notation where K denotes also the actual subinterval, K = (x K , xK+1 )

55
56 CHAPTER 3. 1D HP FINITE ELEMENT METHOD

1D master element of order p. Let K be an element in the FE mesh. Instead of introducing


the shape functions on the so-called physical element K directly, it is more convenient to consider
a generic, master element first, define master element shape functions, and then use the idea of a
parametric element to define the shape functions for the physical element.
Geometrically, the 1D master element K coincides with the unit interval (0, 1). The element
space of shape functions X(K) is identified as polynomials of order p, i.e.,

X(K) = P p (K) .

One can introduce many particular bases that span polynomials of order p. The simplest choice is
offered by the Peano hierarchical shape functions [109, 91] defined as follows,
1 () = 1
2 () =
3 () = (1 )
l () = (1 )(2 1)l3 , l = 4, . . . , p + 1 .
The functions admit a simple recursive formula,
1 () = 1
2 () =
3 () = 1 ()2 ()
l () = l1 ()(2 () 1 ()), l = 4, . . . , p + 1 .
Note that, except for the first two linear functions, the remaining shape functions vanish at the el-
ement endpoints. For that reason they are frequently called the bubble functions. The linear shape
functions will also be called the vertex node shape functions, corresponding to the first (left) and
the second (right) element vertex node. The remaining bubble functions correspond to the element
interior. We will visualize it by introducing the notion of an abstract element middle node, and asso-
ciating all bubble function with the node. The element middle nodes will be graphically represented
with arrows placed at element mid-points, see Fig.3.1. Consequently, the element bubble functions
will also be called the middle node shape functions. Grouping all middle node shape functions into
one node is motivated with the logic of assembling and reflected with a Fortran object discussed
in the next chapter.

Legendre polynomials. A much better choice for the 1D master element shape functions is the
integrated Legendre polynomials [126]. Legendre polynomials P n (x), n = 0, 1, . . . are eigenvectors
of the Legendre operator,

d dPn
(1 x2 ) = n(n + 1)Pn , x (1, 1) .
dx dx

Das könnte Ihnen auch gefallen