Skip to main content

Module finite_elements

Module finite_elements 

Source
Expand description

Finite element methods with linear (P1) elements.

  • fem_1d: the two-point problem −(p u')' + q u = f on a mesh of [a, b] with Dirichlet or natural (flux) end conditions, by Galerkin assembly with two-point Gauss quadrature.
  • fem_poisson_2d: −∇·(k ∇u) = f on a triangle mesh with Dirichlet data on chosen nodes, assembled into a sparse matrix and solved by Jacobi-preconditioned conjugate gradients. TriangleMesh::rectangle builds a structured mesh of a rectangle.

Linear elements converge at second order in the L² and nodal errors and first order in the energy norm.

See the book entry Finite element methods.

Structs§

TriangleMesh
A triangle mesh: node coordinates and counter-clockwise (or any consistent) node triples.

Enums§

EndCondition
An end condition for fem_1d.

Functions§

fem_1d
Solves −(p u')' + q u = f on the increasing nodes, returning u at the nodes.
fem_poisson_2d
Solves −∇·(k ∇u) = f on the mesh with u = g at dirichlet_nodes (natural zero-flux conditions elsewhere), returning u at every node.