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

Poisson solver seems to be not implemented on the `pde.CylindricalSymGrid`

friederjohannsen opened this issue · comments

Solving the poisson equation on a CylindricalSymGrid seems to be not supported.
The following minimal example:

import pde
grid = pde.CylindricalSymGrid(32, (-16,16), (128, 128), periodic_z=False)
initial_state = pde.ScalarField.random_normal(grid, 0.1, 0.01)
psi = pde.solve_poisson_equation(initial_state-initial_state.average, bc='auto_periodic_neumann')

produces the following error message:

Traceback (most recent call last):
  File "/Users/frieder/git-repos/bachelorarbeit-code/localSimulations/minimalExample.py", line 4, in <module>
    psi = pde.solve_poisson_equation(initial_state-initial_state.average, bc='auto_periodic_neumann')
  File "/Users/frieder/anaconda3/envs/zwicker/lib/python3.10/site-packages/pde/pdes/laplace.py", line 57, in solve_poisson_equation
    operator = rhs.grid._get_operator_info("poisson_solver")
  File "/Users/frieder/anaconda3/envs/zwicker/lib/python3.10/site-packages/pde/grids/base.py", line 927, in _get_operator_info
    raise ValueError(
ValueError: 'poisson_solver' is not one of the defined operators (d2_dr2, d2_dz2, d_dr, d_dz, divergence, gradient, gradient_squared, laplace, tensor_divergence, vector_gradient, vector_laplace). Custom operators can be added using the `register_operator` method.

Closed by #456