I'm going to solve the Laplacian equation of the electrostatic field, which consists of two triangular regions, a rectangular region, a square, and on the intersection of the two regions of $$y=x$$, there are the first and second boundary conditions. How to set the correct Boundary condition and solve the problem
tried
Ω1 = DiscretizeRegion@Triangle[{{0, 0}, {0, 1}, {1, 1}}];
(*RegionPlot[Ω1]*)
Ω2 = DiscretizeRegion@Triangle[{{0, 0}, {1, 0}, {1, 1}}];
(*RegionPlot[Ω2]*)
nv1 = NeumannValue[0, x == 0];
nv2 = NeumannValue[0, x == 1];
nv3 = NeumannValue[0, x == y];
nv4 = NeumannValue[0, x == y];
sol1 = NDSolveValue[{D[u1[x, y], x, x] + D[u1[x, y], y, y] ==
nv1 + nv3,
DirichletCondition[u1[x, y] == 10, y == 1 && 0 <= x <= 1]},
u1, {x, y} ∈ Ω1]
sol2 = NDSolveValue[{D[u2[x, y], x, x] + D[u2[x, y], y, y] ==
nv2 + nv4,
DirichletCondition[u2[x, y] == 0, y == 0 && 0 <= x <= 1]},
u2, {x, y} ∈ Ω2]
DensityPlot[sol1[x, y], {x, y} ∈ Ω1,
Mesh -> None, ColorFunction -> "Rainbow", PlotRange -> All,
PlotLegends -> Automatic]
DensityPlot[sol2[x, y], {x, y} ∈ Ω2,
Mesh -> None, ColorFunction -> "Rainbow", PlotRange -> All,
PlotLegends -> Automatic]





ToElementMeshand the tutorialFEMDocumentation/tutorial/ElementMeshCreation, especially the part starting from "A boundary element mesh may have internal structure; for example, to represent two material regions". – xzczd Aug 09 '18 at 10:49sol, because we're using the sameeq. – xzczd Aug 10 '18 at 07:28eqis defined in the way above, this is a feature of"FiniteElement"method. Please check the link at the beginning of my answer for details. – xzczd Aug 10 '18 at 08:04"FiniteElement"method is chosen, 2. the discontinuous coefficient is in proper position. Please check the linked post for details. – xzczd Aug 11 '18 at 09:15