Re: [firedrake] Error - NonlinearVariationalSolver
Failed with sending to the list, so copying below. Lawrence On 10 Nov 2014, at 19:02, Lawrence Mitchell <lawrence.mitchell@imperial.ac.uk> wrote:
On 10 Nov 2014, at 18:48, Anna Kalogirou <a.kalogirou@leeds.ac.uk> wrote:
Dear Lawrence,
Thank you very much for the reply. Very useful. It now gives the error:
====================== Traceback (most recent call last): File "nonlinear_swe.py", line 73, in <module> phi_solver.solve() File "<string>", line 2, in solve File "/opt/firedrake/2.0/lib/python2.7/site-packages/PyOP2-0.11.0_117_gcfe592d-py2.7-linux-x86_64.egg/pyop2/profiling.py", line 197, in wrapper return f(*args, **kwargs) File "/opt/firedrake/2.0/lib/python2.7/site-packages/firedrake/solving.py", line 336, in solve %s""" % (self.snes.getIterationNumber(), msg)) RuntimeError: Nonlinear solve failed to converge after 0 nonlinear iterations. Reason: DIVERGED_LINE_SEARCH ======================
Do you have any idea what that might be? Do I need do give any arguments in the phi_solver.solve()?
So this tells me that the nonlinear solver (line search newton) failed because the line search failed. You can try running with
solver_parameters={'snes_monitor': True, 'ksp_monitor': True, 'snes_linesearch_monitor': True}
(add this as an argument to the construction of the nonlinearvariationalsolver)
to see what's going on.
If I make what I /think/ are the correct changes to your initial script, I see that the phi solver has the same diverged line search. This looks to be because at the second time step, the residual is already 1e-14 before we start. But I don't know if that's expected, or if I changed bits correctly.
Lawrence
Hi Lawrence, Does it matter that I am solving a linear problem with the nonlinear solver? I am just trying to reproduce the linear one that works first, before introducing the nonlinear terms. I tried also adding the parameter {'snes_type': 'ksponly'} and the code works, but the result is not as good. Do you have any idea what might be happening? P.S. The linear code can be found attached. Best, Anna. On 10/11/14 19:07, Lawrence Mitchell wrote:
Failed with sending to the list, so copying below.
Lawrence On 10 Nov 2014, at 19:02, Lawrence Mitchell <lawrence.mitchell@imperial.ac.uk> wrote:
On 10 Nov 2014, at 18:48, Anna Kalogirou <a.kalogirou@leeds.ac.uk> wrote:
Dear Lawrence,
Thank you very much for the reply. Very useful. It now gives the error:
====================== Traceback (most recent call last): File "nonlinear_swe.py", line 73, in <module> phi_solver.solve() File "<string>", line 2, in solve File "/opt/firedrake/2.0/lib/python2.7/site-packages/PyOP2-0.11.0_117_gcfe592d-py2.7-linux-x86_64.egg/pyop2/profiling.py", line 197, in wrapper return f(*args, **kwargs) File "/opt/firedrake/2.0/lib/python2.7/site-packages/firedrake/solving.py", line 336, in solve %s""" % (self.snes.getIterationNumber(), msg)) RuntimeError: Nonlinear solve failed to converge after 0 nonlinear iterations. Reason: DIVERGED_LINE_SEARCH ======================
Do you have any idea what that might be? Do I need do give any arguments in the phi_solver.solve()?
So this tells me that the nonlinear solver (line search newton) failed because the line search failed. You can try running with
solver_parameters={'snes_monitor': True, 'ksp_monitor': True, 'snes_linesearch_monitor': True}
(add this as an argument to the construction of the nonlinearvariationalsolver)
to see what's going on.
If I make what I /think/ are the correct changes to your initial script, I see that the phi solver has the same diverged line search. This looks to be because at the second time step, the residual is already 1e-14 before we start. But I don't know if that's expected, or if I changed bits correctly.
Lawrence
-- Dr Anna Kalogirou Research Fellow School of Mathematics University of Leeds
Hi Anna, On 10 Nov 2014, at 19:39, Anna Kalogirou <a.kalogirou@leeds.ac.uk> wrote:
Hi Lawrence,
Does it matter that I am solving a linear problem with the nonlinear solver? I am just trying to reproduce the linear one that works first, before introducing the nonlinear terms. I tried also adding the parameter {'snes_type': 'ksponly'} and the code works, but the result is not as good.
Do you have any idea what might be happening?
P.S. The linear code can be found attached.
Thanks, I think I have found the problem, it is not in your code. The problem appears to be a subtle issue in which we interact with PETSc, which means that it is not computing the initial residual correctly. I will prepare a fix tomorrow and let you know when things are fixed. Cheers, Lawrence
Hi Anna, On 10/11/14 20:25, Lawrence Mitchell wrote:
Hi Anna,
On 10 Nov 2014, at 19:39, Anna Kalogirou <a.kalogirou@leeds.ac.uk> wrote:
Hi Lawrence,
Does it matter that I am solving a linear problem with the nonlinear solver? I am just trying to reproduce the linear one that works first, before introducing the nonlinear terms. I tried also adding the parameter {'snes_type': 'ksponly'} and the code works, but the result is not as good.
Do you have any idea what might be happening?
P.S. The linear code can be found attached.
Thanks, I think I have found the problem, it is not in your code. The problem appears to be a subtle issue in which we interact with PETSc, which means that it is not computing the initial residual correctly. I will prepare a fix tomorrow and let you know when things are fixed.
I've now fixed the problem. If you reinstall PyOP2 (I guess with pip, if you followed the website instructions) your nonlinear problem should now run fine. Let us know if you have any problems. Cheers, Lawrence
Hello, Can someone of you please check the way I use NonlinearVariationalSolver in the code attached? The code runs but the result is a bit odd. In addition, in the screen it writes pyop2:INFO Solving linear variational problem... and I am suspecting it might be solving the corresponding linear problem instead of the nonlinear one. Thank you very much. Best, Anna. On 11/11/14 12:31, Lawrence Mitchell wrote:
Hi Anna,
On 10/11/14 20:25, Lawrence Mitchell wrote:
Hi Anna,
On 10 Nov 2014, at 19:39, Anna Kalogirou <a.kalogirou@leeds.ac.uk> wrote:
Hi Lawrence,
Does it matter that I am solving a linear problem with the nonlinear solver? I am just trying to reproduce the linear one that works first, before introducing the nonlinear terms. I tried also adding the parameter {'snes_type': 'ksponly'} and the code works, but the result is not as good.
Do you have any idea what might be happening?
P.S. The linear code can be found attached.
Thanks, I think I have found the problem, it is not in your code. The problem appears to be a subtle issue in which we interact with PETSc, which means that it is not computing the initial residual correctly. I will prepare a fix tomorrow and let you know when things are fixed. I've now fixed the problem. If you reinstall PyOP2 (I guess with pip, if you followed the website instructions) your nonlinear problem should now run fine.
Let us know if you have any problems.
Cheers,
Lawrence
-- Dr Anna Kalogirou Research Fellow School of Mathematics University of Leeds
participants (2)
- 
                
                Anna Kalogirou
- 
                
                Lawrence Mitchell