Poisson 1d Example

Every FEM has a very basic structure. We need the following parts:

  • Mesh
  • Finite Element
  • The Variational Form
  • Assembly process
  • Linear solver

The Mesh

Ultimately we will want a mesh to give us elements with some information about those elements for assembling the matrix equations. Some information about each element that we will want from our mesh might be:

  • Points of convex hull
  • Orientation of the element
  • Nodes of the element that lie on the Boundary
  • Any additional information to link two elements together

Once we have solved the matrix equations, we will then be able to associate the point of $u$ with the nodes in the mesh to visualize the answer.

Since we are doing a one dimensional problem, the mesh is trivial. For our purposes it will be a list of nodes, each element will the the interval between two consecutive nodes in the list, this is the convex hull for a 1D element. For example in Python, for a uniform mesh with $2^n$ elements we can do:

mesh = [ i * 2**-n for i in range(2**n + 1)]

The Finite Element and The Variational Form

There are many ways for inputing the finite element. In many software packages they differentiate between the finite element and the variational forms, and for good reasons but this 1D example is so small I have chosen to just put them here together.

[more content to come]

The Assembly

[more content to come]

Linear Solve

[more content to come]

Visualization

[more content to come]

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.