I'm having trouble with the resolution of the NDSolveValue solution.
For example this code from here gives the following on my machine (Windows, Version 10.4.1):
Ω = RegionDifference[Rectangle[{0, 0}, {100, 100}], Rectangle[{40, 40}, {60, 60}]];
sol = NDSolveValue[{
D[u[x, y], x, x] + D[u[x, y], y, y] == 0,
DirichletCondition[u[x, y] == 100.,
x == 40 && 40 <= y <= 60 ||
x == 60 && 40 <= y <= 60 ||
40 <= x <= 60 && y == 40 ||
40 <= x <= 60 && y == 60],
u[x, 0] == u[x, 100] == u[0, y] == u[100, y] == 0
}, u, {x, y} ∈ Ω]
DensityPlot[sol[x, y], {x, y} ∈ Ω, Mesh -> None, ColorFunction -> "Rainbow",
PlotRange -> All, PlotLegends->Automatic]
This issue persists even when I use:
Method -> {"FiniteElement",
"MeshOptions" -> {"BoundaryMeshGenerator" -> "Continuation"}}
I've tried reducing the MaxCellMeasure
to 0.01, increasing AccuracyGoal
, PrecisionGoal
, and WorkingPrecision
, set InterpolationOrder
to All. None of these changes seem to produce better results.