[firedrake] Error - NonlinearVariationalSolver
Lawrence Mitchell
lawrence.mitchell at imperial.ac.uk
Mon Nov 10 18:45:46 GMT 2014
On 10 Nov 2014, at 18:37, Lawrence Mitchell <lawrence.mitchell at imperial.ac.uk> wrote:
> Dear Anna,
>
> On 10 Nov 2014, at 18:13, Anna Kalogirou <a.kalogirou at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mailman.ic.ac.uk/pipermail/firedrake/attachments/20141110/8b27e98b/attachment.sig>
More information about the firedrake
mailing list