6
$\begingroup$

This is fixed in version 10.3.

I'm trying to solve a system of PDE over a large domain.

This doesn't means I need to have a huge amount of mesh points and mesh elements to discretize the domain. Just that the domains has a big bounding box in some units, e.g. a domain like Disk[{0,0}, 10.^6].

I can obviously choose a different unit and rescale the domain, but I'll then need to change the PDE and the nice physical constants involved in the PDE and I'll lose the nice and easy interpretation of the solution.

So I prefer to keep the more "natural" units of the domain, if possible.

However I notice that ToElementMesh keeps running continuously with my domain. Indeed:

Table[Timing@ToElementMesh[Disk[{0, 0}, r]], {r, 10^Range[4]}]

{{0.125000, ElementMesh[{{-10., 10.}, {-10., 10.}}, {TriangleElement[ "<" 488 ">"]}]}, {0.343750, ElementMesh[{{-100., 100.}, {-100., 100.}}, {TriangleElement[ "<" 488 ">"]}]}, {3.046875, ElementMesh[{{-999.998, 1000.}, {-999.998, 1000.}}, {TriangleElement["<" 474 ">"]}]}, {28.593750, ElementMesh[{{-10000., 10000.}, {-10000., 10000.}}, {TriangleElement["<" 504 ">"]}]}}

So the automatically generated mesh always has about 500 TriangleElement but the running time increase a lot with the radius of the domain.

Suspecting a relationship between this behavior and an AccuracyGoal requirement, I tried to play with the undocumented AccuracyGoal option without success.

As a workaround I can for sure 1) generate a mesh in a completely manual manner or 2) generate an automatic mesh for the unitary Disk and rescale the incidents coordinates.

But, it is possible to use directly ToElementMesh to accomplish this task, maybe adding a proper option?

System: Windows 8.1 x64, Mathematica 10.0.2.0

$\endgroup$
  • $\begingroup$ I get all timings between 0.1 and 0.2 seconds on your code. Maybe a system-dependent issue? I have Mathematica 10.0.1.0 on Mac OS X Yosemite. (Also your copy-pasted result seems to be missing the first timing.) $\endgroup$ – Rahul Jan 22 '15 at 18:46
  • $\begingroup$ @Rahul, Thanks, Fixed. Maybe also a Mathematica version issue? $\endgroup$ – unlikely Jan 22 '15 at 21:58
  • $\begingroup$ I can reproduce similar timings (to OP's) on M V10.0.2, Mac OSX 10.10.1. $\endgroup$ – Michael E2 Jan 23 '15 at 11:00
  • $\begingroup$ @MichaelE2, it seems this got introduces between V10.0.1 and V10.0.2 - what changed there is that the default boundary mesh generator was switched to the continuation method but I need to check what's going on there. $\endgroup$ – user21 Jan 24 '15 at 14:10
5
$\begingroup$

This seems to be a problem with the "Continuation" boundary mesh generator. The "RegionPlot" generator does not have this problem:

Table[Timing@
  ToElementMesh[Disk[{0, 0}, r], 
   "BoundaryMeshGenerator" -> "RegionPlot"], {r, 10^Range[3]}]


{{0.254000,ElementMesh[{{-10.,10.},{-10.,10.}},{TriangleElement[<518>]}]},
 {0.223000,ElementMesh[{{-100.,100.},{-100.,100.}},{TriangleElement[<514>]}]},
 {0.232000,ElementMesh[{{-1000.,1000.},{-1000.,1000.}},{TriangleElement[<508>]}]},
 {0.323000,ElementMesh[{{-10000.,10000.},{-10000.,10000.}},{TriangleElement[<504>]}]}}

I'll file this as a bug but can not say if it is one.

$\endgroup$
  • $\begingroup$ That should be x^2 + y^2 <= r^2 in your ImplicitRegion. But also, see my comment on the question. $\endgroup$ – Rahul Jan 22 '15 at 18:47
  • $\begingroup$ @Rahul, thanks, very attentive and indeed my forgetting the ^2 shows the same problem. I'll need to dig in a bit more. To see what's going one. $\endgroup$ – user21 Jan 23 '15 at 9:40
  • $\begingroup$ @Rahul, thanks this has been fixed by a coworker. $\endgroup$ – user21 Jan 28 '15 at 16:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.