5.0

5.0 | 6 ratings Rate this file 146 downloads (last 30 days) File Size: 120.97 KB File ID: #25555

MESH2D - Automatic Mesh Generation

by Darren Engwirda

 

12 Oct 2009

Code covered by the BSD License  

Generates unstructured triangular meshes for general 2D geometry.

Download Now | Watch this File

File Information
Description

MESH2D is a toolbox of 2D meshing routines that allows for the automatic generation of unstructured triangular meshes for general 2D geometry.

An iterative algorithm is used that attempts to optimise the mesh topology/vertex position to achieve high quality triangulations.

In addition to the fully automatic settings, MESH2D allows the user to specify sizing information, allowing for varying levels of mesh resolution within the domain.

MESH2D includes a large set of demos/benchmarks. Please see the following:

meshdemo - runs a standard set of demos.
mesh_collection - a collection of user contributed geometries.
facedemo - examples of geometry with connected faces.

MESH2D was previously released under a GNU license. This has been removed to cater for the current restrictions of the MATLAB file exchange. I apologise to the many users who have been unable to access MESH2D due to this license conflict.

Acknowledgements
This submission has inspired the following:
Remove Unconnected Triangle
MATLAB release MATLAB 7 (R14)
Zip File Content  
Other Files
license.txt,
Mesh2d v24/checkgeometry.m,
Mesh2d v24/circumcircle.m,
Mesh2d v24/connectivity.m,
Mesh2d v24/dist2poly.m,
Mesh2d v24/facedemo.m,
Mesh2d v24/findedge.m,
Mesh2d v24/fixmesh.m,
Mesh2d v24/inpoly.m,
Mesh2d v24/mesh2d.m,
Mesh2d v24/mesh_collection.m,
Mesh2d v24/meshdemo.m,
Mesh2d v24/meshfaces.m,
Mesh2d v24/meshpoly.m,
Mesh2d v24/mydelaunayn.m,
Mesh2d v24/mytsearch.m,
Mesh2d v24/quadtree.m,
Mesh2d v24/quality.m,
Mesh2d v24/refine.m,
Mesh2d v24/smoothmesh.m,
Mesh2d v24/tinterp.m,
Mesh2d v24/triarea.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (9)
14 Oct 2009 Marios Karaoulis

Hi, thanks again for your software. What's new in this version ( i am using v23).

14 Oct 2009 Darren Engwirda

Author comment: v24 was posted to resolve a licence conflict. The Mathworks no longer allows code to be released under a GNU GPL, so this has been removed for v24.

There are some (minor) revisions to the code, based on user feedback. Specifically, v24 may be slightly slower than v23, but should generally produce higher quality meshes, especially for complex geometries.

Comments/feedback is always welcome - d_engwirda@hotmail.com

18 Oct 2009 Marios Karaoulis

Do you have any thoughts going 3D?

18 Oct 2009 Marios Karaoulis  
17 Jan 2010 Wes

I would like to generate a mesh with certain nodes specified on the interior. When I try to do this I end up with areas of my domain that are not filled with elements. For example, I would like node[0.25 0.5] connected to node[0.75 0.5] and the mesh to fill the entire region from [0 0;1 0;1 1;0 1]. The actual meshes I would like to make have more complex node positions.

The following produces a hole in the mesh:

node=[0 0;1 0;1 1;0 1;0.25 0.5;0.75 0.5];
[p,t]=mesh2d(node);

19 Jan 2010 Seth  
17 Feb 2010 johnus magnus

Just a great collection of functions, thankyou!

10 Mar 2010 Robert Moucha

Many thanks,

Any plans to bypass MATLAB's tsearch?
In the 2010a release "Warning: TSEARCH will be removed in a future release. Use DelaunayTri/pointLocation instead."

11 Mar 2010 Ralph

Hallo!

  Thank you for this great work. Really, really helpful!

I need to ask a question: When using meshfaces, is it possible to use a different 'hfun' for each face?

Thanks,
  Ralph

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
mathematics Darren Engwirda 13 Oct 2009 12:36:06
fem Darren Engwirda 13 Oct 2009 12:36:07
modeling Darren Engwirda 13 Oct 2009 12:36:07
simulation Darren Engwirda 13 Oct 2009 12:36:07
fvm Darren Engwirda 13 Oct 2009 12:36:07
mesh generation Darren Engwirda 13 Oct 2009 12:36:07
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com