9
$\begingroup$

Bug introduced in 11.1.0 and fixed in 11.2.0


I have a problem that occurs in ToBoundaryMesh in Mathematica version 11.1, whereas in 11.0 it worked fine. I defined ImplicitRegion as shown below and it looks fine, but when I use this region in ToBoundaryMesh 2 corner points are lost (I checked it with select) and boundary is wrong. Consequently, also ToElementMesh gives wrong mesh. I am sorry about decimal numbers, example is taken from bigger model. Problem appears to be random, if I for example delete some decimal numbers in criterions for region result is correct.

<< NDSolve`FEM`
reg = ImplicitRegion[(-0.6666666666666666` + x)^2 + (-0.125` + y)^2 >=
      0.0064` && (-0.6666666666666666` + x)^2 + (-0.375` + y)^2 >= 
     0.0064` && (-0.6666666666666666` + x)^2 + (-0.625` + y)^2 >= 
     0.0064` && (-0.6666666666666666` + x)^2 + (-0.875` + y)^2 >= 
     0.0064` && (-0.9333333333333333` + x)^2 + (-0.125` + y)^2 >= 
     0.0064` && (-0.9333333333333333` + x)^2 + (-0.375` + y)^2 >= 
     0.0064` && (-0.9333333333333333` + x)^2 + (-0.625` + y)^2 >= 
     0.0064` && (-0.9333333333333333` + x)^2 + (-0.875` + y)^2 >= 
     0.0064` && -y <= -0 && -1 + x <= 0 && -1 + y <= 
     0 && -x <= -0.5, {x, y}];
RegionPlot[reg]

reg

boundary = ToBoundaryMesh[reg];
boundary["Wireframe"]
pp = boundary["Coordinates"];
Select[pp, #[[1]] == 1. && #[[2]] == 1. &]
Select[pp, #[[1]] == 1. && #[[2]] == 0. &]

enter image description here

 ToElementMesh[boundary]["Wireframe"]

enter image description here

Correct solution in Mathematica 11.0.

enter image description here

$\endgroup$
2
  • 3
    $\begingroup$ That's a bug and fixed in the development version. $\endgroup$
    – user21
    Mar 31, 2017 at 11:12
  • $\begingroup$ Ok, so for now I will just use Mathematica 11. $\endgroup$
    – NZupan
    Mar 31, 2017 at 11:41

1 Answer 1

5
$\begingroup$

You could try this as a workaround for now:

boundary = 
  ToBoundaryMesh[reg, "BoundaryMeshGenerator" -> "RegionPlot", 
   "MaxBoundaryCellMeasure" -> 0.01];
boundary["Wireframe"]
pp = boundary["Coordinates"];
Select[pp, #[[1]] == 1. && #[[2]] == 1. &]
Select[pp, #[[1]] == 1. && #[[2]] == 0. &]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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