I'm studying the dealii tutorial number 4,5 and I understand the workflow. I've also been able to find the EOC by using manufactured solution where $f$ is a smooth r.h.s. and $\alpha(x)$ smooth too.
Now I'm interested in checking the EOC when $\alpha(x)$ is discontinuous (link to Doxygen docs of dealii)
Let's say I have $\Omega = [-1,1]\times[-1,1]$ and I assume $u(x,y)=\sin(\pi x ) \sin(\pi y)$ to be the solution of
$$- \nabla \cdot (\alpha(x) \nabla{u}) = f$$ with homogeneous Dirichlet b.cs and $\alpha(x)$ defined as in the link. The forcing term I obtain is:
$$f(x,y)= \begin{cases} 20 \cdot 2\pi^2 \sin(\pi x)\cos(\pi y) \\ 2 \pi^2 \sin(\pi x)\cos(\pi y) \end{cases}$$
Looking at the EOC, it seems that my numerical solution is not converging to the true solution $u(x,y)$ (I obtain an EOC which decreases from 0.23 to 0.02...) So I'm wondering if this approach is not okay.
- How can I construct a manufactured solution when the $\alpha(x)$ is not continuous?
EDIT:
Using that $\alpha(x)$, I could set $\nabla{u}=[1,20]^T$ on $B_{1/2}(0,0)$ and $\nabla{u}=[20,40]^T$ outside $B_{1/2}(0,0)$.
This implies that $\alpha(x,y) \nabla{u}$ is continuous, actually it's constant, hence I obtain $f=0$. Also, $$u(x,y)= x+20y$$ in $B_{1/2}(0,0)$, and $$u(x,y)=20x+40y$$ outside $B_{1/2}(0,0)$. With this argument, I always have a jump in $\nabla{u}$ due to $\alpha(x,y)$.
However, I'm still facing issues in showing the convergence, and I think this may be due to the fact that I have $f=0$ as forcing term.
EDIT^2:
Following the comment from @MaximUmansky, let $\alpha \nabla{u} = \vec{f}$ such that $$-\operatorname{div}(\vec{f}) = f_x + f_y= \sin(x)+\cos(y)$$
so $\vec{f}=[\cos(x), - \sin(y)]^T$
With $\alpha$ as above, we need $\nabla{u} = [\frac{\cos(x)}{20}, -\frac{\sin(y)}{20}]$ in $B_{1/2}(0,0)$
and $\nabla{u} = [\cos(x),-\sin(y)]$ outside $B_{1/2}(0,0)$.
So I have, in $B_{1/2}(0,0)$, $$u(x,y)=\frac{1}{20}(\sin(x)+\cos(y))$$
and $$u(x,y)=\sin(x) +\cos(y)$$ outside $B_{1/2}(0,0)$.