# Divergence of inverse square

Hello,

I tried to calculate the divergence of 1/r^2e_r, but I got zero, where it should have been 4pidirac_delta(re_r)

E.<r,th,ph>=EuclideanSpace(coordinates="spherical")
v=E.vector_field([1/r^2,0,0])
v.div().display()


Results is

E^3 --> R
(r, th, ph) |--> 0


Can this be considered as a bug?

edit retag close merge delete

Sort by » oldest newest most voted

In the current implementation, vector fields are assumed to be smooth functions on their domain. The vector field that you have defined is not (actually, it is not even defined at $r=0$), so I would say this is not a bug.

more

It would have been great, if it had given the dirac solution.

( 2021-02-08 14:54:22 +0200 )edit