I'm trying to figure out how to use NDSolve to numerically solve PDEs where some internal values may be specified on the region of the solution. An example, which I picked from a textbook, is solving Laplace's equation $\nabla^2 f = 0$ on a region where we have Dirichlet boundary conditions on each edge, but we also have this set of points inside the region where $f = 0$.
In this particular case, what I would try would be to solve over each of the two halves of the box (left and right), and ensure that $f$ and $\nabla f$ are continuous over the boundary between the halves, but as you can imagine, not every problem is so symmetrical. If I use DirichletCondition to try to specify values on the interior of the region, NDSolve ignores the interior condition. Does anybody know a better way to do this?
Edit: My first guess as to how I should code this is as follows:
f[x_, y_] = NDSolveValue[{Laplacian[u[x, y], {x, y}] == 0, u[x, 0] == 0,
u[x, 1] == 100, u[0, y] == 100 y, u[1, y] == 100 y,
DirichletCondition[u[x, y] == 0, x == 1/2 && y <= 2/5]},
u, {x, 0, 1}, {y, 0, 1}][x, y]
But the contour plot of this solution looks like this:
So NDSolve is clearly ignoring the internal condition.