Could you please help with the following:

<< NDSolve`FEM`
a = 0.1;
b = 0.05;
chi = RegionUnion[Rectangle[{-a, -b}, {a, b}], Rectangle[{-b, -a}, {b, a}]];
Omega = RegionDifference[Rectangle[{-1, -1}, {1, 1}], chi];

DiscretizeRegion[] works as expected, but ToElementMesh[] produces an unexpected result. What could be the difference?

My outputs are as follows:

from DiscretizeRegion from ToElementMesh


1 Answer 1


I am not sure what you mean by unexpected. If you do not see the region hole, then you might want to upgrade your version of Mathematica. Alternatively you could try

ToElementMesh[Omega, "RegionHoles" -> {{0, 0}}]["Wireframe"]

enter image description here

If that's not the issue, you'd need to clarify a bit what you would have expected.

Another alternative is to try use

  "BoundaryMeshGenerator" -> "Continuation"]["Wireframe"]

And/or a variation of the above. But I recommend an update to the latest version of Mathematica.

  • $\begingroup$ I see a hole, but the hole is with irregular shape. I am using version 10.0. Which version do you use? $\endgroup$
    – S.E.A
    May 12, 2015 at 9:01
  • $\begingroup$ @S.E.A, see update. $\endgroup$
    – user21
    May 12, 2015 at 9:08
  • $\begingroup$ Everything is OK in 10.1. $\endgroup$
    – S.E.A
    May 18, 2015 at 8:33

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.