2025 Week 11 - The Finite Element Method
Overview
Finite element methods approximate a differential-equation solution with shape functions over a mesh, then determine their weights through the Galerkin method and minimum weighted residuals. The lecture connects Gaussian quadrature and weak-form integration by parts to practical FEM features: flexible meshes and boundary physics, sparse mass and stiffness matrices, and linear or Newton-based nonlinear solves.
Key takeaways
- FEM's weak form replaces second derivatives in diffusion equations with products of first derivatives, allowing piecewise-linear elements whose second derivatives are undefined at element boundaries.
- Galerkin FEM chooses test functions from the same shape-function family as the approximate solution, making the residual orthogonal to that approximation space and yielding the best fit within it.
- Compact support makes most interactions between distant shape functions zero, producing sparse global matrices that can be solved efficiently even though matrix assembly itself may be a major computational cost.
- Gaussian quadrature turns element integrals into evaluations at a few mapped Gauss points; a two-point rule integrates polynomials through cubic order exactly.
- The weak form incorporates Neumann fluxes directly as boundary integrals, while Dirichlet values are typically enforced by setting boundary degrees of freedom.
- Temperature-dependent conductivity makes the assembled system nonlinear; Newton-Raphson or another root finder is needed rather than simply solving once with a changing coefficient.
Chapters
- Finite differences approximate derivatives at discrete points, while finite volume focuses on integral flux balances.
- FEM prioritizes integral properties, which can smooth approximation errors rather than amplifying them through derivatives.
- Piecewise FEM solutions may have discontinuous slopes or undefined second derivatives while still satisfying a mathematically robust weak formulation.
- Triangles can approximate complex boundaries by subdivision, and FEM supports irregular meshes and varying material properties.
- H-refinement reduces element size where gradients are large; adaptive remeshing can solve, locate steep gradients, refine, and solve again.
- Local refinement can focus computational effort, such as resolving thermal shock near car brakes without uniformly refining the entire model.
- FEM can represent physics on a two-dimensional surface embedded in three dimensions, avoiding unnecessary bulk meshing.
- The skin effect confines AC current near a conductor's surface, making surface-focused electromagnetic models useful.
- Surface-flow or car-body calculations can concentrate resolution near the object boundary instead of meshing inactive regions of surrounding air.
- For the model y' = -y with y(0) = 1, a straight-line approximation over 0 to 1 cannot reproduce the exact exponential decay.
- Writing the approximation as a line with endpoint weight B gives one adjustable degree of freedom.
- Substituting the line into the differential equation at a single point determines B, but produces a visibly poor fit.
- The residual for y' = -y can be written R = y' + y, and the approximation can be improved by minimizing its squared error.
- Integrating R² over the interval measures error across the domain rather than matching the equation at only one location.
- Differentiating the resulting error with respect to B and setting it to zero produces a better line, though symbolic integration becomes cumbersome for larger problems.
- The method of weighted residuals seeks weights that satisfy an integral condition of the form ∫ R V dx = 0.
- Choosing V as a derivative of the residual recovers the squared-residual minimization approach.
- Other test functions, such as V = x, can give useful approximations without directly minimizing the full squared residual.
- Gaussian quadrature evaluates an integrand at selected Gauss points instead of requiring symbolic integration.
- A two-point Gauss rule integrates polynomials through cubic order exactly, with errors beginning at fourth order.
- Mapping an element's coordinates to a standard interval lets software apply the same quadrature algorithm across differently sized elements.
- FEM represents an approximate solution as a weighted sum of basis or shape functions, with the weights serving as degrees of freedom.
- Selecting a test function determines how residual error is measured; delta-function tests recover collocation at selected points.
- The resulting equations for multiple weights form a linear system that can be solved with standard linear algebra methods.
- The Galerkin method uses the same shape functions for test functions as for the approximate solution.
- The condition ∫ R V dx = 0 makes the residual orthogonal to the selected approximation space.
- Orthogonality means the chosen weights are as good as possible within that finite shape-function space, not that the differential equation is satisfied pointwise.
- A mesh breaks the domain into finite elements: intervals in 1D, triangles in 2D, and corresponding higher-dimensional shapes.
- Triangles readily fit irregular boundaries; quadrilaterals can offer stability advantages but become difficult to map near points or degenerate shapes.
- CFD meshes may combine boundary-layer quadrilaterals with triangles, while some applications use extruded hexagonal prisms.
- An element specifies the function fitted over a mesh region, such as a constant, line, quadratic, or higher-order polynomial.
- Degrees of freedom may represent nodal values, derivatives, or interior values, allowing element design to suit particular physics.
- Sharing a function-value degree of freedom across elements enforces function continuity; sharing a gradient can instead enforce derivative continuity.
- Lagrange interpolation functions place degrees of freedom at mesh nodes and interpolate between their values.
- Each nodal shape function equals one at its associated node and zero at the other nodes, making its weight directly correspond to a nodal value.
- The lecture identifies second-order Lagrange elements as the default used in COMSOL.
- Order-zero elements use one constant value per element and have no continuity between neighboring elements.
- Order-one elements connect endpoint values with a straight line; order-two elements add a midpoint degree of freedom for a quadratic.
- Higher-order Lagrange elements add nodes and polynomial flexibility while retaining the one-at-its-node, zero-at-other-nodes property.
- Shared nodal values generally make the approximate function continuous across elements, but do not guarantee a continuous gradient.
- Discontinuous Lagrange elements allow jumps between neighboring elements and can damp noise in advection problems with sharp gradients.
- Discontinuous formulations typically increase the number of degrees of freedom because neighboring elements no longer share them.
- Order-one Lagrange shape functions form tent-like, piecewise-linear basis functions centered on mesh nodes.
- Summing weighted tents reconstructs a piecewise-linear approximation of the target function.
- Uneven node spacing concentrates resolution in regions of curvature while retaining larger elements in smoother regions.
- Higher-dimensional Lagrange elements extend nodal interpolation to triangles and three-dimensional elements.
- The Periodic Table of Finite Elements catalogs specialized element families, including choices suited to vector fields and curl-related electromagnetics.
- FEniCS and Firedrake provide research-oriented flexibility, while COMSOL is presented as an industrial multiphysics tool.
- One route toward the exact solution is making the mesh elements arbitrarily small.
- A second route is raising the polynomial degree of each element without changing the mesh.
- Finite polynomial order introduces truncation error, analogous to truncating a Taylor expansion.
- The strong heat equation expresses temperature change through the divergence of heat flux.
- Multiplying the equation by a test function V and integrating over the domain creates a weighted residual statement.
- Writing the time derivative with backward Euler gives a time-discrete starting point for the weak formulation.
- Integration by parts transfers a spatial derivative from the unknown temperature field to the test function.
- The divergence theorem converts the resulting volume divergence into a surface integral of normal flux.
- This transformation separates an interior-domain contribution from an explicit boundary-flux contribution.
- A strong diffusion equation can contain second spatial derivatives, but the weak form requires only first derivatives of temperature and the test function.
- Piecewise-linear functions can have undefined second derivatives at element boundaries, yet remain usable in the weak form.
- Moving derivatives also avoids differentiating a temperature-dependent conductivity inside the divergence as required by a direct strong-form expansion.
- The weak form includes Neumann boundary data, such as prescribed normal heat flux, as a surface-integral term.
- Dirichlet conditions such as a prescribed boundary temperature are commonly imposed by replacing the corresponding solution-vector values.
- Boundary integrals also allow physics to differ between a material's surface and bulk, as in surface absorption, antenna design, or skin-effect models.
- The derivation multiplies the heat equation by V, integrates over the domain, and applies integration by parts to the flux-divergence term.
- Substituting heat flux as conductivity times the temperature gradient yields a volume term involving the gradients of temperature and V.
- Additional source terms pass through the derivation, while the boundary-flux term makes the boundary condition explicit in the resulting equation.
- The approximate field is expanded as uₕ = Σ wᵢφᵢ, where φᵢ are element shape functions and wᵢ are unknown weights.
- The Galerkin choice expands the test function in the same shape-function family.
- Backward Euler turns the time derivative into a contribution involving the current and previous time-step solution vectors.
- A shape function is nonzero only on its assigned element or neighboring elements, a property called compact support.
- Integrals involving shape functions with nonoverlapping support vanish, so most matrix entries are zero.
- Assembling these local contributions into a global system can take a substantial share of runtime, despite the resulting sparsity.
- Gaussian quadrature evaluates shape-function products at Gauss points after mapping each element to a standard reference shape.
- Integrating products of shape functions builds the mass matrix; integrating their gradients with conductivity builds the stiffness matrix.
- A two-point Gauss rule exactly integrates polynomial products through cubic order, supporting efficient low-order element calculations.
- Local element matrices are added into shared global entries wherever elements share nodes.
- The assembled backward-Euler heat equation takes the form Ax = b, with the current temperature vector as x and the previous time step contributing to b.
- Neumann fluxes enter the right-hand side, while Dirichlet values are imposed by setting the corresponding solution degrees of freedom.
- For conductivity such as λ = 1 + u/10, the system becomes nonlinear and requires a root-finding method such as Newton-Raphson.
- Mass and stiffness contributions can sometimes be reused when the time step and material properties remain fixed; changing conductivity or adaptive time steps can require reassembly.
- Compact support preserves sparsity; a 1D FEM system may look banded, while higher-dimensional meshes usually remain sparse without the same simple band structure.
- Numerical output, including results generated with AI assistance, still requires checking that nonlinear equations used an appropriate solver.
Transcript excerpt
0:00 Okay, finite element method. Um, we've been building towards finite element. Yeah, that's on that sharing. So, we've been building towards this thing for a while now. Um, I thought about trying to make an assignment on this, but honestly, it's it's a bit too complex. There are entire courses dedicated to the finite element method. So, it's going to be under the the general comprehension because most of you guys are are console familiar anyway. you may as well understand what on earth those what on earth those options are actually saying. Um but I don't have an assignment question on it and any questions would be strictly comprehension anyway. Um but considering that the popularity of it it's it's kind of good to I I can't let you guys leave numerical methods without at least
0:48 having some kind of understanding what finite element method is doing underneath. All right. FEM super popular for a wide range of applications. It's an integral technique similar to finite volume in that it doesn't it doesn't focus so much on the the continuity of the derivatives as it does on the the integral properties of the um of the equation. So, thank you for the loan. The finite difference, you have a bunch of those guys, right? And what you have to say is some kind of approximation. Okay, so you're doing central difference and then this this derivatives between that data between
1:36 those datas at those points satisfy some kind of equation. The alternate is something like finite volume. finite volume says no no no no just worry about the integral of all the fluxes around the boundary and that's kind of the quantity of interest and the nice thing about that is it has different stability properties. It's not so concerned about
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Numerical Methods for Engineering.