Comment 1 for bug 1029776

Revision history for this message
Andrew McRae (andymc) wrote :

I was about to file a bug about the same thing, then I realised what is happening:

Recall that we can express a FE function u = sum(u_i * phi_i), where phi_i are the basis functions. In a normal function space, there is a set {x_i: i = 1, ..., #dof} such that phi_j = 1 at x_j, and 0 at all the other x_i. In FEniCS, interpolating f onto a function space sets the coefficient u_i = f(x_i). Then u(x_i) = f(x_i) for each x_i (though it may differ between the x_i)

For an enriched function space, this "phi_j = 1 at x_j, and 0 at all other x_i" no longer holds, since the basis functions contain basis functions for (in your case) P1, as well as basis functions for the cubic bubble. So interpolating onto V is equivalent to "interpolate onto P1", "interpolate onto B", and adding the two, which corresponds to what you see.

I'll let someone wiser decide whether this is a bug or intended behaviour...