A mesh generator for two-dimensional triangulated geometries written in C++ and interfaced with MATLAB
Authors:
- 16 November 2026
- journal article
- Published by Emerald Publishing in Engineering Computations
- p. 1-26
Abstract
Purpose: The mesh generator in the MATLAB partial differential equation toolbox can automatically create desired meshes with simple syntax, but it has several disadvantages. This paper presents a new mesh generator for two-dimensional triangulated geometries, written in C++ and interfaced with MATLAB. Design/methodology/approach: A new MATLAB interface function, meshgeneration and its name-value arguments are designed by referring to those of the generateMesh function in the MATLAB partial differential equation toolbox. Findings: This paper describes the implementation details of the mesh-generation method and provides all the source code. Additional examples indicate that the desired meshes can be generated effectively for two-dimensional triangulated geometries with a single line of MATLAB code using different name-value arguments. Originality/value: The main features of the new mesh generator are: (1) the generated mesh preserves all nodes of triangulated geometries; (2) mesh elements are automatically refined in narrow regions; (3) the effect of mesh size growth rate (gradient) is effectively captured; (4) global and local mesh size can be easily controlled by name-value arguments; and (5) high-quality meshes can be generated.Funding Information
- National Natural Science Foundation of China (12301489)
- China Scholarship Council (202008440070)
This publication has 24 references indexed in Scilit:
- A 172-line Matlab code for structural topology optimization in the body-fitted meshStructural and Multidisciplinary Optimization, 2022
- Meshing, Geometric Modeling and Numerical Simulation 22019
- Meshing, Geometric Modeling and Numerical Simulation 12017
- PolyMesher: a general-purpose mesh generator for polygonal elements written in MatlabStructural and Multidisciplinary Optimization, 2012
- Gmsh: A 3‐D finite element mesh generator with built‐in pre‐ and post‐processing facilitiesInternational Journal for Numerical Methods in Engineering, 2009
- Mesh Generation2008
- Mesh size functions for implicit geometries and PDE-based gradient limitingEngineering with Computers, 2006
- Automatic generation of unstructured grids with Delaunay triangulation and its applicationHeat and Mass Transfer, 1999
- Triangle: Engineering a 2D quality mesh generator and Delaunay triangulator1996
- A Grid Generation and Flow Solution Method for the Euler Equations on Unstructured GridsJournal of Computational Physics, 1994