$$ \newcommand{\uex}{{u_{\small\mbox{e}}}} \newcommand{\uexd}[1]{{u_{\small\mbox{e}, #1}}} \newcommand{\vex}{{v_{\small\mbox{e}}}} \newcommand{\vexd}[1]{{v_{\small\mbox{e}, #1}}} \newcommand{\Aex}{{A_{\small\mbox{e}}}} \newcommand{\half}{\frac{1}{2}} \newcommand{\halfi}{{1/2}} \newcommand{\tp}{\thinspace .} \newcommand{\Ddt}[1]{\frac{D #1}{dt}} \newcommand{\E}[1]{\hbox{E}\lbrack #1 \rbrack} \newcommand{\Var}[1]{\hbox{Var}\lbrack #1 \rbrack} \newcommand{\Std}[1]{\hbox{Std}\lbrack #1 \rbrack} \newcommand{\xpoint}{\boldsymbol{x}} \newcommand{\normalvec}{\boldsymbol{n}} \newcommand{\Oof}[1]{\mathcal{O}(#1)} \newcommand{\x}{\boldsymbol{x}} \newcommand{\X}{\boldsymbol{X}} \renewcommand{\u}{\boldsymbol{u}} \renewcommand{\v}{\boldsymbol{v}} \newcommand{\w}{\boldsymbol{w}} \newcommand{\V}{\boldsymbol{V}} \newcommand{\e}{\boldsymbol{e}} \newcommand{\f}{\boldsymbol{f}} \newcommand{\F}{\boldsymbol{F}} \newcommand{\stress}{\boldsymbol{\sigma}} \newcommand{\strain}{\boldsymbol{\varepsilon}} \newcommand{\stressc}{{\sigma}} \newcommand{\strainc}{{\varepsilon}} \newcommand{\I}{\boldsymbol{I}} \newcommand{\T}{\boldsymbol{T}} \newcommand{\dfc}{\alpha} % diffusion coefficient \newcommand{\ii}{\boldsymbol{i}} \newcommand{\jj}{\boldsymbol{j}} \newcommand{\kk}{\boldsymbol{k}} \newcommand{\ir}{\boldsymbol{i}_r} \newcommand{\ith}{\boldsymbol{i}_{\theta}} \newcommand{\iz}{\boldsymbol{i}_z} \newcommand{\Ix}{\mathcal{I}_x} \newcommand{\Iy}{\mathcal{I}_y} \newcommand{\Iz}{\mathcal{I}_z} \newcommand{\It}{\mathcal{I}_t} \newcommand{\If}{\mathcal{I}_s} % for FEM \newcommand{\Ifd}{{I_d}} % for FEM \newcommand{\Ifb}{{I_b}} % for FEM \newcommand{\setb}[1]{#1^0} % set begin \newcommand{\sete}[1]{#1^{-1}} % set end \newcommand{\setl}[1]{#1^-} \newcommand{\setr}[1]{#1^+} \newcommand{\seti}[1]{#1^i} \newcommand{\sequencei}[1]{\left\{ {#1}_i \right\}_{i\in\If}} \newcommand{\basphi}{\varphi} \newcommand{\baspsi}{\psi} \newcommand{\refphi}{\tilde\basphi} \newcommand{\psib}{\boldsymbol{\psi}} \newcommand{\sinL}[1]{\sin\left((#1+1)\pi\frac{x}{L}\right)} \newcommand{\xno}[1]{x_{#1}} \newcommand{\Xno}[1]{X_{(#1)}} \newcommand{\yno}[1]{y_{#1}} \newcommand{\Yno}[1]{Y_{(#1)}} \newcommand{\xdno}[1]{\boldsymbol{x}_{#1}} \newcommand{\dX}{\, \mathrm{d}X} \newcommand{\dx}{\, \mathrm{d}x} \newcommand{\ds}{\, \mathrm{d}s} \newcommand{\Real}{\mathbb{R}} \newcommand{\Integerp}{\mathbb{N}} \newcommand{\Integer}{\mathbb{Z}} $$ previous next

Table of contents

Why finite elements?
      Domain for flow around a dolphin
      The flow
      Basic ingredients of the finite element method
      Our learning strategy
Approximation in vector spaces
      Approximation set-up
      How to determine the coefficients?
      Approximation of planar vectors; problem
      Approximation of planar vectors; vector space terminology
      The least squares method; principle
      The least squares method; calculations
      The projection (or Galerkin) method
      Approximation of general vectors
      The least squares method
      The projection (or Galerkin) method
Approximation of functions
      The least squares method
      The projection (or Galerkin) method
      Example: linear approximation; problem
      Example: linear approximation; solution
      Example: linear approximation; plot
      Implementation of the least squares method; ideas
      Implementation of the least squares method; symbolic code
      Implementation of the least squares method; numerical code
      Implementation of the least squares method; plotting
      Implementation of the least squares method; application
      Perfect approximation; parabola approximating parabola
      Perfect approximation; the general result
      Perfect approximation; proof of the general result
      Finite-precision/numerical computations
      Ill-conditioning (1)
      Ill-conditioning (2)
      Fourier series approximation; problem and code
      Fourier series approximation; plot
      Fourier series approximation; improvements
      Fourier series approximation; final results
      Orthogonal basis functions
      The collocation or interpolation method; ideas and math
      The collocation or interpolation method; implementation
      The collocation or interpolation method; approximating a parabola by linear functions
      Lagrange polynomials; motivation and ideas
      Lagrange polynomials; formula and code
      Lagrange polynomials; successful example
      Lagrange polynomials; a less successful example
      Lagrange polynomials; oscillatory behavior
      Lagrange polynomials; remedy for strong oscillations
      Lagrange polynomials; recalculation with Chebyshev nodes
      Lagrange polynomials; less oscillations with Chebyshev nodes
Finite element basis functions
      The basis functions have so far been global: \( \baspsi_i(x) \neq 0 \) almost everywhere
      In the finite element method we use basis functions with local support
      The linear combination of hat functions is a piecewise linear function
      Elements and nodes
      Example on elements with two nodes (P1 elements)
      Illustration of two basis functions on the mesh
      Example on elements with three nodes (P2 elements)
      Some corresponding basis functions (P2 elements)
      Examples on elements with four nodes per element (P3 elements)
      Some corresponding basis functions (P3 elements)
      The numbering does not need to be regular from left to right
      Interpretation of the coefficients \( c_i \)
      Properties of the basis functions
      How to construct quadratic \( \basphi_i \) (P2 elements)
      Example on linear \( \basphi_i \) (P1 elements)
      Example on cubic \( \basphi_i \) (P3 elements)
Calculating the linear system for \( c_i \)
      Computing a specific matrix entry (1)
      Computing a specific matrix entry (2)
      Calculating a general row in the matrix; figure
      Calculating a general row in the matrix; details
      Calculation of the right-hand side
      Specific example with two elements; linear system and solution
      Specific example with two elements; plot
      Specific example: what about four elements?
Assembly of elementwise computations
      Split the integrals into elementwise integrals
      The element matrix
      Illustration of the matrix assembly: regularly numbered P1 elements
      Illustration of the matrix assembly: regularly numbered P3 elements
      Illustration of the matrix assembly: irregularly numbered P1 elements
      Assembly of the right-hand side
Mapping to a reference element
      Affine mapping
      Integral transformation
      Advantages of the reference element
      Standardized basis functions for P1 elements
      Standardized basis functions for P2 elements
      Integration over a reference element; element matrix
      Integration over a reference element; element vector
      Tedious calculations! Let's use symbolic software
Implementation
      Compute finite element basis functions in the reference element
      Compute the element matrix
      Example on symbolic vs numeric element matrix
      Compute the element vector
      Fallback on numerical integration if symbolic integration fails
      Linear system assembly and solution
      Linear system solution
      Example on computing symbolic approximations
      Example on computing numerical approximations
      The structure of the coefficient matrix
      General result: the coefficient matrix is sparse
      Exemplifying the sparsity for P2 elements
      Matrix sparsity pattern for regular/random numbering of P1 elements
      Matrix sparsity pattern for regular/random numbering of P3 elements
      Sparse matrix storage and solution
      Approximate \( f\sim x^9 \) by various elements; code
      Approximate \( f\sim x^9 \) by various elements; plot
Comparison of finite element and finite difference approximation
      Interpolation/collocation with finite elements
      Galerkin/project and least squares vs collocation/interpolation or finite differences
      Expressing the left-hand side in finite difference operator notation
      Treating the right-hand side; Trapezoidal rule
      Treating the right-hand side; Simpson's rule
      Finite element approximation vs finite differences
      Making finite elements behave as finite differences
Limitations of the nodes and element concepts
A generalized element concept
      The concept of a finite element
      Implementation; basic data structures
      Implementation; example with P2 elements
      Implementation; example with P0 elements
      Example on doing the algorithmic steps
      Approximating a parabola by P0 elements
      Computing the error of the approximation; principles
      Computing the error of the approximation; details
      How does the error depend on \( h \) and \( d \)?
      Cubic Hermite polynomials; definition
      Cubic Hermite polynomials; derivation
      Cubic Hermite polynomials; result
Numerical integration
      The Midpoint rule
      Newton-Cotes rules
      Gauss-Legendre rules with optimized points
Approximation of functions in 2D
      2D basis functions as tensor products of 1D functions
      Tensor products
      Double or single index?
      Example on 2D (bilinear) basis functions; formulas
      Example on 2D (bilinear) basis functions; plot
      Implementation; principal changes to the 1D code
      Implementation; 2D integration
      Implementation; 2D basis functions
      Implementation; application
      Implementation; trying a perfect expansion
      Generalization to 3D
Finite elements in 2D and 3D
      Examples on cell types
      Rectangular domain with 2D P1 elements
      Deformed geometry with 2D P1 elements
      Rectangular domain with 2D Q1 elements
      Basis functions over triangles in the physical domain
      Basic features of 2D P1 elements
      Linear mapping of reference element onto general triangular cell
      \( \basphi_i \): pyramid shape, composed of planes
      Element matrices and vectors
      Basis functions over triangles in the reference cell
      2D P1, P2, P3, P4, P5, and P6 elements
      P1 elements in 1D, 2D, and 3D
      P2 elements in 1D, 2D, and 3D
      Affine mapping of the reference cell; formula
      Affine mapping of the reference cell; figure
      Isoparametric mapping of the reference cell
      Computing integrals
      Remark on going from 1D to 2D/3D
Differential equation models
      Abstract differential equation
      Abstract boundary conditions
      Reminder about notation
      New topics
      Residual-minimizing principles
      The least squares method
      The Galerkin method
      The Method of Weighted Residuals
      Terminology: test and trial Functions
      The collocation method
Examples on using the principles
      The first model problem
      Boundary conditions
      The least squares method; principle
      The least squares method; equation system
      Orthogonality of the basis functions gives diagonal matrix
      Least squares method; solution
      The Galerkin method; principle
      The Galerkin method; solution
      The collocation method
      Comparison of the methods
Useful techniques
      Integration by parts
      Boundary function; principles
      Boundary function; example (1)
      Boundary function; example (2)
      Impact of the boundary function on the space where we seek the solution
      Abstract notation for variational formulations
      Example on abstract notation
      Bilinear and linear forms
      The linear system associated with abstract form
      Equivalence with minimization problem
Examples on variational formulations
      Variable coefficient; problem
      Variable coefficient; variational formulation (1)
      Variable coefficient; variational formulation (2)
      Variable coefficient; linear system (the easy way)
      Variable coefficient; linear system (full derivation)
      First-order derivative in the equation and boundary condition; problem
      First-order derivative in the equation and boundary condition; details
      First-order derivative in the equation and boundary condition; observations
      First-order derivative in the equation and boundary condition; abstract notation
      First-order derivative in the equation and boundary condition; linear system
      Terminology: natural and essential boundary conditions
      Nonlinear coefficient; problem
      Nonlinear coefficient; variational formulation
      Nonlinear coefficient; where does the nonlinearity cause challenges?
      Computing with Dirichlet and Neumann conditions; problem
      Computing with Dirichlet and Neumann conditions; details
      When the numerical method is exact
Computing with finite elements
      Variational formulation, finite element mesh, and basis
      Computation in the global physical domain; formulas
      Computation in the global physical domain; details
      Computation in the global physical domain; linear system
      Comparison with a finite difference discretization
      Cellwise computations; formulas
      Cellwise computations; details
      Cellwise computations; details of boundary cells
      Cellwise computations; assembly
      General construction of a boundary function
      Example with two Dirichlet values; variational formulation
      Example with two Dirichlet values; boundary function
      Example with two Dirichlet values; details
      Example with two Dirichlet values; cellwise computations
      Modification of the linear system; ideas
      Modification of the linear system; original system
      Modification of the linear system; row replacement
      Modification of the linear system; element matrix/vector
      Symmetric modification of the linear system; algorithm
      Symmetric modification of the linear system; example
      Symmetric modification of the linear system; element level
      Boundary conditions: specified derivative
      The variational formulation
      Method 1: Boundary function and exclusion of Dirichlet degrees of freedom
      Method 2: Use all \( \basphi_i \) and insert the Dirichlet condition in the linear system
      How the Neumann condition impacts the element matrix and vector
The finite element algorithm
      Python pseudo code; the element matrix and vector
      Python pseudo code; boundary conditions and assembly
Variational formulations in 2D and 3D
      Integration by parts
      Example on integration by parts; problem
      Example on integration by parts; details (1)
      Example on integration by parts; details (2)
      Example on integration by parts; linear system
      Transformation to a reference cell in 2D/3D (1)
      Transformation to a reference cell in 2D/3D (2)
      Numerical integration
Time-dependent problems
      Example: diffusion problem
      A Forward Euler scheme; ideas
      A Forward Euler scheme; stages in the discretization
      A Forward Euler scheme; weighted residual (or Galerkin) principle
      A Forward Euler scheme; integration by parts
      New notation for the solution at the most recent time levels
      Deriving the linear systems
      Structure of the linear systems
      Computational algorithm
      Comparing P1 elements with the finite difference method; ideas
      Comparing P1 elements with the finite difference method; results
      Discretization in time by a Backward Euler scheme
      The variational form of the time-discrete problem
      Calculations with P1 elements in 1D
Dirichlet boundary conditions
      Boundary function
      Finite element basis functions
      Modification of the linear system; the raw system
      Modification of the linear system; setting Dirichlet conditions
      Modification of the linear system; Backward Euler example
Analysis of the discrete equations
      Handy formulas
      Amplification factor for the Forward Euler method; results
      Amplification factor for the Backward Euler method; results
      Amplification factors for smaller time steps; Forward Euler
      Amplification factors for smaller time steps; Backward Euler

previous next