zwicker-group / py-pde

Python package for solving partial differential equations using finite differences.

Home Page:https://py-pde.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

3-dimensional Laplace matrix not implemented

parsarahimi opened this issue · comments

The simple example below gives an error for 3-dimensional Laplace matrix not implemented
I took a look at the documentation and seems like there is a numba version of the 3D Laplace but couldn't figure out how to set that up.

from pde import CartesianGrid, solve_laplace_equation

grid = CartesianGrid([[0, 2 * np.pi]] * 3, 64)
bcs = [[{"value": "0"},{"value": "2"}], [{"value": "0"},{"value": "1"}], [{"value": 0},{"value": "1"}]]
field = pde.ScalarField(grid)
res = solve_laplace_equation(grid, bcs)
plt.plot(res[:,:,0])

Yes, solving Laplace's equation is not a core task of the package. One could quite easily add the definition for the 3d laplacian, but I'm afraid the solution would not be very efficient.