Solving simple nonlinear problem fails

Issue #873 invalid
Nico Schlömer created an issue

The following tries to solve the nonlinear "problem" u**2 - 1.0 == 0 with FEniCS.

from dolfin import *

mesh = UnitSquareMesh(10, 10)
V = FunctionSpace(mesh, 'CG', 1)

v = TestFunction(V)

sol = Function(V)
F = (sol**2 - 1.0) * v * dx

solve(F == 0, sol)

For some reason, the iterates are flawed from step 1 on,

  Newton iteration 0: r (abs) = 9.501e-02 (tol = 1.000e-10) r (rel) = 1.000e+00 (tol = 1.000e-09)
  Newton iteration 1: r (abs) = inf (tol = 1.000e-10) r (rel) = inf (tol = 1.000e-09)

and of course Newton doesn't converge.

Comments (2)

  1. Log in to comment