Wow is PETSc SNES powerful! I would really love to be able to tweak the nonlinear solver and krylov method in a complicated system I have, but I can't seem to get the PETScSNESSolver to work. If you have used this solver can you please correct my script below?
from dolfin import *
mesh = UnitSquareMesh(2,2)
V = FunctionSpace(mesh, "CG", 1)
u = Function(V)
v = TestFunction(V)
f = u**2*v*dx
nlproblem = NonlinearVariationalProblem(f, u)
solver = PETScSNESSolver("newtonls")
solver.solve(nlproblem, u.vector())
When I run this I get
TypeError: in method 'PETScSNESSolver_solve', argument 2 of type
'dolfin::NonlinearProblem &'
It looks to me like PETScSNESSolver.solve() wants an object of type NonlinearProblem, which is a base class without info, but rejects the object of type NonlinearVariationalProblem, which seems to be a subclass of NonlinearProblem.