Re: [firedrake] Error - NonlinearVariationalSolver
On 10 Nov 2014, at 18:37, Lawrence Mitchell <lawrence.mitchell@imperial.ac.uk> wrote:
Dear Anna,
On 10 Nov 2014, at 18:13, Anna Kalogirou <a.kalogirou@leeds.ac.uk> wrote:
Dear all,
I wrote the attached simple code to solve a shallow water problem with a nonlinear solver, but I get the following error (note that the linear problem works fine). Can someone help me and see what I am doing wrong? Thanks you very much!
Your residual Fphi is written in terms of phi, however in your nonlinear problem, you ask to linearise around phi1.
Fphi = (gamma*phi + 0.5*mu*inner(grad(gamma),grad(phi)) - (gamma*phi0 + 0.5*mu*inner(grad(gamma),grad(phi0)) + dt*gamma*eta0))*dx phi_problem = NonlinearVariationalProblem(Fphi,phi1)
I think you probably want:
phi_problem = NonlinearVariationalProblem(Fphi, phi)
Note that, compared to the LinearVariationalProblem, where the solution is placed in a separate output Function, for the nonlinear problem, the solution variable must be the Function you want to solve for in the residual.
I think there are similar changes required for the eta and laplace solvers.
Cheers,
Lawrence
participants (1)
-
Lawrence Mitchell