I'd like to extract the residual_form and Jacobian_form from a NonlinearVariationalProblem, for use in another solver:
p = NonlinearVariationalProblem(F,u,bc, J)
print p.residual_form()
p2 = NonlinearVariationalProblem(p.residual_form(),p.solution(),p.bcs(), p.jacobian_form)
When I try this, I get an error:
*** Error: Unable to creating dolfin.Form.
*** Reason: Expected a ufl.Form..
*** Where: This error was encountered inside form.py.
The print statement returns that the residual_form() is of type: dolfin.cpp.fem.Form . How can I convert the cpp Form to a UFL form so that the NonlinearVariationalProblem will work?
Thanks!