# How to write a simple finite element solver in python in order to solve Poisson equation in 2D

I would like to write a simple finite element solver in python in order to solve 2D Poisson equation and then visualize it.

$$-\nabla^{2} u(x,y)=f(x,y), \quad x,y \quad in \quad \Omega\\ u(x,y) = u_D (x,y), \quad x,y \quad in \quad \partial \Omega$$

Why do I wanna do that? I would like to learn how write a simple finite element solver using python and since the Poisson equation is like the "hello world!" for the computational science I would like to work with it. I already had look at FEniCS, deal.II and some other solvers but as I mentioned I would like to write my own simple script.

Would you introduce any simple to understand source where I can learn how to solve and code this equation using finite element method?

• The Finite Element Method: ... by Larson and Bengzon, and Understanding and Implementing the Finite Element Method by Mark Gockenbach are good textbooks. Wolfgang Bangerth (regular contributor of scicomp.se and one of the developers of deal.ii) has an amazing series of lectures posted on his website (math.colostate.edu/%7Ebangerth/videos.html) and deal.ii website (dealii.org) Dec 4 '21 at 21:16
• Starting with a Laplace solver might be even simpler, see physics.stackexchange.com/a/363868/83380 and scicomp.stackexchange.com/a/30840/17869 for example
– uhoh
Dec 4 '21 at 21:33