The singularity seems to be not properly processed in FEniCS.
Let us try the integral : Integral[ 1/Sqrt[x x+y y], {x,0,1},{y,0,1}] = 1.76275
Below is the dolfin code:
local_mesh = UnitSquareMesh(10,10)
singular_f1 = Expression("1/sqrt(x[0]*x[0]+x[1]*x[1])", degree = 8)
print( assemble( singular_f1*dx(local_mesh)) )
singular_f2 = Expression("sqrt(x[0]*x[0]+x[1]*x[1])", degree = 8)
print( assemble( Constant(1.0)/singular_f2*dx(local_mesh)) )
The first way to do integral gives: nan
The second way gives raw result: 1.75835412.
Is there any idea to the integrally correctly.
Update: The problem comes to me when I want to define an extended FEM with a base function of singularity. For example, for the Poisson equation over an L-shaped domain. The domain has re-entry corner at (0,0).
V = {CG FEM} + { phi }
phi = r^{2/3} sin(2/3 \theta) * CuttingFunction