Solver error -- Provided residual is not a linear form
Following up on my previous email, I have found a workaround to those issues, but now I have a problem with the solvers: Traceback (most recent call last): File "/Users/matak/Downloads/Inequality-constraint-Rockafellar/solvers.py", line 32, in solver_F F_problem = NonlinearVariationalProblem(F_solve, w)#, aP=Ap) File "/Users/matak/firedrake/src/firedrake/firedrake/variational_solver.py", line 47, in __init__ raise ValueError("Provided residual is not a linear form") ValueError: Provided residual is not a linear form There two issues here: 1. I cannot give a preconditioning matrix aP -- is this not possible for nonlinear problems? 2. I suspect the error above is because I have functions that depend on the solution, and I don’t know if that is acceptable in firedrake. I have something like the following: u = Function(V) v = TestFunction(V) maximum = interpolate(0.5*(u + abs(u)), V) F = v*(u + maximum)*dx Best wishes, Anna.
On 14 May 2017, at 21:30, Anna Kalogirou <a.kalogirou@leeds.ac.uk> wrote:
Following up on my previous email, I have found a workaround to those issues, but now I have a problem with the solvers:
Traceback (most recent call last): File "/Users/matak/Downloads/Inequality-constraint-Rockafellar/solvers.py", line 32, in solver_F F_problem = NonlinearVariationalProblem(F_solve, w)#, aP=Ap) File "/Users/matak/firedrake/src/firedrake/firedrake/variational_solver.py", line 47, in __init__ raise ValueError("Provided residual is not a linear form") ValueError: Provided residual is not a linear form
This says that F_solve.arguments() is not of length 1. What is the definition of F_solve?
There two issues here: 1. I cannot give a preconditioning matrix aP -- is this not possible for nonlinear problems?
This is just bad inconsistencies between LinearVariationalProblem and NonlinearVariationalProblem. For the latter, pass Jp=..., not aP=... Do report a bug and we will decide on a consistent naming and fix it. Lawrence
participants (2)
-
Anna Kalogirou
-
Lawrence Mitchell