0
$\begingroup$

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.

<< "NDSolve`FEM`"
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.

meshregion

elementmesh

$\endgroup$

closed as off-topic by m_goldberg, MarcoB, garej, C. E., Kuba Jun 15 '17 at 17:23

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – C. E., Kuba
If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ It would be much easier to answer your question if you could post your actual code - not images of it. $\endgroup$ – user21 Jun 14 '17 at 22:13
  • 3
    $\begingroup$ Possible duplicate of Same region, different meshes $\endgroup$ – m_goldberg Jun 14 '17 at 22:14
  • $\begingroup$ Thanks user21, included the code now instead of images. $\endgroup$ – jswien Jun 15 '17 at 7:03
  • 2
    $\begingroup$ The new problem is caused by a typo, you've written x^2 + y^1 <= 1 instead of x^2 + y^2 <= 1. $\endgroup$ – C. E. Jun 15 '17 at 8:48
3
$\begingroup$

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

Needs["NDSolve`FEM`"]
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]]

enter image description here

$\endgroup$
  • $\begingroup$ 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? $\endgroup$ – jswien Jun 15 '17 at 15:45
  • $\begingroup$ @user49533, if you post (as a new question) the example you have issue with I can have a look. $\endgroup$ – user21 Jun 15 '17 at 16:14
  • $\begingroup$ I just posted an example that's closer to my issue here $\endgroup$ – jswien Jun 15 '17 at 18:04

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