I want to solve a pde with a weak discontinuity with the PUM library. To start with easier examples I considered the problem from the fenics tutorial, chapter " Handling domains with different materials" (http://fenicsproject.org/documentation/tutorial/materials.html) . I used a mesh which has no triangle-edges along the discontinuity surfaces (otherwise I get error messages using PUM and I guess fenics can solve the problem well without PUM), e.g. $$ mesh = UnitSquareMesh(25,25,"left")$$.
I managed to write PUM-code which gives me a solution to this problem, but I have to use an additional term in the variational formulation to force the PUM-solution to be a "more continous" solution like the analytical solution (otherwise I just get $$sol = 0, y < 0.5$$ and $$sol = 1, y > 0.5$$ which is of course a solution in the enriched function space to the real problem).
As a next step, I want to estimate the error between the analytical solution (given in the tutorial) and the PUM-solution to see how good this "forcing into continuity" works. But I can't manage to compare the analytical solution with the PUM-solution because I dont know the right Functionspace in which I can represent both functions and calculate for example the difference. If I try to interpolate the analytical solution over the enriched PUM Functionspace, I get a strong discontinous function, which doesn't look like the actual solution along the line $y = 0.5$. On the other hand, I dont want to interpolate my PUM-solution over a "CG-1" function space, because I think it will change the calculated solution too much.
Has anybody an idea how I can compare the two functions and estimate for example the L2-error?
Thanks for helping me out.