Comment 8 for bug 1083720

Revision history for this message
Martin Sandve Alnæs (martinal) wrote :

Here's a workaround:

Replace

u_fine = TrialFunction(V_fine)
v_fine = TestFunction(V_fine)

with

v_fine = Argument(V_fine)
u_fine = Argument(V_fine)

and it works fine.

Note that it's important that the test function is created before the trial function when using Argument, or you'll make the transpose when assembling the matrix.

The reason for this is that Test/TrialF. are simple hacks that fix the count (i.e. the identifier of the argument) to -2/-1 such that they get the right internal ordering. When the ufl element is the same, they compare equal from a ufl point of view and are reused in the replace algorithm. Specifically, since v_fine == v at the ufl representation level, grad(v) is reused instead of constructing grad(v_fine). This is not a problem for Functions, because they get unique counts identifying them.

I think I have a solution, but use the above workaround in the meantime.