# ToElementMesh[]

<< NDSolveFEM
a = 0.1;
b = 0.05;
chi = RegionUnion[Rectangle[{-a, -b}, {a, b}], Rectangle[{-b, -a}, {b, a}]];
DiscretizeRegion[chi];
Omega = RegionDifference[Rectangle[{-1, -1}, {1, 1}], chi];
DiscretizeRegion[Omega]
ToElementMesh[Omega]["Wireframe"]


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

My outputs are as follows:

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"]


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

Another alternative is to try use

ToElementMesh[Omega,
"BoundaryMeshGenerator" -> "Continuation"]["Wireframe"]


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

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