yes, I use the mixed function spaces only in the preconditioner, so I went for your alternative solution. However, now I get:
   L = ufl.replace(r_p, {TestFunction(self._W3), self._mptest}) \
  File "/Users/eikemueller/PostDocBath/EllipticSolvers/ufl/build/lib/ufl/algorithms/replace.py", line 61, in replace
    mapping2 = dict((k, as_ufl(v)) for (k, v) in iteritems(mapping))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/six.py", line 484, in iteritems
    return iter(getattr(d, _iteritems)(**kw))
AttributeError: 'set' object has no attribute ‘iteritems’
Thanks,
Eike
--
Dr Eike Hermann Mueller
Research Associate (PostDoc)
Department of Mathematical Sciences
University of Bath
Bath BA2 7AY, United Kingdom
+44 1225 38 5803
e.mueller@bath.ac.ukhttp://people.bath.ac.uk/em459/
 
-----BEGIN PGP SIGNED MESSAGE-----Hash: SHA1On 22/01/15 15:17, Eike Mueller wrote:Dear firedrakers,
assume I want to do the following solve of a mixed system:
V1 = FunctionSpace(mesh, 'RT', 1) V2 = FunctionSpace(mesh, 'DG',
0)
W = V1 * V2 lmbda = 1 u, p = TrialFunctions(W) v, q =
TestFunctions(W) f = Function(V1) g = Function(V2)
a = (p*q - q*div(u) + lmbda*inner(v, u) + div(v)*p)*dx
L = (dot(u,f)+p*g)*dx
u = Function(W) solve(a == L, u, solver_parameters=...)
But now I take out the line
L = (dot(u,f)+p*g)*dx
and assume that somewhere I calculate instead:
L1 = dot(TestFunction(V1),f)*dx L2 = TestFunction(V2)*g*dx
Can you define these two forms using the test functions v and qrespectively (rather than building new test functions on thesubspaces)?  Then everything should "just work".Alternately, if you haven't already assembled L1 and L2, you could (toget L), do:v1 = TestFunction(V1)v2 = TestFunction(V2)L1 = dot(v1, f)*dxL2 = v2*g*dximport uflL1p = ufl.replace(L1, {v1, v})L2p = ufl.replace(L2, {v2, v})L = L1p + L2pbut that's effectively the same as just defining L1 and L2 using v andq rather v1 and v2.  I guess you're separately using L1 and L2somewhere in a non-mixed solve?Cheers,LawrenceCheers,Lawrence-----BEGIN PGP SIGNATURE-----Version: GnuPG v1.4.10 (GNU/Linux)Comment: Using GnuPG with undefined - http://www.enigmail.net/iQEcBAEBAgAGBQJUwRbFAAoJECOc1kQ8PEYvJHAH/17RtMO14gh60/jIOLFNPxJ0AkYpR2T44g0oE0/5U2Kw3daLYl3cW1KKi9f5W2FpTy/qmCFL1pJu3qSf1hzIzktTbAdZPm1fxJXychDrZMwT+zPWDJtVHQONvX7ESBnsUmXbFz493J3nktL70DW2ovnMbdS1CDlWEBcqweQG6w7GGI/0bdrf3BYH8o9nt/PCq1Xcl6ItvUiktBwegFlRlaP/HT0pMPKASdKgtCFqHgLolZW0oiUrnekqDePTz68rzn+FUp2llYwA+YnOFUTcJ0tBx4fbsnh4ktJIg06R3jtqpZFFQuOxwvNVEqALE0FWSjPcpTWVls/VHa/w9PdIBqQ==tndm-----END PGP SIGNATURE-----_______________________________________________firedrake mailing listfiredrake@imperial.ac.ukhttps://mailman.ic.ac.uk/mailman/listinfo/firedrake