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

Nonlinearvariationalsolver not converge

0 votes

I tried to sover the next nonlinear partial diferential equation with fenics

$\psi + c_0 \nu \|\nabla \psi\| = \psi_0$

bc = DirichletBC(V, psi0, psi0_boundary)      

psi, v = (Function(V), TestFunction(V))
a = psi*v*dx + dt*nu*dot(grad(psi),grad(psi))**(1./2)*v*dx 
L = psik*v*dx
F = a - L   
J = derivative(F, psi) 
pde = NonlinearVariationalProblem(F, psi, bc, J)
solver = NonlinearVariationalSolver(pde)
solver.solve()

but I get the next message:

*** Error: Unable to solve nonlinear system with NewtonSolver.
*** Reason: Newton solver did not converge. Bummer.
*** Where: This error was encountered inside NewtonSolver.cpp.
*** Process: 0

What is the problem?

asked Aug 29, 2013 by ljofre FEniCS Novice (720 points)
edited Aug 29, 2013 by ljofre

You need to post complete code that runs.

1 Answer

+2 votes

Consider that Jacobian of the term $\int |\nabla\psi| \, v \,\mathrm{d}x$ is

$$
\int \frac{\nabla\psi}{|\nabla\psi|}\cdot\nabla\xi \, v \,\mathrm{d}x .
$$

Setting $\psi$ being non-constant everywhere prior to Newton iteration may help.

Alternatively you may try to supply your own Jacobian which will somewhat regularize the problem and keep converging it.

answered Aug 29, 2013 by Jan Blechta FEniCS Expert (51,420 points)
edited Aug 29, 2013 by Jan Blechta

How I can to set my own Jacobian?

This is obvious, isn't it? You did

J = derivative(F, psi) 
pde = NonlinearVariationalProblem(F, psi, bc, J)

Just throw away derivative(F, psi) and supply some bilinear form J on $V \times V$.

...