Numerical Solutions to Partial Differential Equations Zhiping Li LMAM and School of Mathematical Sciences Peking University
Variational Problems of the Dirichlet BVP of the Poisson Equation 1 For the homogeneous Dirichlet BVP of the Poisson equation { u = f, x Ω, u = 0, x Ω, 2 The weak form w.r.t. the virtual work principle: { Find u H 1 0 (Ω), such that a(u, v) = (f, v), v H 1 0 (Ω), where a(u, v) = Ω u v dx, (f, v) = Ω fv dx. 3 The weak form w.r.t. the minimum potential energy principle: { Find u H 1 0 (Ω), such that J(u) = min v H 1 0 (Ω) J(v), where J(v) = 1 2 a(v, v) (f, v).
Use Finite Dimensional Trial, Test and Admissible Function Spaces 1 Replace the trial and test function spaces by appropriate finite dimensional subspaces, say V h (0) H 1 0 (Ω), we are led to the discrete problem: { Find u h V h (0) such that a(u h, v h ) = (f, v h ), v h V h (0), Such an approach is called the Galerkin method. 2 Replace the admissible function space by an appropriate finite dimensional subspace, say V h (0) H 1 0 (Ω), we are led to the discrete problem: { Find u h V h (0) such that J(u h ) = min vh V h (0) J(v h ). Such an approach is called the Ritz method. 3 The two methods lead to an equivalent system of linear algebraic equations.
Galerkin Method and Ritz Method Algebraic Equations of the Galerkin and Ritz Methods Derivation of Algebraic Equations of the Galerkin Method Let {ϕ i } N h i=1 be a set of basis functions of V h(0), let N h N h u h = u j ϕ j, v h = v i ϕ i, j=1 then, the Galerkin method leads to { Find u h = (u 1,..., u Nh ) T R N h such that Nh i,j=1 a(ϕ j, ϕ i )u j v i = N h i=1 (f, ϕ i)v i, v h = (v 1,..., v Nh ) T R N h, which is equivalent to N h j=1 a(ϕ j, ϕ i )u j = (f, ϕ i ), i = 1, 2,, N h. The stiffness matrix: K = (k ij ) = (a(ϕ j, ϕ i )); the external load vector: f h = (f i ) = ((f, ϕ i )); the displacement vector: u h ; the linear algebraic equation: K u h = f h. i=1 4 / 34
Galerkin Method and Ritz Method Algebraic Equations of the Galerkin and Ritz Methods Derivation of Algebraic Equations of the Ritz Method 1 The Ritz method leads to a finite dimensional minimization problem, whose stationary points satisfy the equation given by the Galerkin method, and vice versa. 2 It follows from the symmetry of a(, ) and the Poincaré- Friedrichs inequality (see Theorem 5.4) that stiffness matrix K is a symmetric positive definite matrix, and thus the linear system has a unique solution, which is a minima of the Ritz problem. 3 So, the Ritz method also leads to K u h = f h. 5 / 34
The Key Is to Construct Finite Dimensional Subspaces There are many ways to construct finite dimensional subspaces for the Galerkin method and Ritz method. For example 1 For Ω = (0, 1) (0, 1), the functions ϕ mn (x, y) = sin(mπx) sin(nπy), m, n 1, which are the complete family of the eigenfunctions {ϕ i } i=1 of the corresponding eigenvalue problem { u = λu, x Ω, u = 0, and form a set of basis of H 1 0 (Ω). x Ω, 2 Define V N = span{ϕ mn : m N, n N}, the corresponding numerical method is called the spectral method. 3 Finite element method is a systematic way to construct subspaces for more general domains.
Finite Element Methods A Typical Example of the Finite Element Method Construction of a Finite Element Function Space for H 1 0([0, 1] 2 ) 1 The Dirichlet boundary value problem of the Poisson equation u = f, x Ω = (0, 1) 2, u = 0, x Ω. 2 We need to construct a finite element subspace of H 1 0 ([0, 1]2 ). 3 Firstly, introduce a triangulation T h (Ω) on the domain Ω: Triangular element {T i } M i=1 ; T i T j =, 1 i j M; If T i T j : it must be a common edge or vertex; h = max i diam(t i ); Nodes {A i } N i=1, which is globally numbered. 11 6 16 17 18 19 20 T 17 T 19 T 21 T 23 T 18 T 20 T 22 T 24 12 13 14 T 9 T 11 T 13 T 15 T 10 T 12 T 14 T 16 7 8 9 T 1 T 3 T 5 T 7 T 2 T 4 T 6 T 8 15 10 1 2 3 4 5 7 / 34
Finite Element Methods A Typical Example of the Finite Element Method Construction of a Finite Element Function Space for H 1 0([0, 1] 2 ) 4 Secondly, define a finite element function space, which is a subspace of H 1 ([0, 1] 2 ), on the triangulation T h (Ω): V h = {u C(Ω) : u Ti P 1 (T i ), T i T h (Ω)}. 5 Then, define finite element trial and test function spaces, which are subspaces of H 1 0 ([0, 1]2 ): V h (0) = {u V h : u(a i ) = 0, A i Ω}. 6 A function u V h is uniquely determined by {u(a i )} N i=1. 7 Basis {ϕ i } N i=1 of V h: ϕ i (A j ) = δ ij, i = 1, 2,..., N. 8 k ij = a(ϕ j, ϕ i ) 0, iff A i A j T e for some 1 e M. 9 supp(ϕ i ) is small the stiffness matrix K is sparse. 8 / 34
Finite Element Methods A Typical Example of the Finite Element Method Assemble the Global Stiffness Matrix K from the Element One K e 1 Denote a e (u, v) = T e u v dx, by the definition, then, k ij = a(ϕ j, ϕ i ) = M e=1 ae (ϕ j, ϕ i ) = M e=1 ke ij. 2 k e ij = ae (ϕ j, ϕ i ) 0, iff A i A j T e. For most e, k e ij = 0. 3 It is inefficient to calculate k ij by scanning i, j node by node. 4 Element T e with nodes {A e α} 3 α=1 the global nodes A en(α,e). 5 Area coordinates λ e (A) = (λ e 1 (A), λe 2 (A), λe 3 (A))T for A T e, λ e α(a) = AA e β Ae γ / A e αa e β Ae γ P 1 (T e ), λ e α(a e β ) = δ αβ. 6 ϕ en(α,e) Te (A) = λ e α(a), A T e. 9 / 34
Finite Element Methods A Typical Example of the Finite Element Method The Algorithm for Assembling Global K and f h 7 Define the element stiffness matrix K e = (k e αβ ), ke αβ ae (λ e α, λ e β ) = T e λ e α λ e β dx, 8 Then, k ij = k e αβ can be assembled element wise. en(α, e)=i T e en(β, e)=j T e 9 The external load vector f h = (f i ) can also be assembled by scanning through elements f i = f λ e α dx = fα e. T e en(α, e)=i T e en(α, e)=i T e 10 / 34
Finite Element Methods A Typical Example of the Finite Element Method The Algorithm for Assembling Global K and f h Algorithm 6.1: K = (k(i, j)) := 0; f = (f (i)) := 0; for e = 1 : M K e = (k e (α, β)); % calculate the element stiffness matrix f e = (f e (α)); % calculate the element external load vector k(en(α, e), en(β, e)) := k(en(α, e), en(β, e)) + k e (α, β); f (en(α, e)) := f (en(α, e)) + f e (α); end 11 / 34
Finite Element Methods A Typical Example of the Finite Element Method Calculations of K e and f e Are Carried Out on a Reference Element 1 The standard reference triangle T s = {ˆx = (ˆx 1, ˆx 2 ) R 2 : ˆx 1 0, ˆx 2 0 and ˆx 1 + ˆx 2 1}, with A s 1 = (0, 0)T, A s 2 = (1, 0)T and A s 3 = (0, 1)T. 2 For T e with A e 1 = (x 1 1, x 1 2 )T, A e 2 = (x 2 1, x 2 2 )T, A e 3 = (x 3 1, x 3 2 )T, define A e = (A e 2 Ae 1, Ae 3 Ae 1 ), a e = A e 1. 3 x = L e (ˆx) := A eˆx + a e : T s T e is an affine map. 4 The area coordinates of T e : λ e α(x) = λ s α(l 1 e (x)), since it is an affine function of x, and λ s α(l 1 e (A e β )) = λs α(a s β ) = δ αβ. 5 λ e (x) = λ s (ˆx) L 1 e (x) = λ s (ˆx)A 1 e. 12 / 34
Finite Element Methods A Typical Example of the Finite Element Method Calculations of K e and f e Are Carried Out on a Reference Element 6 Change of integral variable ˆx = L 1 e (x) := A 1 e x A 1 e A e 1, K e = λ e (x) ( λ e (x)) T dx = λ s (ˆx)A 1 e ( λ s (ˆx)A 1 e ) T det A e dˆx, T e T s f e = f (x)λ e (x) dx = det A e f (L e (ˆx))λ s (ˆx) dˆx. T e T s 7 λ s 1 (ˆx 1, ˆx 2 ) = 1 ˆx 1 ˆx 2, λ s 2 (ˆx 1, ˆx 2 ) = ˆx 1, λ s 3 (ˆx 1, ˆx 2 ) = ˆx 2, so 1 1 λ s (ˆx) = 1 0, 0 1 A 1 e = 1 deta e ( x 3 2 x 1 2 x 1 1 x 3 1 x 1 2 x 2 2 x 2 1 x 1 1 ). 13 / 34
Finite Element Methods A Typical Example of the Finite Element Method Calculations of K e and f e in Terms of λ s and A e 8 The area of T s is 1/2, hence, the element stiffness matrix is x K e 1 2 2 x 2 3 x1 3 x 2 1 = x2 3 2 det A x 2 1 x1 1 x 1 3 e x2 1 x 2 2 x1 2 x 1 1 ( x 2 2 x2 3 x2 3 x 2 1 x2 1 x 2 2 x1 3 x 1 2 x1 1 x 1 3 x1 2 x 1 1 9 In general, it is necessary to apply a numerical quadrature to the calculation of the element external load vector f e. 10 If f is a constant on T e, then f e = 1 6 f (T e) det A e (1, 1, 1) T = 1 3 f (T e) T e (1, 1, 1) T. ). 14 / 34
Finite Element Methods Extension to More General Boundary Conditions Extension of the Example to More General Boundary Conditions For a Dirichlet boundary condition u(x) = u 0 (x) 0, on Ω, FE trial function space V h (0) should be replaced by V h (u 0 ) = {u V h : u(a i ) = u 0 (A i ), A i Ω}. For a more general mixed type boundary condition u(x) = u 0 (x), x Ω 0, u ν + bu = g, x Ω 1, We need to 1 add contributions of Ω 1 buv dx and Ω 1 gv dx to K and f by scanning through edges on Ω 1 ; 15 / 34
Finite Element Methods Extension to More General Boundary Conditions Extension of the Example to More General Boundary Conditions 2 Set finite element trial function space: V h (u 0 ; Ω 0 ) = {u V h : u(a i ) = u 0 (A i ), A i Ω 0 }, if Ω 0 (mixed boundary condition); V h, if Ω 0 = but b > 0 (the 3rd type boundary condition); V h (0; A i ) = {u V h : u(a i ) = 0, on a specified node A i Ω}, if Ω 0 = and b = 0 (pure Neumann boundary condition). Note: In the case of pure Neumann boundary condition, the solution is unique up to an additive constant. V h (0; A i ) removes such uncertainty, so the solution in V h (0; A i ) is unique. Likewise, let l be a non-zero linear functional on V h, then we may as well take V h (0; l) = {u V h : l(u) = 0}. 16 / 34
Finite Element Methods Extension to More General Boundary Conditions Summary of the Typical Example on FEM 1 introduce a finite element partition (triangulation) T h to the region Ω, such as the triangular partition shown above. 2 Establish finite element trial and test function spaces on T h (Ω), such as continuous piecewise affine function spaces satisfy appropriate boundary conditions shown above. 3 Select a set of basis functions, known as the shape functions, for example, the area coordinates on the triangular element. 4 Calculate the element stiffness matrixes K e and element external load vector fh e, and form the global stiffness matrix K and external load vector f h. 17 / 34
Finite Element Methods Extension to More General Boundary Conditions Some General Remarks on the Implementation of FEM Arrays used in the algorithm: 1 en(α, e): assigns a global node number to a node with the local node number α on the eth element. 2 edg0(α, edg): assigns a global node number to a node with the local node number α on the edgth edge on Ω 0. edg1(α, edg), edg2(α, edg) are similar arrays with respect to Neumann and Robin type boundaries. 3 cd(i, nd): assigns the ith component of the spatial coordinates to a node with the global node number nd. 18 / 34
Finite Element Methods Extension to More General Boundary Conditions Some General Remarks on the Implementation of FEM Arrays used in the algorithm: 4 In iterative methods for solving Ku h = f h, it is not necessary to form the global stiffness matrix K, since it always appears in the form Kv h = e T h K e vh e. In such cases, we may need: 5 et(i, τ): assigns the global element number to the τth local element of the ith global node. And edgrt(i, τ), etc. 19 / 34
Finite Element and Finite Element Function Spaces The General Definition of Finite Element Three Basic Ingredients in a Finite Element Function Space (FEM 1) Introduce a finite element triangulation T h on the region Ω, which divides the region Ω into finite numbers of subsets K, generally called finite element, such that (T h 1) Ω = K Th K; (T h 2) each finite element K T h is a closed set with a nonempty interior set K; (T h 3) K 1 K 2 =, for any two different finite elements K 1, K 2 T h ; (T h 4) every finite element K T h has a Lipschitz continuous boundary. 20 / 34
Finite Element and Finite Element Function Spaces The General Definition of Finite Element Three Basic Ingredients in a Finite Element Function Space (FEM 2) Introduce on every finite element K T h a function space P K which consists of some polynomials or other functions having certain approximation properties and at the same time easily manipulated analytically and numerically; (FEM 3) The finite element function space V h has a set of normalized basis functions which are easily computed, and each of the basis function has a small support. Generally speaking, a finite element is not just a subset K, it includes also the finite dimensional function space P K defined on K and the corresponding normalized basis functions. 21 / 34
Finite Element and Finite Element Function Spaces The General Definition of Finite Element General Abstract Definition of a Finite Element Definition A triple (K, P K, Σ K ) is called a finite element, if 1 K R n, called an element, is a closed set with non-empty interior and a Lipschitz continuous boundary; 2 P K : K R is a finite dimensional function space consisting of sufficiently smooth functions defined on the element K; 3 Σ K is a set of linearly independent linear functionals {ϕ i } N i=1 defined on C (K), which are called the degrees of freedom of the finite element and form a dual basis corresponding to a normalized basis of P K, meaning that there exists a unique basis {p i } N i=1 of P K such that ϕ i (p j ) = δ ij. 22 / 34
Finite Element and Finite Element Function Spaces The General Definition of Finite Element An Additional Requirement on the Partition In applications, an element K is usually taken to be 1 a triangle in R 2 ; a tetrahedron in R 3 ; a n simplex in R n ; 2 a rectangle or parallelogram in R 2 ; a cuboid or a parallelepiped or more generally a convex hexahedron in R 3 ; a parallelepiped or more generally a convex 2n polyhedron in R n ; 3 a triangle with curved edges or a tetrahedron with curved faces, etc.. 23 / 34
Finite Element and Finite Element Function Spaces The General Definition of Finite Element An Additional Requirement on the Partition When a region Ω is partitioned into a finite element triangulation T h with such elements, to ensure that (FEM 3) holds, the adjacent elements are required to satisfy the following compatibility condition: (T h 5) For any pair of K 1, K 2 T h, if K 1 K2, then, there must exists an 0 i n 1, such that K 1 K2 is exactly a common i dimensional face of K 1 and K 2. 24 / 34
Finite Element and Finite Element Function Spaces The General Definition of Finite Element The Function Space P K Usually Consists of Polynomials 1 The finite element of the n-simplex of type (k): K is a n-simplex, P K = P k (K), which is the space of all polynomials of degree no greater than k defined on K. For example, the piecewise affine triangular element (2-simplex of type (1), or type (1) 2-simplex, or type(1) triangle). 2 The finite element of n-rectangle of type (k) (abbreviated as the n-k element): K is a n-rectangle, P K = Q k (K), which is the space of all polynomials of degree no greater than k with respect to each one of the n variables. For example, the bilinear element (the 2-rectangle of type (1), or type (1) 2-rectangle, or 2-1 rectangle); etc.. 25 / 34
Finite Element and Finite Element Function Spaces The General Definition of Finite Element The Nodal Degrees of Freedom Σ K The degrees of freedom in the nodal form: ϕ 0 i : p p (ai 0 ), Lagrange FE, if contains point values only ϕ 1 ij : p ν 1p (a1 ij i ), Hermite FE, if contains at least ϕ 2 ijk : p 2 p (a νij 2ν2 i 2 ), one of the derivatives ik where the points a s i K, s = 0, 1, 2 are called nodes, ν s ij Rn, s = 1, 2 are specified nonzero vectors. 26 / 34
Finite Element and Finite Element Function Spaces The General Definition of Finite Element The Nodal and Integral Degrees of Freedom Σ K The degrees of freedom in the integral form: ψi s 1 : p meas s (Ki s) p(x) dx, where Ki s, s = 0, 1,..., n are s-dimensional faces of the element K, and meas s (Ki s ) is the s-dimensional Lebesgue measure of K s i. For example, if s = n, then the corresponding degree of freedom is the average of the element integral. K s i 27 / 34
Finite Element and Finite Element Function Spaces Finite Element Interpolation P K Interpolation for a Given Finite Element (K, P K, Σ K ) Definition Let (K, P K, Σ K ) be a finite element, and let {ϕ i } N i=1 be its degrees of freedom with {p i } N i=1 P K being the corresponding dual basis, meaning ϕ i (p j ) = δ ij. Define the P K interpolation operator Π K : C (K) P K by N Π K (v) = ϕ i (v) p i, v C (K), i=1 and define Π K (v) as the P K interpolation function of v. In applications, it is often necessary to extend the domain of the definition of the P K interpolation operator, for example, to extend the domain of the definition of a Lagrange finite element to C(K). 28 / 34
Finite Element and Finite Element Function Spaces Finite Element Interpolation The P K Interpolation Operator Is Independent of the Choice of Basis Definition Let two finite elements (K, P K, Σ K ) and (L, P L, Σ L ) satisfy K = L, P K = P L, and Π K = Π L, where Π K and Π L are respectively P K and P L interpolation operators, then the two finite elements are said to be equivalent. 29 / 34
Finite Element and Finite Element Function Spaces Finite Element Interpolation Compatibility Conditions for P K and Σ K on Adjacent Elements 1 T h : a finite element triangulation of Ω; {(K, P K, Σ K )} K Th : a given set of corresponding finite elements. 2 V h = {v : K T h K R : v K P K }: FE function space. 3 Compatibility conditions are required to assure V h satisfies (FEM 3), as well as a subspace of V. For example, for polyhedron elements and nodal degrees of freedom, if K 1 K2, then, we require that a point a s i K 1 K2 is a node of K 1, if and only if it is also the same type of node of K 2. 30 / 34
Finite Element and Finite Element Function Spaces Finite Element Interpolation V h Interpolation Operator and V h Interpolation Denote Σ h = K T h Σ K as the degrees of freedom of the finite element function space V h. Definition Define the V h interpolation operator Π h : C (Ω) V h by Π h (v) K = Π K (v K ), and define Π h (v) as the V h interpolant of v. v C (Ω), In applications, similar as for the P K interpolation operator, the domain of definition of the V h interpolation operator is often extended to meet certain requirements. 31 / 34
Reference Finite Element ( ˆK, ˆP, ˆΣ) and Its Isoparametric Equivalent Family Definition Let ˆK, K R n, ( ˆK, ˆP, ˆΣ) and (K, P K, Σ K ) be two finite elements. Suppose that there exists a sufficiently smooth invertible map F K : ˆK K, such that F K ( ˆK) = K; p i = ˆp i F 1 K, i = 1,..., N; ϕ i (p) = ˆϕ i (p F K ), p P K, i = 1,..., N, where { ˆϕ i } N i=1 and {ϕ i} N i=1 are the basis of the degrees of freedom spaces ˆΣ and Σ K respectively, {ˆp i } N i=1 and {p i} N i=1 are the corresponding dual basis of ˆP and P K respectively. Then, the two finite elements are said to be isoparametrically equivalent. In particular, if F K is an affine mapping, the two finite elements are said to be affine-equivalent.
Finite Element and Finite Element Function Spaces Isoparametric and Affine Equivalent Family of Finite Elements An Isoparametric (Affine) Family of Finite Elements If all finite elements in a family are isoparametrically (affine-) equivalent to a given reference finite element, then we call the family an isoparametric (affine) family. For example, the finite elements with triangular elements and piecewise linear function space used in the previous subsection, i.e. finite elements of 2-simplex of type (1), are an affine family. 33 / 34
SK 6µ5, 6, 7 Thank You!