# How to make a 2D region on the surface of 3D volume?

I am trying to define an area on a volume that I can use for a boundary condition. This is a minimum working example to show the problem my real problem involves stress analysis.

I define a region using a contour plot

cp = ContourPlot[
x - 1 + ((x^2 + y^2) (x - 1))/((x + 2) (x - 2)), {x, -1.5,
1.5}, {y, -1.5, 1.5}, Contours -> {-1.0}, ContourShading -> False]
reg = BoundaryDiscretizeGraphics[cp]


If I now try and use this region inNDSolve this is what happens

sol = NDSolve[{-Laplacian[f[x, y, z], {x, y, z}] == 1,
DirichletCondition[f[x, y, z] == 0,
z == 0 && {x, y} ∈ reg]},
f, {x, y, z} ∈ Cuboid[{-2, -2, 0}, {2, 2, 2}]]


I have now noticed that this also happens with

  sol = NDSolve[{-Laplacian[f[x, y, z], {x, y, z}] == 1,
DirichletCondition[f[x, y, z] == 0,
z == 0 && {x, y} ∈ Circle[{0, 0}, 0.1]]},
f, {x, y, z} ∈ Cuboid[{-2, -2, 0}, {2, 2, 2}]]


So there is something wrong with defining a region in this way. What is wrong and is there a work around? Thanks

• If you have an implicit description of the region as in the examples above, does this work?: sol = NDSolve[{-Laplacian[f[x, y, z], {x, y, z}] == 1, DirichletCondition[f[x, y, z] == 0, z == 0 && x - 1 + ((x^2 + y^2) (x - 1))/((x + 2) (x - 2)) < -1]}, f, {x, y, z} \[Element] Cuboid[{-2, -2, 0}, {2, 2, 2}]] May 8, 2019 at 15:39
• @MichaelE2 Yes that works but I don't have an implicit description. The implicit description was only for the minimum working example. I have a region, defined by a contour, coming out of another simulation. Thanks for the try.
– Hugh
May 8, 2019 at 16:09

rmf = RegionMember[reg];