This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

integration about singularities

0 votes

When integrating the function $1/x$ over $[0,1]$, the exact analytic result is $+\infty$. With a discretized $\Omega_h$, I was expecting the same since the integral over the very first interval $[0,h]$ is already $+\infty$. However,

from dolfin import *
r = Expression('x[0]')
mesh = UnitIntervalMesh(160)
print(assemble(1.0/r * dx, mesh=mesh))

yields

7.038685468848289

and the value depends on the discretization. What is happening here exactly?

asked Feb 17, 2014 by nschloe FEniCS User (7,120 points)

1 Answer

0 votes

This depends on the quadrature. If the quadrature rule used to compute the integral does not 'see' the singularity, then you observe the effect that the evaluated integral depends on the discretization. You can test this in your example: With h approaching zero, the value of the approximated integral should (slowly) grow. Try the same with the expression "x[0]-.25" and a mesh with two intervals. This should evaluate to inf.

answered Feb 17, 2014 by Christian Waluga FEniCS Expert (12,310 points)
...