# Dealing with removable singularities in cylindrical coordinates

**URL:** <https://fenicsproject.discourse.group/t/dealing-with-removable-singularities-in-cylindrical-coordinates/144>\
**Category:** variational formulation\
**Created:** [February 6, 2019, 2:52pm UTC](https://fenicsproject.discourse.group/t/dealing-with-removable-singularities-in-cylindrical-coordinates/144 "2019-02-06T14:52:04Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![Xuefeng\_LIU](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/xuefeng_liu/32/660_2.png) [@Xuefeng\_LIU](https://fenicsproject.discourse.group/u/Xuefeng_LIU)\
**Post date:** [December 2, 2019, 2:23pm UTC](https://fenicsproject.discourse.group/t/dealing-with-removable-singularities-in-cylindrical-coordinates/144/10 "2019-12-02T14:23:48Z")

</div>

> [@volkerk](#):
>
> from dolfin import \* mesh = UnitSquareMesh(10,10) x = SpatialCoordinate(mesh) print(assemble(1/sqrt(x[0]\*x[0]+x[1]\*x[1]) \* dx, form\_compiler\_parameters={‘quadrature\_degree’: 100}))

Many thanks. I have found the another approach, which gives the same value as your proposed one.  
It seems that the integral is performed with the same quadrature using the value of 1/r over inertial point. But, it is obvious that if the integral is done under polar coordinate, then a better result can be obtained.

I am wondering that is it possible to let FEniCS perform the integral under polar coordinate?

> from dolfin import \*  
> mesh = UnitSquareMesh(10,10)  
> x = SpatialCoordinate(mesh)  
> print("Integral by spatial coordinate: ", assemble(1/sqrt(x[0]\*x[0]+x[1]\*x[1]) \* dx, form\_compiler\_parameters={‘quadrature\_degree’: 20}))
> 
> Q=FiniteElement(“Quadrature”,triangle,degree=20,quad\_scheme=‘default’)  
> sf = Expression("1/sqrt(x[0]\*x[0]+x[1]_x[1])", element=Q)  
> print("Integral by Quadrature element: ", assemble( sf_dx(mesh,degree=20)) )

---

_[View the full topic](https://fenicsproject.discourse.group/t/dealing-with-removable-singularities-in-cylindrical-coordinates/144)._
