Introduction to the finite element method

Similar documents
Chapter 1: The Finite Element Method

Introduction to the J-integral

LECTURE # 0 BASIC NOTATIONS AND CONCEPTS IN THE THEORY OF PARTIAL DIFFERENTIAL EQUATIONS (PDES)

1. Let a(x) > 0, and assume that u and u h are the solutions of the Dirichlet problem:

Introduction. J.M. Burgers Center Graduate Course CFD I January Least-Squares Spectral Element Methods

Convergence Order Studies for Elliptic Test Problems with COMSOL Multiphysics

Finite Elements. Colin Cotter. January 15, Colin Cotter FEM

Math Tune-Up Louisiana State University August, Lectures on Partial Differential Equations and Hilbert Space

Least-Squares Finite Element Methods

Scientific Computing WS 2018/2019. Lecture 15. Jürgen Fuhrmann Lecture 15 Slide 1

Numerical Solutions to Partial Differential Equations

Scientific Computing WS 2017/2018. Lecture 18. Jürgen Fuhrmann Lecture 18 Slide 1

From Completing the Squares and Orthogonal Projection to Finite Element Methods

Lecture 9 Approximations of Laplace s Equation, Finite Element Method. Mathématiques appliquées (MATH0504-1) B. Dewals, C.

A very short introduction to the Finite Element Method

LECTURE 1: SOURCES OF ERRORS MATHEMATICAL TOOLS A PRIORI ERROR ESTIMATES. Sergey Korotov,

Mathematics FINITE ELEMENT ANALYSIS AS COMPUTATION. What the textbooks don't teach you about finite element analysis. Chapter 3

Contents as of 12/8/2017. Preface. 1. Overview...1

Simple Examples on Rectangular Domains

Numerical Methods for Partial Differential Equations CAAM 452. Spring 2005

A Method for Reducing Ill-Conditioning of Polynomial Root Finding Using a Change of Basis

How to solve the stochastic partial differential equation that gives a Matérn random field using the finite element method

AMS 529: Finite Element Methods: Fundamentals, Applications, and New Trends

Weak Formulation of Elliptic BVP s

Course Description for Real Analysis, Math 156

Function Approximation

arxiv: v1 [math.na] 29 Feb 2016

Chapter 2 Examples of Optimization of Discrete Parameter Systems

Chapter 6. Finite Element Method. Literature: (tiny selection from an enormous number of publications)

Scientific Computing I

INTRODUCTION TO FINITE ELEMENT METHODS

Variational Principles for Equilibrium Physical Systems

Partial Differential Equations

ACM/CMS 107 Linear Analysis & Applications Fall 2017 Assignment 2: PDEs and Finite Element Methods Due: 7th November 2017

A primer on Numerical methods for elasticity

1 Discretizing BVP with Finite Element Methods.

FEM Convergence for PDEs with Point Sources in 2-D and 3-D

Introduction to Computational Stochastic Differential Equations

Numerical Solutions to Partial Differential Equations

Steps in the Finite Element Method. Chung Hua University Department of Mechanical Engineering Dr. Ching I Chen

Finite Element Methods

Numerical Solutions of Laplacian Problems over L-Shaped Domains and Calculations of the Generalized Stress Intensity Factors

Numerical Solutions to Partial Differential Equations

Computational Fluid Dynamics Prof. Dr. Suman Chakraborty Department of Mechanical Engineering Indian Institute of Technology, Kharagpur

Linear Algebra, Summer 2011, pt. 2

PDEs, part 1: Introduction and elliptic PDEs

Preface. Figures Figures appearing in the text were prepared using MATLAB R. For product information, please contact:

CRITERIA FOR SELECTION OF FEM MODELS.

with a proper choice of the potential U(r). Clearly, we should include the potential of the ions, U ion (r):.

Adaptive Finite Element Methods Lecture Notes Winter Term 2017/18. R. Verfürth. Fakultät für Mathematik, Ruhr-Universität Bochum

Finite Elements. Colin Cotter. February 22, Colin Cotter FEM

Hamiltonian Field Theory

On an Approximation Result for Piecewise Polynomial Functions. O. Karakashian

Special Theory of Relativity Prof. Shiva Prasad Department of Physics Indian Institute of Technology, Bombay

Adaptive Finite Element Methods Lecture 1: A Posteriori Error Estimation

11.8 Vectors Applications of Trigonometry

1 Overview. 2 Learning from Experts. 2.1 Defining a meaningful benchmark. AM 221: Advanced Optimization Spring 2016

Lecture 6: Introduction to Partial Differential Equations

Finite Element Analysis Prof. Dr. B. N. Rao Department of Civil Engineering Indian Institute of Technology, Madras. Lecture - 06

DS-GA 1002 Lecture notes 0 Fall Linear Algebra. These notes provide a review of basic concepts in linear algebra.

Applied/Numerical Analysis Qualifying Exam

Variational Formulations

CS 450 Numerical Analysis. Chapter 8: Numerical Integration and Differentiation

Chapter 2 Convergence

u( x) = g( y) ds y ( 1 ) U solves u = 0 in U; u = 0 on U. ( 3)

Vectors. January 13, 2013

Lecture 8: Boundary Integral Equations

Time-dependent variational forms

The Finite Element Method

Math 440 Project Assignment

Seminar 6: COUPLED HARMONIC OSCILLATORS

Unit 2, Section 3: Linear Combinations, Spanning, and Linear Independence Linear Combinations, Spanning, and Linear Independence

A Mixed Nonconforming Finite Element for Linear Elasticity

2 A Model, Harmonic Map, Problem

A posteriori error estimation for elliptic problems

Computational Methods for Engineering Applications II. Homework Problem Sheet 4

Some New Elements for the Reissner Mindlin Plate Model

R T (u H )v + (2.1) J S (u H )v v V, T (2.2) (2.3) H S J S (u H ) 2 L 2 (S). S T

Making the grade. by Chris Sangwin. Making the grade

From Stationary Methods to Krylov Subspaces

Partial Differential Equations with Numerical Methods

Partial Differential Equations and the Finite Element Method

1 Introduction & Objective

Scientific Computing: An Introductory Survey

General elastic beam with an elastic foundation

Foliations of hyperbolic space by constant mean curvature surfaces sharing ideal boundary

Lehrstuhl Informatik V. Lehrstuhl Informatik V. 1. solve weak form of PDE to reduce regularity properties. Lehrstuhl Informatik V

Non-Conforming Finite Element Methods for Nonmatching Grids in Three Dimensions

PREPRINT 2010:23. A nonconforming rotated Q 1 approximation on tetrahedra PETER HANSBO

Ordinary Differential Equations Prof. A. K. Nandakumaran Department of Mathematics Indian Institute of Science Bangalore

Eigenvalues and eigenvectors

The Closed Form Reproducing Polynomial Particle Shape Functions for Meshfree Particle Methods

Mixed Finite Element Methods. Douglas N. Arnold, University of Minnesota The 41st Woudschoten Conference 5 October 2016

FORMULATION OF THE LEARNING PROBLEM

Solving the Time-Dependent Schrödinger Equation: Instructor Notes a. Abstract

REVIEW FOR TEST I OF CALCULUS I:

Preliminary Examination, Numerical Analysis, August 2016

0.2 Vector spaces. J.A.Beachy 1

Connectedness. Proposition 2.2. The following are equivalent for a topological space (X, T ).

Solving PDEs with Multigrid Methods p.1

Transcription:

Introduction to the finite element method Instructor: Ramsharan Rangarajan March 23, 2016 One of the key concepts we have learnt in this course is that of the stress intensity factor (SIF). We have come to appreciate it as an important factor in design and safety of structures containing cracks. Using complex variable techniques, we derived a few special solutions for displacement/stress fields in cracked, linearly elastic solids. Using these solutions, we were able to compute the SIF. It is worth noting that we assumed (semi)infinite, two dimensional geometries in deriving these solutions. Handbooks provide SIF values for a large number of special configurations. Formulae in such tables have been found using empirical fits to experimental data and are routinely used in fracture testing. Over the course of the next four lectures, we will learn about a few computational techniques to compute SIFs in the context of linear elastic fracture mechanics (LEFM). The boundary element and finite element methods (FEM) are perhaps the two most commonly used numerical methods to approximate solutions in LEFM. We will focus solely on the latter. At the end of this part of the course, we hope that you will appreciate the use of FEM in computational fracture mechanics, realize the pitfalls in the mesh solve plot approach invariably followed when using commercial FEM packages, be aware of the intricacies in FEM arising from approximating solutions with singularities, be cognizant of the different ways of computing SIFs from numerical solutions, and constantly evaluate/compare the merits of each approach, always check the documentation/manual of your FEM package to know what special techniques are being used to compute LEFM solutions and estimate SIFs. In this lecture, we will get a bird s eye view of the finite element method. We will provide just enough detail so as to develop some intuition behind the method. We will start paying attention to concepts more directly relevant to LEFM in subsequent lectures. This will also help you start working on the computing assignment. A highly recommended textbook on FEM especially suitable for engineers wishing to learn the subject is the Dover classic The 1

finite element method: Linear static and dynamic finite element analysis by Tom Hughes. 1 The Poisson problem We will use the 2D Poisson equation as the prototypical example for discussing the FEM. We consider the problem of computing a scalar-valued function φ defined on a two-dimensional domain that satisfies φ 2 φ x 2 + 2 φ = f over, y2 (1a) φ = 0 over. (1b) We can think of φ as the equilibrium temperature distribution of a plate represented by the domain in the presence of a heat source with intensity f(x, y). The boundary condition (1b) represents the fact that the plate is maintained at zero temperature along its boundary. Eq. (1) is an example of a linear, elliptic partial differential equation. The equilibrium equations of linear elasticity also fall under the same classification, except that the analogous equations have multiple components (as many as the number of spatial dimensions) and are usually more complex looking because of the coupling between various stress-strain components introduced by the constitutive relation. Eq. (1) is often referred to as the classical form of the Poisson equation. Its study is a dominant aspect of harmonic analysis and a unique solution can be proved to exist with some smoothness assumptions on f. An excellent text on this topic is Partial differential equations by Lawrence Evans. The analytical solution for (1) can be written down using the fundamental solution of the Laplace operator. Boundary element methods in fact exploit the knowledge of such fundamental solutions to approximate φ. The overarching goal of numerical methods is to compute a sequence of approximations {φ h } h such that φ h converges to φ in some sense as h 0. Then, we can progressively reduce h until φ φ h is smaller than a specified tolerance required depending on the application of interest. Although not related to the topic of interest, we mention the possibility of approximating (1) using finite differences. The idea here is that the partial derivatives appearing in (1) can be computed approximately using finite difference formulae: 2 φ φ(x + h, y) 2φ(x, y) + φ(x h, y) x2 h 2, (2a) 2 φ φ(x, y + h) 2φ(x, y) + φ(x, y h) y2 h 2. (2b) Representing ( 2 / x 2 + 2 / y 2 ) as the linear operator L, we effectively replace equation Lφ = 0 in (1a) by a different one L h φ h = 0, where L h is obtained by using the finite difference approximations (2) in place of the partial derivatives appearing in L. Next, rather than insisting that L h φ h = 0 hold at every (x, y) in 2

Figure 1: A representative finite difference grid., we only request that it hold at a finite number of points. In this way, we arrive at a system of equations represented by L h φ h (x i, y j ) = 0 for a chosen collection of points {(x i, y j )} i,j that is usually referred to as a grid. The computed solution labeled as φ h, is only expected to be an approximation of φ. Noticing that (2) reproduces L in the limit as h 0, we expect that φ h will be a progressively better approximation of φ as h is reduced, i.e., as the grid is refined. See any text on finite difference methods for a more complete picture. A recommended text is the book Fundamentals of engineering numerical analysis by Parviz Moin. 1.1 An alternate form To compute a finite element approximation of φ, we adopt a radically different approach. To this end, we will first convert (1) into an optimization problem. Let v : R be any function that vanishes on that is smooth enough to warrant the manipulations that follow. Multiplying (1a) by v, we get fv = v φ. (3) Integrating (3) over yields fv d = v φ d = ( φ v div(v φ)) d ( ) φ = φ v d v ds n = φ v d. (4a) (4b) (4c) (4d) Denote the collection of all sufficiently smooth functions 1 on that vanish 1 Strictly speaking, S is the Sobolev space H0 1 (). We will define this space in one of the questions in the following subsection. 3

on by S. Noting that the choice of v in (4) is arbitrary, we conclude that the solution φ of (1) necessarily satisfies φ v d = fv d for any/every v S. (5) Eq. (5) is called the weak form of (1). There are a few ways of understanding in what sense (5) is weaker than (1). Here we note that a solution of (1) is necessarily twice continuously differentiable (denoted C 2 ). However, solutions to (5) need not even be differentiable! That is, (5) is solvable for a much larger class of functions f than (1). For example, when f is a point source, (5) has a solution while (1) does not. However, when f is smooth enough (e.g., continuous), say when f is a constant function, the solutions of (1) and (5) coincide. In the finite element method, we choose to approximate (5) rather than (1). We are yet to understand why (5) is simpler to approximate than (1). However, we have seen that one important advantage of FEM is that it permits loading scenarios and boundary conditions that are relevant in engineering, but not admissible in the classical sense. Questions: (i) Justify the manipulation from (4a) to (4b). (ii) Justify the manipulation from (4b) to (4c). (iii) Justify why the boundary term appearing in (4c) vanishes in (4d). 1.2 An optimization problem Eq. (5) appears daunting at first. It may even seem that (1) was simpler. To resolve this question, we adopt an optimization-based perspective. The big picture is that in general, there is no prescriptive way of solving PDEs. However, we have numerous tools and approximation methods at our disposal to solve optimization problems. Plainly speaking, we are good at maximizing/minimizing/extremizing functions; at least we are better at it than solving PDEs. Consider the functional ( ) 1 J(v) = v v fv d, (6) 2 where J : S R assigns a scalar to each function in S. We can think of J(v) as a cost associated with the function v. The key observation here is that the Euler-Lagrange equation corresponding to the minimization of (6) is precisely 4

the weak form (5). To wit, requesting that φ be a stationary point of J yields 0 = δj(φ), v d ( ) 1 (φ + ηv) (φ + ηv) f(φ + ηv) d dη 2 (7a) η=0 = ( φ v fv) d, (7b) which is precisely the weak form of the Poisson problem. Hence one interpretation of the FEM for the Poisson problem is that to solve (1), we approximately solve the optimization problem of finding a minimizer of the functional J in (6), namely Find φ arg min J(v). (8) v S An additional appeal of (8) over (1) is that the former is much more amenable to approximation using computer codes. Moreover, we can use known results from optimization theory to understand conditions for existence and uniqueness of solutions to (8). Questions: (i) Justify that (7b) follows from (7a). (ii) Justify that minimization problem (8) is equivalent to the weak form (5). 1.3 The Galerkin method Having decided to solve the weaker version of the Poisson problem, we arrive at the question of how to solve the optimization problem (8), at least approximately. An elegant answer is provided by the Galerkin method. Choose a finite dimensional subspace S h of S. Then, an approximation of the optimization problem (8) is computed as φ h arg min v S h J(v). (9) Notice that the only distinction between (8) and (9) is the choice of the collection of functions over which the minimum is sought. While we seek to find φ as a minimizer of J over the space S in (8), we seek φ h as a minimizer of J over the subspace S h in (9). Questions: (i) Define a vector space (the real kind will suffice). 5

Figure 2: The Galerkin approximation φ h of φ. (ii) Show that the collection of functions H0 1 () {v : R : (v 2 + v v) d < } is a vector space. This is an example of a Sobolev space, which happens to be the natural function space in which to study (5). In onedimension, it can be shown that H 1 0 ( R) consists of continuous function. In higher dimensions, such a characterization does not hold, meaning that there are functions in H 1 0 () that are not continuous. Hence it does not even make sense to talk about point-wise values of functions in H 1 0 (). Moreover, the gradient appearing in the definition above should in fact be interpreted as the weak derivative. These points should be kept in mind, but are beyond the scope of our current discussion. (iii) Define what we mean by S h being a finite dimensional subspace of S. (iv) Comparing (8) and (9), prove that J(φ h ) J(φ). (v) Convince yourself that although S h is finite dimensional, it has infinitely many functions. Considering that both S and S h contain infinitely many functions (being vector spaces), it may be a little puzzling as to why (9) is any easier to solve than (8). This is easy to answer. Since S h is finite dimensional, say of dimension 0 < n <, we can find a basis {N i } n i=1 that spans S h. Any function v S h can be expressed uniquely as a linear combination of these basis functions, say 6

v(x, y) = v i N i (x, y) where v i s are scalar coefficients. Then notice that J(v) = 1 2 K ijv i v j F k v k for v S h, (10) where K ij N i N j and F i fn i d. (11) Hence the Galerkin approximation (9) reduces to finding the coefficients {φ i } n i=1 of φ h with respect to the basis {N i } n i=1 : ( ) 1 Find φ arg min v R n 2 vt Kv Fv, (12) which in turn reduces to solving the linear system of equations Kφ = F. (13) In the FEM vernacular, the n n square matrix K is called the stiffness matrix and the n 1 vector F is called the force vector. Although (13) is likely to be very familiar, it is usually not derived in this way using an optimization-based approach. This is because the FEM is used also in problems that do not arise from a variational principle (extremal problem) such as (8). We choose the optimization route to provide the intuition behind FEM rather then merely go through a more mechanical derivation. It is common to arrive at (13) using analogies with spring or truss networks, or directly from the weak form as you will show in the following questions. Questions: (i) Using v = v i N i in (9), derive (10). (ii) Prove (13) starting from (12). (iii) Prove (12) starting from (13). That is, show that J(φ) J(v) for any v S h. (iv) An alternative perspective of FEM, applicable also to problems that may not be posed as an optimization problem, deals directly with the weak problem (5). The Galerkin method is more generally defined as Find φ h S h such that φ v d = fv d for each v S h. (14) That (9) is equivalent to (14) is shown with exactly the same arguments that showed equivalence of (5) and (8). By choosing test functions v = v i N i and φ h = φ i N i in (14), show that we arrive at the same set of equations as (13). 7

Figure 3: Choice of shape functions in the finite element method as piecewise polynomials. The image shows the ubiquitous choice of the hat function, that is a linear polynomial with support localized to a small region in. 1.4 Finite elements There is considerable freedom in the choice of basis functions {N i } n i=1 for the subspace S h. They only need to be included in S = H0 1 (), i.e., be sufficiently smooth and vanish on the boundary. However, arbitrary choices for these functions is not advisable. After all, we would like that as we increase n, φ h provides a progressively better approximation of φ. That is, as we increase the number of basis functions thereby making S h into progressively larger subspace of S, φ in S is better approximated by φ h in S h. These considerations intricately link the Galerkin method with interpolation theory. For our purposes, the FEM is an instance of the Galerkin method for a specific choice of basis functions {N i } n i=1. The most common choices for basis functions are as piecewise polynomials, a distinctive feature of the finite element method. Adopting piecewise polynomials is judicious because: (i) Basis functions are conveniently constructed by meshing the domain. This consists in essentially breaking up into smaller pieces called finite elements and constructing polynomial functions over them. Elements usually have polygonal shapes in 2D and polyhedral shapes in 3D. (ii) It is straightforward to compute K and F by evaluating the necessary integrals since the integrands are usually either polynomials or rational polynomials. Numerical quadrature may be required when the forcing function f is not a polynomial. (iii) By insisting that each function N i be nonzero only over a small region of, we ensure that K becomes a sparse matrix. A sparse system Kφ = F can be solved far more efficiently than if K were dense. In fact, in realistic engineering applications, K is never inverted. (iv) The approximation of functions in Sobolev spaces with polynomials is well understood. Hence it is possible to estimate a priori, how well φ h will approximate φ. 8

Models Physical origins of PDEs and BVPs Variational principles (weak solutions) nonconforming methods Well posedness Existence, uniqueness Galerkin approximation for coercive problems Sobolev spaces, traces, embedding theorems, Poincare and Friedrich inequalities Best approxmation property Approximation theory Polynomial approximation in Sobolev spaces A priori rates of conververgence A posteriori error estimates adaptivity Figure 4: Topics of study in finite element methods 2 Computing assignment: Part 1 Instructions: For this computing assignment, you will require an implementation of the finite element method for the Poisson equation. Please team up in pairs. Ideally, a student who is currently taking the FEM class (or has taken one previously) will team up with a student who has not. You are welcome to use any non-commercial FEM code of your choice, including the Matlab program from the FEM class. For the benefit of those without exposure to FEM or seeking to learn an implementation of the method in C++, a simple code is provided to you. The source code contains only header files (.h) and therefore does not require compiling any libraries. You will require a C++11 compliant 9

compiler. The example eg-poisson.cpp computes the finite element solution of a Poisson problem. This example will be discussed in detail in class. The main benefits of using the code provided are: the instructor will be able to help in case you experience any difficulties or have any questions. you will receive half a point for each bug you find and report. You will earn good karma by helping students who take this class in the future. Please do not expect me to debug code either in person or over email. I will never look at your code except when you turn it in. If you have any difficulties, I will be happy to help you come up with ideas to enable you to resolve them. Questions: (i) Choose a 2D domain and a boundary condition φ 0 along. Find an exact solution to the Laplace equation φ = 0 over satisfying φ = φ 0 along. (ii) Mesh with relatively uniformly sized straight-edged triangles. This can be done in Matlab. An alternative is the open source, easy to use program gmsh. (iii) Prescribe the function φ 0 as the boundary condition in your program and compute the finite element approximation φ h of φ. (iv) Compute the L 2 () norm of the error in the solution defined as φ φ h (φ φ h ) 2 d. (v) Subdivide your mesh. Compute the solution over the refined mesh and the norm of the resulting error. The subdivision procedure will be described to you in class. (vi) Plot the L 2 () norm of the error versus the mesh size h. Take the mesh size h to be the maximum among the edge lengths in your mesh. (vii) Highlight the trend you observe in the error plot. (viii) Consult a textbook or online resource on finite elements. Quote any result/theorem that explains how the error is expected to behave as a function of the mesh size. What to turn in: Either on paper or electronically or in dropbox, turn in the following: 10

(a) The function implementing your choice of boundary condition. (b) A plot of the coarsest mesh you used. (c) A plot of the solution computed over the coarsest mesh. (d) The function implementing mesh refinement if you coded one yourself. (e) The function computing the L 2 error if you implemented one yourself. (f) A plot of the error versus mesh size. (g) A result/theorem from the literature that helps justify the trend your observed for the error as a function of the mesh size. 11