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

NonlinearVariationalProblem not working?

0 votes

I have been looking at the example problem vp1_np.py. I wanted to tweak the initial condition a little, so I inserted this line of code just before the "problem = ..." line:
u_ = interpolate(Constant(0.0),V)
Then I called the program with the command
python vp1_np.py m l 1 10 5
The consequence was that it claimed convergence in 1 iteration (not 5 as the unchanged file yields), and the answer was substantially different from the exact solution. I observed "convergence" in 1 iteration also if I used
u_ = interpolate(Constant(10.0),V)
again to the wrong solution.
I am using version 1.3 from the repositories on Ubuntu 13.10.
What am I doing wrong?

asked May 17, 2014 by mike125 FEniCS Novice (670 points)

Please format the code correctly and provide a complete code example or a link where your Python script can be found.

The script in question is vp1_np.py, contained among the tutorial examples. http://fenicsproject.org/_static/tutorial/fenics_tutorial_examples.tar.gz
more precisely, it is examples-1.0/stationary/nonlinear_poisson/vp1_np.py in that tar file.
The documentation for that example is presented in the FEniCS book and on the web.

The tutorial code works fine with no changes, amounting to an initial guess of zero, but I want to put in an initial guess of my own. To do so, I made just one line change described originally, and the code stopped working.

...