I would like to solve the Laplace's equation in between the square domain and a disk. However, using the code below, I was able to generate mesh but not able to obtain results with correct boundary conditions.
The desired B.C.s are 1 at the outer boundary and 0 at inner circular boundary.
(*Import required FEM package*)
Remove["Global`*"]
Needs["NDSolve`FEM`"];
With[{inner = Disk[{0, 0}, {0.25, 0.25}],
outer =
Rectangle[{-1, -1}, {1, 1}]}, (mesh =
ToElementMesh[RegionDifference[outer, inner],
MaxCellMeasure -> 0.001])["Wireframe"]]
sol = NDSolveValue[{Laplacian[u[x, y], {x, y}] == 0,
DirichletCondition[
u[x, y] == 1, {x, y} \[Element] RegionBoundary[outer]],
DirichletCondition[
u[x, y] == 0, {x, y} \[Element] RegionBoundary[inner]]},
u, {x, y} \[Element] mesh]
DensityPlot[sol[x, y], {x, y} \[Element] mesh,
ColorFunction -> "TemperatureMap", PlotLegends -> Automatic]