Why does this geometry description matrix lead to problems with meshing?

2 views (last 30 days)
I created a geometry description matrix "gd" which is in the attached gd_bad.mat file. If you load('gd_bad.mat') you should get gd. I can successfully run dl=decsg(gd) when I use the entire gd, but I can't mesh. Here's the error:
Error using initmesh (line 105) Invalid geometry detected. Edges overlap or intersect at non-end points.
However, I can run several subsets of gd and eventually mesh, which seem to me to have about the same complexity as the original gd.
For example, I can run dl=decsg(gd(:,[1:13,15:18])) -- omitting column 14 -- and successfully produce a dl matrix. I can then run [p e t]=initmesh(dl,'MesherVersion','R2013a') and get a good mesh. BUT... the column 14 that I omitted does not add much complication. It's an outline around all the other shapes in gd. You can see this nicely by first plotting the mesh, pdemesh(p,e,t), and then overlaying the points of gd(:,14).
Similarly, I can run dl=decsg(gd(:,[1:9,11:18])) -- omitting column 10 -- and get a good dl, and subsequently a good mesh. (This time don't need to run the R2013a mesher; The R2014b is okay.) But, of course, I know the column 10 did not produce complexity that initmesh could not handle because it created a good mesh above when I omitted column 14.
Added comment later: if, with the original gd I modify column 14 (outline around all other shapes) such that one of its lines intersects one of the other shapes just a little, then I can successfully get a dl and a mesh. And, I should add, when I successfully create a mesh, I can also solve equations (a system of time independent diffusion equation, but this is not germane to the issue here).
Comment added even later: The file "gd_bad_made_good.mat" contains a gd (called now gd_good) which is the same as the original gd, except it has an addition column which is a rectangle intersecting the outer boundary and a few of the interior shapes. This meshes okay.
  3 Comments
Jian
Jian on 11 Dec 2015
I have some problems very similar to yours. I create a unit square with several non-overlap ellipse, sometimes it can generate the geometry and mesh but most of time, it doesn't works and only return an error: Error in decsg (line 103) if isempty(gd), dl1=[]; bt1=[]; dl=[]; bt=[]; msb=[]; return, end
Richard Grizivatz
Richard Grizivatz on 6 Apr 2016
Hi,
I faced same problem when trying to create union of (>3) circles, then meshing. Let's try if it works in R2016a...

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!