Integral in one variable in an axisymmetric formulation

Hi there,

I’m solving an equation with an axisymmetric formulation. I obtain the solution u which depens on variables r and z. Now I use u as the rhs of another problem, which is in an axisymmetric setting too. The rhs f, of the second problem, is defined by f:= \dfrac{1}{r}\int_0^r u(t,z)\, t\,dt. How can I to implement this rhs in Fenics? i.e. the term \int f\,v\,dr\,dz

Thanks a lot for your help!!!

Rodolfo

Hi

You can define a variable like x after defining your mesh:

x = SpatialCoordinate(mesh)

Then the r and z variables could be defined with respect to x:

\displaystyle r=x[0]
\displaystyle z=x[1]

The components of u (Lets say u is displacement vector) in r and z directions could be written as:

\displaystyle u_r=u[0]
\displaystyle u_z=u[1]

Likewise, the derivatives of u_r and u_z could be written as:

\displaystyle\frac{\partial u_r}{\partial r}=u[0].dx(0)
\displaystyle\frac{\partial u_z}{\partial z}=u[1].dx(1)

I hope it was helpful.

Many thanks Leo!! but I don’t think that this helps me… if u is a displacement vector, to use your example, then u_r = u[0], as you pointed out. Note that still we have u_r = u_r(r,z)!. My problem it to calculate

\frac{1}{r}\int_0^r u_r(t,z) dt

i.e., integrating only over one variable. Of course this defines a function which depends on r and z. Remember that I know u_r because is the solution to a previos FEM problem…

Anyways, thanks to take time to consider my problem!!

Regards,

Rodolfo