Why does this geometry description matrix lead to problems with meshing?
Show older comments
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
Michael Carkin
on 7 Jul 2015
Unfortunately I am running into a similar issue. In most circumstances I can successfully generate both the geometry and a viable mesh. However, some geometric combinations produce an 'invalid geometry' error. For example, when creating a ring perforated by several holes the mesh will only be produced if the ring is of a minimum width. At first glance the solution appears simple: the ring's width must be larger than the diameter of the holes. In reality, the error is still produced when the ring's width is larger than that of the holes. Only relatively wide rings will allow meshing to complete. Curiously, the holes can be placed rather close to the inner diameter of the ring, yet the outer diameter of the ring must be at least 1.5 hole diameters away from the center of the perforations. The code has been checked and the geometry has been verified with a CAD program. The two reviews indicated that the geometry in question does not overlap or produce any edge intersections. In my opinion, the edge overlap detection within the PDE toolbox has a bug. Hopefully I am mistaken and someone else can shed some light on the invalid geometry error. Sorry I could not be of more help, but I wanted you to know that there are others facing similar issues.
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
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...
Answers (0)
Categories
Find more on Geometry and Mesh in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!