Do you not get any PETSc output before that?

The KeyError is weird; according to http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/KSP/KSPConvergedReason.html, -11 is KSP_DIVERGED_PCSETUP_FAILED.

I don't use the preassembly syntax normally; does it work if you remove the lines assembling frm_tilde and rhs, and simply call

solve(a_tilde == L, w_sol, solver_parameters={...}) ?

On 29 March 2016 at 16:13, George Ovchinnikov <lives9@gmail.com> wrote:
Here it is

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-8-752634385ffb> in <module>()
     22
     23 w_sol = Function(V)
---> 24 solve(frm_tilde, rhs, w_sol, solver_parameters={"ksp_type":
"preonly", "pc_type": "lu"})
     25 File("w_sol.pvd") << w_sol

/home/george/polygon/firedrake_new/firedrake/local/lib/python2.7/site-packages/firedrake/solving.pyc
in solve(*args, **kwargs)
    121     else:
    122         # Solve pre-assembled system
--> 123         return _la_solve(*args, **kwargs)
    124
    125

/home/george/polygon/firedrake_new/firedrake/local/lib/python2.7/site-packages/firedrake/solving.pyc
in _la_solve(A, x, b, **kwargs)
    209                              options_prefix=options_prefix)
    210
--> 211     solver.solve(x, b)
    212
    213

/home/george/polygon/firedrake_new/firedrake/local/lib/python2.7/site-packages/firedrake/linear_solver.pyc
in solve(self, x, b)
    140         r = self.ksp.getConvergedReason()
    141         if r < 0:
--> 142             raise RuntimeError("LinearSolver failed to converge
after %d iterations with reason: %s", self.ksp.getIterationNumber(),
solving_utils.KSPReasons[r])

KeyError: -11



On 29.03.2016 18:10, Andrew McRae wrote:
> What output do you get?
>
> On 29 March 2016 at 16:09, George Ovchinnikov <lives9@gmail.com
> <mailto:lives9@gmail.com>> wrote:
>
>     Dear All,
>
>     I have trilinear form a(w,u,v) and usually solve
>     a(w,u,v) = l(v), for u with fixed w.
>
>     Here I have:
>
>     a = w dot(grad(u), grad(v)) * dx,
>     and
>     l(v) =  f * v * dx.
>
>     Now, given u_tilde I want to solve for w, i.e. find
>     w_tilde such, that
>     a(w_tilde, u_tilde, v) = l(v), for any v in suitable subspace.
>
>     I'm trying the following:
>
>     mesh = UnitSquareMesh(size, size)
>     V = FunctionSpace(mesh, "CG", 1)
>
>     f = Function(V)
>     f.interpolate(Expression("1"))
>
>     u_tilde = Function(V)
>     u_tilde.interpolate(Expression("1/(1+exp(-1*x[0])) *
>     1/(1+exp(-1*(1-x[0]))) *1/(1+exp(-1*x[1])) * 1/(1+exp(-1*(1-x[1])))" ))
>
>     w_tilde = TrialFunction(V)
>     v = TestFunction(V)
>
>     a_tilde = (w_tilde * dot(grad(u_tilde), grad(v))) * dx
>     frm_tilde = assemble( a_tilde )
>
>     L = f * v * dx
>     rhs = assemble(L)
>
>     w_sol = Function(V)
>     solve(frm_tilde, rhs, w_sol, solver_parameters={"ksp_type": "preonly",
>     "pc_type": "lu"})
>     File("w_sol.pvd") << w_sol
>
>
>     It fails to converge:
>         140         r = self.ksp.getConvergedReason()
>         141         if r < 0:
>     --> 142             raise RuntimeError("LinearSolver failed to converge
>     after %d iterations with reason: %s", self.ksp.getIterationNumber(),
>     solving_utils.KSPReasons[r])
>
>     KeyError: -11
>
>     I'm using direct method, not the iterative one, so what is happening
>     here?
>
>     _______________________________________________
>     firedrake mailing list
>     firedrake@imperial.ac.uk <mailto:firedrake@imperial.ac.uk>
>     https://mailman.ic.ac.uk/mailman/listinfo/firedrake
>
>
>
>
> _______________________________________________
> firedrake mailing list
> firedrake@imperial.ac.uk
> https://mailman.ic.ac.uk/mailman/listinfo/firedrake
>


_______________________________________________
firedrake mailing list
firedrake@imperial.ac.uk
https://mailman.ic.ac.uk/mailman/listinfo/firedrake