How to write this weak form into UFL function

I am using fenics to solve 1D PDE problem with 3D vector value. I meet trouble when trying to change the weak form(including the norm of the derivative of TrialFunction) into UFL function.

mesh = IntervalMesh(50, 0, 10)
V = VectorFunctionSpace(mesh,‘CG’,degree=1,dim=3)
u = TrialFunction(V)
u_1, u_2, u_3 = split(u)
v_1, v_2, v_3 = TestFunction(V)

F = dt * norm(Dx(u,0)) * Dx(u_1,0) / norm(u) * Dx(v_1,0)*dx
+ dt * norm(Dx(u,0)) * Dx(u_2,0) / norm(u) * Dx(v_2,0)*dx
+ dt * norm(Dx(u,0)) * Dx(u_3,0) / norm(u) * Dx(v_3,0)*dx

a, L = lhs(F), rhs(F)

But it didn’t work, can anyone give me some suggestions? Thanks in advance.

Hi pusen, you are trying to solve a nonlinear problem, and thus you should use such interface. I would suggest you to look at the nonlinear poisson or hyperelasticity demos on the online documentation (e.g https://fenicsproject.org/docs/dolfin/2018.1.0/python/demos/nonlinear-poisson/demo_nonlinear-poisson.py.html). Hope it is useful.

Best regards

1 Like

Thank you for reply, I will check that