Regrading the use of action()

Hello everyone,

I am trying to use the action() for the NonlinearVariationalSolver() in FEniCS as shown below:

problem_u = NonlinearVariationalProblem(E_u, u, bc_disp, Jd)
solver_u = NonlinearVariationalSolver(problem_u)
residual = action(solver_u,u)

But I am getting the following error,

Unable to convert object to a UFL form: <dolfin.cpp.fem.NonlinearVariationalSolver object at 0x7f35615b9770>

Is there any method to make this working?
Please help to fix the issue.

Thank you,
Manish

ufl.action should be used on the variational forms, such as E_u. Note that E_u is already the residual, and you don’t need to use an action to get it (not sure how you define your residual).

Thanks. I am able to solve the problem with your help.