# Workaround for Mesh Generation Bugs? [closed]

I'm having trouble with the ToElementMesh and ImplicitRegion functions. There is a known bug that causes mesh variability (bug), but I couldn't find a workaround for the problem with the mesh below.

<< "NDSolveFEM"
Omega = ImplicitRegion[x^2 + y^1 <= 1 && Norm[(x + I y)^(1/2) - 0.4] >= 0.2, {{x, 0, 1}, {y, 0, 1}}];
ToElementMesh[Omega, AccuracyGoal -> 4, MaxCellMeasure -> 0.001]["Wireframe"]
RegionPlot[Omega]


The mesh clearly does not describe the region correctly (one of the boundaries should be the unit circle) and looking at RegionPlot it might be a problem with the ImplicitRegion definition. I have attached the output regions as images.  • It would be much easier to answer your question if you could post your actual code - not images of it. – user21 Jun 14 '17 at 22:13
• Possible duplicate of Same region, different meshes – m_goldberg Jun 14 '17 at 22:14
• Thanks user21, included the code now instead of images. – jswien Jun 15 '17 at 7:03
• The new problem is caused by a typo, you've written x^2 + y^1 <= 1 instead of x^2 + y^2 <= 1. – C. E. Jun 15 '17 at 8:48

As pointed out in the comments by @C. E. there is typo in the power of y^1 - it should be y^2

Needs["NDSolveFEM"]
Omega = ImplicitRegion[
x^2 + y^2 <= 1 &&
Norm[(x + I y)^(1/2) - 0.4] >= 0.2, {{x, 0, 1}, {y, 0, 1}}];
Show[ToElementMesh[Omega, AccuracyGoal -> 4, MaxCellMeasure -> 0.001][
"Wireframe"]
, RegionPlot[Omega]] • Whoops, thanks! I'm still having a bug, which is that when I define a mesh through an expression using complex coordinates, I compute the accuracy to be less than 70% in some cases. It's concerning to me that in the "ToBoundaryMesh" documentation under "Possible Issues" there is the statement "Sometime boundary features may not be resolved well:" Do people know of any workarounds to this issue other than the one suggested in the documentation? – jswien Jun 15 '17 at 15:45
• @user49533, if you post (as a new question) the example you have issue with I can have a look. – user21 Jun 15 '17 at 16:14
• I just posted an example that's closer to my issue here – jswien Jun 15 '17 at 18:04