2.7. Spherically symmetric PDE

This example illustrates how to solve a PDE in a spherically symmetric geometry.

spherical grid
  0%|          | 0/0.1 [00:00<?, ?it/s]
Initializing:   0%|          | 0/0.1 [00:00<?, ?it/s]/home/docs/checkouts/readthedocs.org/user_builds/py-pde/checkouts/0.29.0/pde/grids/boundaries/local.py:1822: NumbaDeprecationWarning: The 'nopython' keyword argument was not supplied to the 'numba.jit' decorator. The implicit default value for this argument is currently False, but it will be changed to True in Numba 0.59.0. See https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit for details.
  def virtual_point(

  0%|          | 0/0.1 [00:02<?, ?it/s]
  7%|7         | 0.007/0.1 [00:02<00:32, 346.59s/it]
 36%|###5      | 0.036/0.1 [00:02<00:04, 67.41s/it]
 36%|###5      | 0.036/0.1 [00:02<00:04, 67.43s/it]
100%|##########| 0.1/0.1 [00:02<00:00, 24.28s/it]
100%|##########| 0.1/0.1 [00:02<00:00, 24.28s/it]

from pde import DiffusionPDE, ScalarField, SphericalSymGrid

grid = SphericalSymGrid(radius=[1, 5], shape=128)  # generate grid
state = ScalarField.random_uniform(grid)  # generate initial condition

eq = DiffusionPDE(0.1)  # define the PDE
result = eq.solve(state, t_range=0.1, dt=0.001)

result.plot(kind="image")

Total running time of the script: ( 0 minutes 2.637 seconds)