Group Abstract Group Abstract

Message Boards Message Boards

Implicit Definition of a Cube -vs- built in Cuboid function

Posted 10 years ago

Hello,

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}]
POSTED BY: Michael Person
5 Replies
Posted 10 years ago

Thanks! The answer on that page does not fully make sense to me but it will be enough to figure out how to move forwards!

POSTED BY: Michael Person

Michael, There is definitely some kind of bug here in the DiscretizeRegion function, I made a post here trying to get to the bottom of it.

POSTED BY: Jason Biggs
Posted 10 years ago
<< NDSolve`FEM`
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];
POSTED BY: Michael Person

Can you post the code with the NDSolve that fails? When I use the two regions for integration I get identical results,

Integrate[Exp[-x^2 - y^2 - z^2], {x, y, z} \[Element] R] === 
 Integrate[Exp[-x^2 - y^2 - z^2], {x, y, z} \[Element] R2]
(* True *)
POSTED BY: Jason Biggs

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...

POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard