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

How to get u_x ,u _y instead of nabla_grad(u)

+1 vote

I want only "u_x" or "u_y" instead of the vector "grad(u)" . Does someone know this ,thanks!

asked Nov 26, 2013 by HS.Sheng FEniCS Novice (570 points)

1 Answer

+3 votes
 
Best answer

Hi, you can use

du_dxi = Dx(u, i)
du_dxi = u.dx(i)
du_dxi = grad(u)[i]

to get the derivative of scalar function or expression with respect to x_i. There is more about the differential operators in the UFL manual here.

answered Nov 26, 2013 by MiroK FEniCS Expert (80,920 points)
selected Nov 26, 2013 by HS.Sheng

Thanks a lot ! :-)

...