I am trying to get an FEM solution to the steady state heat equation in a cube. I have been playing around with the different ways to define the cubic region and have found some inconsitencies and was wondering if someone could offer up a reason for why the solutions are not the same? My first method was to use the built in Cuboid function and NDSolveValue spits out a solution just fine but then I try to implicitly define a cube and NDSolveValue fails. It seems like the implict generation does not fully generate a cube while the Cuboid function does. Why is this true?
a = 5;
R = ImplicitRegion[
0 <= x <= a && 0 <= y <= a && 0 <= z <= a, {x, y, z}];
Rdis = DiscretizeRegion[R]
RegionPlot3D[R, Axes -> True, AxesLabel -> {x, y, z}]
R2 = Cuboid[{0, 0, 0}, {a, a, a}];
R2dis = DiscretizeRegion[R2]
RegionPlot3D[R2, Axes -> True, AxesLabel -> {x, y, z}]
My experience with DiscretizeRegion is that it is a promising prototype which still needs a lot of work. Let’s hope we get a better version with Mathematica 11…
<< NDSolveFEM
a = 5;
R = ImplicitRegion[
0 <= x <= a && 0 <= y <= a && 0 <= z <= a, {x, y, z}];
Rdis = DiscretizeRegion[R]
RegionPlot3D[R, Axes → True, AxesLabel → {x, y, z}]
lap = Laplacian[T[x, y, z], {x, y, z}];
\[CapitalGamma] = {DirichletCondition[T[x, y, z] == 100,
0 <= x <= a && 0 <= y <= a && z == a],
DirichletCondition[
T[x, y, z] ==
0, (0 <= x <= a && 0 <= y <= a && z == 0) || (x == 0 &&
0 <= y <= a && 0 <= z <= a) || (x == a && 0 <= y <= a &&
0 <= z <= a) || (0 <= x <= a && y == 0 &&
0 <= z <= a) || (0 <= x <= a && y == a && 0 <= z <= a)]};
sol = NDSolveValue[{lap == 0, \[CapitalGamma]},
T, {x, y, z} \[Element] Rdis];