2
$\begingroup$

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}]];
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:

from DiscretizeRegion from ToElementMesh

$\endgroup$
5
$\begingroup$

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

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

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

$\endgroup$
3
  • $\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 '15 at 9:01
  • $\begingroup$ @S.E.A, see update. $\endgroup$
    – user21
    May 12 '15 at 9:08
  • $\begingroup$ Everything is OK in 10.1. $\endgroup$
    – S.E.A
    May 18 '15 at 8:33

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.