# (Lack of) Availability of Finite-Difference library for simple 2D PDEs

I would like to solve two types of simple 2D problems, namely the stationary heat equation on an L shaped geometry like this: And also compute the magnetostactic field in an air gap of the following geometry: Since it wouldn’t be smart to reinvent the wheel, I searched for an open-source library that could handle such problems. At far as I could tell, neither in Python, Octave, Scilab or R there is a Finite-Difference (FD) library that could handle this type of geometries, which is not rectangular but should nonetheless fit on a rectangular grid (if I remember correctly from reading from “Heat Transfer” from Incropera, internal and external nodes can be handled by FD)

This lack of availability strikes me as odd; Python, Octave, Scilab and R all of them have built-in libraries for solution of ODEs, but why not FD for PDEs? Was it concluded that focusing on Finite-Element (FE) would be enough/better? I would like to stay with FD for two reasons: simplicity and I would like in the future to solve other types of PDEs, which may not be available on a FE solver.

Would it make sense to think of developing such a library? Are the limitations of FD (to simple geometries) not worth the effort?

• In a sense an ODE package is a tool for solving PDEs, you just need to provide a grid and spatial discretization of your PDEs, and use the method of lines – Maxim Umansky Oct 14 at 17:59
• I would like to solve boundarz value problems, so no time dependency, as far as I know, MOL is only for time-dependent PDEs – Ken Grimes Oct 14 at 18:03
• In principle you can solve boundary problems with MOL by relaxation, using artificial time. – Maxim Umansky Oct 14 at 18:23
• I found a library called findiff in like 2 seconds, how much redearch have you done? – Emil Oct 15 at 5:54
• Ok perhaps one would have to implement the grid oneself, but the stencils are readily available at least. – Emil Oct 15 at 6:06